Keeping one LLM policy working when a provider changes its API response format
Write policies against a normalized response representation, not against provider payloads. Validate every raw response against a declared schema, map it through a versioned adapter, and define explicit behavior for anything unrecognized. Test the policy against recorded and synthetic responses before and after each change, and record the schema and policy versions in the evidence for every decision.
Separate policy intent from provider payloads
- 1
Declared provider schemas
Define each provider response schema, valid value ranges, and semantic field types, and record an owner for each.
- 2
Runtime schema validation
Validate each raw response before normalization so unfamiliar structure is flagged rather than silently ignored.
- 3
Versioned adapters
Tie each adapter to the schema version it was built for and release changes through normal review.
- 4
Enumerated normalized format
Anything outside the enumerated format is unrecognized by definition and must trigger defined handling.
- 5
Single policy definition
Policies reference normalized components only, so the same rule applies to every provider.
- Maintain a response corpus per provider, including streaming and tool-call cases.
- Assert expected outcomes against normalized components, not raw fields.
- Add synthetic drift cases: renamed fields, new block types, altered chunks.
- Re-run the corpus on every adapter, schema, or policy change.
- Alert on validation exceptions and unmapped values per provider.
- Retain policy version, schema version, and adapter version with each decision record.
- Does enforcement run in the execution path and inspect a normalized representation, not raw payloads?
- Is one policy definition applied unchanged across all supported providers and models?
- How are adapters versioned, and what happens when a response fails schema validation?
- Can fail-open, fail-closed, and escalation be set per policy or risk class?
- How are streaming chunks, tool calls, new content blocks, and finish reasons handled?
- Can the evidence show which policy and schema version applied before and after a change?
Why a format change is an enforcement-continuity problem
A policy that inspects response content depends on knowing where that content lives. If a rule reads a specific field path in one provider's payload, the rule is coupled to that provider's format. When the provider renames a field, nests content differently, adds a new content block type, changes how a streamed chunk is delimited, or restructures a tool call or finish reason, the rule can stop seeing the content it was written to inspect.
The failure is usually quiet. A rule that no longer finds its target field typically evaluates as if there were nothing to match, so the response passes. That is a silent fail-open. The opposite also happens: a strict parser rejects an unfamiliar payload and blocks legitimate traffic, which is a fail-closed outage. A third effect is inconsistent evidence. If the decision record copies provider-specific fields, records from before and after the change are no longer comparable, and a regulated enterprise cannot easily show that the same policy applied throughout.
This is not a model-quality or cost issue. The model may behave identically while enforcement coverage changes underneath it. Treat it as a continuity requirement: policy intent must stay stable while payload shapes move.
Decide what happens to unrecognized content
Schema validation will eventually report a response it cannot fully map. The behavior in that case is a policy decision and should be written down per risk class, not left to parser defaults.
Fail-open lets the response through. It preserves availability but means unevaluated content reaches users or downstream tools, which is rarely acceptable for regulated data. Fail-closed blocks the response. It protects against unevaluated content but turns a harmless provider change, such as an added metadata field, into an outage if the validator is too strict. Escalation routes the response to a human approver. It suits high-consequence interactions where neither default is right, but it adds latency and requires an approver queue that can keep up.
A workable approach is to distinguish kinds of deviation. An unknown field outside the policy-relevant set can be tolerated and recorded. A missing or malformed policy-relevant field, or an unknown content block type that may carry text or instructions, should fail closed or escalate for higher-risk policies. Whichever choice applies, record that a validation exception occurred, so the decision is visible in the evidence rather than hidden in a pass.
Streaming and tool-call edge cases
Streaming changes the unit of inspection. A rule may need to evaluate partial content, so the normalized representation has to define how chunks are assembled, what is evaluated incrementally, and what is evaluated once the stream completes. If a provider alters its chunk delimiting or event types, the adapter must still produce the same normalized sequence. Decide in advance what happens when a violation is detected mid-stream, for example whether the stream is terminated and what is recorded.
Tool calls need the same discipline. Policy should see the tool name and arguments as normalized components, regardless of how a provider nests them. A changed finish-reason vocabulary matters too: if a rule depends on a stop reason to decide that a response is complete or that a tool call is pending, map each provider value to a small normalized set and treat unmapped values as unrecognized.
New content block types are the most likely source of silent gaps. Default to treating an unmapped block type as unrecognized, not as empty.
Enforcement path that survives format changes
Raw provider response
Any provider-specific payload, including streamed chunks and tool calls.
Schema validation
Unrecognized structure is detected explicitly, not skipped.
Versioned adapter
Maps provider fields to the normalized representation.
Policy decision
One policy evaluates normalized components: allow, redact, or block.
Evidence record
Same format across providers, with schema and policy versions.
Keep one policy enforced as provider formats change
Talk through your provider mix, your unrecognized-format handling, and the evidence your auditors expect to see.
Talk to an ExpertHow does your AI governance program compare?
See where your program has gaps in less than 2 minutes.