Control · C-004 · Security & Resilience

Output validation and guardrails

Every model output is validated against a schema and sanitised by deterministic code before any downstream system, tool or user interface acts on it.

Control type
Preventive
Risks addressed
11
Audience
Heads-of · Practitioner
Frameworks
AML.M0020 · AML.M0033 · LLM10
Responsible AI domain
Reviewed
2026-11-10

What it does

It treats what a model produces as untrusted input to whatever consumes it. A fixed, testable layer of ordinary code sits between the model and each consumer and rejects or neutralises anything outside what that consumer expects. The owner of each consuming system is accountable for the check; it runs on every output.

How to implement it

  • Require structured output where the consumer is a program, and validate it against a strict schema.
  • Encode or strip markup before rendering text in a browser or an email.
  • Pass generated values to databases and shells only as parameters, never as assembled statements.
  • Check tool names and arguments against an allow-list and expected ranges.
  • Screen outputs for personal and restricted data before release.
  • Fail closed: an output that does not validate is not delivered.

Evidence it operates

Design: for each consumer, a documented schema and the validation code path, reviewed by security. Operation: logs of rejected outputs with reasons; test results showing that outputs containing script, injected query fragments and unknown tool calls were blocked; no consumer reads model output by another route.

Where it fits

Built at design, tested before release, running on every response. It is the output-side counterpart to input filtering and limits what a successful prompt injection can do downstream.

Limits

It checks form and known-bad patterns. It cannot tell whether a well-formed output is true, appropriate or what the user wanted. A schema that is too loose passes harmful content; one that is too tight breaks legitimate use and gets relaxed.

Risks this mitigates

Primary mappings

Function-calling hallucination Medium
Validates that a called tool exists and that parameters and results are well formed. An agent invents a tool, a parameter or the result of a call, and the fabricated step is executed or relied on as though it had happened.
Improper output handling High
Validates and sanitises model output before any downstream system acts on it. Output from a model is passed to an interpreter, a renderer or another system without validation, so that content the model was induced to produce is executed or acted on.
Out-of-scope responses Medium
Detects and declines out-of-scope requests. A system answers questions outside its intended domain, where it has not been tested and the organisation has no authority or competence to assist.
Prompt injection High
Stops an injected instruction from reaching downstream systems as trusted output. Text supplied by a user, or contained in content the model retrieves or receives from a tool, is interpreted as an instruction and overrides the instructions the system was given.
Sensitive information disclosure Critical
Filters outputs for personal and confidential data before release. An AI system reveals personal, confidential or commercially sensitive information in its output to someone who should not have it.
Unsuitable AI-generated advice or guidance High
Detects and declines requests that cross into advice. A system gives personalised recommendations in a regulated domain without the suitability process, permissions or accuracy that advice requires.

Supporting mappings

Agent tool misuse High
Validates tool parameters before execution. An agent uses a tool it is permitted to use in an unsafe or unintended way, such as a destructive command or a wrong parameter, causing data loss, unauthorised transactions or disruption.
Hidden context exposure Medium
Catches exposure that reaches the output despite hardening. Content the operator assumed the user could not see, such as retrieved passages, tool definitions, schemas or policy logic, is revealed or inferred through the model.
Infringing AI outputs High
Filters outputs closely matching known works. Generated text, code or images reproduce protected material, and the organisation publishes, sells or ships them.

Compensating mappings

Model inversion and training data extraction High
Where retraining is impractical, filters outputs that reproduce sensitive records. An attacker reconstructs training records, or close likenesses of them, from a model's outputs or its weights.
Training data memorisation and regurgitation High
Where retraining is impractical, blocks outputs that reproduce training records. A model reproduces personal or confidential records from its training data, word for word or nearly so, in response to ordinary prompts.

Framework and clause references

FrameworkClauseTitle
MITRE ATLASAML.M0020Generative AI Guardrails Generative AI guardrails.
MITRE ATLASAML.M0033Input and Output Validation for AI Agent Components Validation of inputs and outputs.
OWASP Top 10 for LLM ApplicationsLLM10Improper Output Handling The risk this control answers.

Related terms

How to cite

Axiom Verity (2026). Output validation and guardrails. Reference Library, C-004. https://axiom-verity.com/controls/output-validation-guardrails. Reviewed 2026-11-10.