azurenoops / azurenoops/spin_agent

[HIGH-2] Silent model-swap Foundry→OpenAI

Open
#643 3 comments 0 reactions 1 assignee Claimed by @jrspinella View on GitHub
area:ato-generation area:security bug priority:high
Dominant language
C#
Stars
3
Forks
1
Avg merge
18h 9m
Merged PRs (30d)
43

Description

## Problem

The agent silently swaps its backend from Azure AI Foundry to OpenAI when Foundry is unavailable or misconfigured. This swap is not surfaced to the caller or logged at a visible severity. The result is compliance output that is non-reproducible: the same prompt sent at two different times may be answered by different models with different system prompts, temperatures, and safety configurations — invalidating the auditability of generated ATO artifacts.

## Evidence / Location

- LLM client / backend selection logic: Foundry → OpenAI fallback path
- No caller notification or structured log entry on swap

## Fix

1. Make the backend swap explicit and opt-in via configuration (`AllowOpenAIFallback: true/false`), defaulting to `false` in compliance/ATO contexts.
2. If a swap occurs, log at `Error` or `Critical` severity and surface a structured warning to the caller in the response envelope.
3. Include the resolved model name and backend in every compliance response for auditability.

## Source Reviewers

Tony (B3) · flagged for Cyborg review

---
> ⚠️ **Caveat:** All findings are static read-reviews; build/tests were not run. Reproduce before treating fix as confirmed.
> 📋 **Note:** War Machine's ATO/RMF findings are still pending and will be folded in as a second batch.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.