Recommended guardrail
Keep the same guardrails on every fallback model or provider path
When the primary model or provider fails and the code falls back to another provider, a smaller model or a canned answer, apply the same system prompt, moderation, data screening, disclosures and tool limits to the fallback result, and test the fallback. Detect exception handlers that call a second model and return its output without the guard calls the primary path applies.
This is TwinEthos's opinion of what a responsible AI integration does anyway. It is never a legal or standards requirement; where binding law applies, the law governs.
The recommended-guardrail rule files are open under CC BY 4.0; attribution and scope are in the terms.
Informational data, not legal advice. Summaries and rules have not been reviewed by a lawyer: always verify official law text for decisions. A suggested guard is intended to address each rule; adding it is not a statement of compliance to that law.
Trust and provenance
- Lane
- TwinEthos recommendation (not law) TwinEthos recommendation, not law
- Official source
- TwinEthos's own derivation record (from the corpus gap analysis and the incident registry), not an official source. The law, standards and incidents it cites are listed on this page with their own links.
- Data release
- Data release 2026.10.03.4, data as of 3 Oct 2026, schema 0.3.10. This page also reflects corpus changes made after that release; they ship in the next one.
- Legal review
- Not reviewed by a lawyer. Written by TwinEthos as its own recommendation: opinion, never law. No TwinEthos rule has been legally reviewed yet.
- Audit standard
- Audit-grade: meets all 11 checks of the TwinEthos audit standard that apply to it. The audit standard is TwinEthos's own quality bar for provenance, dates, applicability, detectors, fixtures, remediation and licences; it is not a legal review.
- Detectors
1 detector (code pattern), experimental: written from the rule's text and not yet measured for precision on real code, so treat a hit as a lead to verify.
Known limits:
- Fallbacks configured in a gateway (LiteLLM Router fallbacks, a provider-failover proxy) rather than in code.
- Guards applied in a caller rather than in the function with the fallback.
- A guard applied after the try/except to the result of both paths, or later in the except branch, makes the code compliant although this pattern still matches; check the lines after the model call before reporting.
Evidence grade
Recommended by 1 standard
1 standard or framework · 0 graded incidents.
TwinEthos recommendation, not law. Where binding law applies, the law governs. No binding law in the corpus requires this control yet. 1 standard or framework recommends it (NIST AI 600-1). 0 graded incidents cited. Context: binding law on related controls in the family “AI controls are not preserved under cost, latency, or model-change pressure” is in force in 1 jurisdiction (US-IL).
Published AI security standards mapping to this control
- NIST AI 600-1 GV-6.2-006: Test and manage the risks of rollover and fallback technologies · crosswalk status: covered
Item ids and titles from the published standards; the mapping is TwinEthos's (standards crosswalk, docs/COVERAGE.md Part 4). Cited by id, never quoted.
Family “AI controls are not preserved under cost, latency, or model-change pressure”: binding law on related controls is in force in Illinois (US-IL). Context only: it does not change this guardrail's grade.
The guard to add
Apply the same moderation, screening, disclosures and tool limits on the fallback path as on the primary path.
Put the safeguards in one place that every path passes through: a wrapper around the model call, or guard calls applied after the try/except to whichever result came back, so the primary call, the fallback provider, the smaller model and any cached or canned answer all go through the same moderation, PII screening, disclosure and tool-allowlist code. Configure fallback models (LiteLLM Router fallbacks, provider failover) with the same system prompt, tools and guardrail settings, and add a test that forces the fallback and asserts the safeguards ran.
Example (Python + two providers), before:
try:
reply = primary.chat.completions.create(model=M, messages=msgs).choices[0].message.content
reply = moderate(reply)
except openai.APIError:
reply = backup.messages.create(model=B, max_tokens=800, messages=msgs).content[0].text
return replyAfter:
try:
reply = primary.chat.completions.create(model=M, messages=msgs).choices[0].message.content
except openai.APIError:
reply = backup.messages.create(model=B, max_tokens=800, system=SYSTEM, messages=msgs).content[0].text
return moderate(reply) # the same guard on whichever path answeredControl: Fallback model or provider path skips the safeguards of the primary path. Engineering guidance, not legal advice.
Why
Fallbacks exist for the moments the system is under stress, which are also the moments nobody is watching its output. A fallback written as a quick except branch often calls the backup model directly and returns whatever it says, skipping the moderation, screening and disclosure code the primary path applies, so every outage becomes a window of unguarded output. NIST's Generative AI Profile asks organizations to test and manage the risks of rollover and fallback technologies; keeping one guarded path for every model is how that is done in code.
Class: operational integrity · set: operational integrity · maturity: reviewed · confidence: medium · id guardrail.opint-fallback-keeps-guardrails
Informational data, not legal advice. Summaries are TwinEthos's own words and rules have not been reviewed by a lawyer: check the official text before relying on any of it. A guard addresses an item; adding it is not a statement that your code meets any law.