← Knowledge Base

definition vendor reported TRACE Approved

What are AI guardrails, and what can they actually protect against?

Direct answer

**AI guardrails** are checks and controls placed around an AI system's inputs, outputs, tool calls, data access, and execution path.\n\nThey can detect or block disallowed content, irrelevant requests, sensitive-data leakage, malformed output, unsupported claims, unsafe tool arguments, or policy violations.\n\nGuardrails reduce risk, but they are not a complete security boundary. Model-based guardrails can make mistakes and be bypassed. High-impact controls—permissions, transaction limits, sandboxing, authentication, network restrictions, database constraints, and approval requirements—must be enforced by deterministic systems outside the model.

Detailed explanation

The term “guardrail” is used broadly. It may refer to:\n\n- an input classifier;\n- an output moderation check;\n- a schema validator;\n- a policy engine;\n- a tool-call interceptor;\n- a data-loss-prevention rule;\n- a permission or approval gate;\n- a factual-grounding checker;\n- a rate, cost, or value limit;\n- a sandbox or network restriction.\n\nThese controls operate at different trust levels and should not be treated as interchangeable.\n\nOpenAI's Agents SDK distinguishes:\n\n1. **Input guardrails** — checks on the initial user input.\n2. **Output guardrails** — checks on the final agent output.\n3. **Tool guardrails** — checks before and after each custom function-tool invocation.\n4. **Tripwires** — signals that stop or redirect the workflow when a check fails.\n\nInput guardrails may run in parallel with the agent for lower latency or block execution before the agent begins. Blocking is safer when the agent could call tools or incur consequential side effects before the guardrail completes.\n\nUseful guardrail layers include:\n\n### Input controls\n\n- detect harmful or disallowed requests;\n- reject oversized or malformed input;\n- identify prompt-injection patterns;\n- classify the task and permitted workflow;\n- remove or quarantine unsupported attachments;\n- enforce tenant and user access boundaries.\n\n### Retrieval controls\n\n- restrict authorised collections;\n- filter by tenant, user, project, and classification;\n- reject stale or superseded sources;\n- label retrieved content as untrusted evidence;\n- scan for prompt injection and sensitive data.\n\n### Tool controls\n\n- validate schemas and business rules;\n- check identity, scope, and resource ownership;\n- enforce amount, rate, and destination limits;\n- require approval;\n- deny unexpected network destinations;\n- redact secrets from arguments and results.\n\n### Output controls\n\n- enforce structure and allowed fields;\n- check citations and grounding;\n- detect confidential or personal information;\n- moderate disallowed content;\n- prevent unsupported certainty;\n- require abstention when evidence is insufficient.\n\n### Runtime controls\n\n- sandbox execution;\n- impose time, token, and action budgets;\n- detect loops;\n- preserve audit records;\n- stop after repeated validation failures.\n\nGuardrails have limitations. A classifier can produce false positives and false negatives. An LLM judge may share the same blind spots as the agent. A prompt-injection detector may miss a new attack. A grounding check may validate a claim against an unreliable source.\n\nThe correct design is defence in depth. Use model-based guardrails for semantic judgement and deterministic controls for enforceable authority. Test guardrails independently, measure their error rates, monitor what they block, and include adversarial cases in regression suites.

Evidence

- [OpenAI Agents SDK — Guardrails](https://openai.github.io/openai-agents-python/guardrails/) — defines input, output, and tool guardrails, blocking and parallel modes, and tripwires. - [OpenAI — A practical guide to building AI agents](https://openai.com/business/guides-and-resources/a-practical-guide-to-building-ai-agents/) — presents guardrails as a layered component of production agent systems. - [OpenAI Guardrails](https://guardrails.openai.com/) — provides guardrail examples for safety, hallucination, personally identifiable information, and other checks. - [NIST AI Risk Management Framework](https://airc.nist.gov/airmf-resources/playbook/) — provides governance, measurement, and risk-management practices applicable to AI controls. - [OpenAI — Understanding prompt injections](https://openai.com/safety/prompt-injections/) — explains why layered safeguards and constrained access are necessary rather than relying on one detector.

Linked evidence

No reviewed claim mappings are currently available for this document.

Section: ai-agents · Type: definition · Evidence: vendor reported

Approved: 19 Jul 2026

Review after: 2026-10-19

Hard expiry: 2027-07-19