Run input and output guardrails, and trip a wire when a check fails
Answer: Guardrails let you check and validate user input and agent output. Input guardrails run on the initial user input. Output guardrails run on the final agent output. A tripwire rejects the candidate final output. Approval policies cover the tool-call side of the same problem.
Why it matters
Guardrails enable you to do checks and validations of user input and agent output. There are two kinds. Input guardrails run on the initial user input, and only for the first agent in the chain. Output guardrails run on the final agent output, and only for the agent that produces that output.
If the tripwire is triggered, an exception is raised so you can appropriately respond to the user. A tripwire rejects the candidate final output. Output guardrails always run after the agent completes.
Tool calls need a different check. Inspect's approval mode lets you create fine-grained policies for tool calls made by models. Custom approvers can approve, reject, or escalate to another approver. Use guardrails for input and output, and use approval when the model wants to act.
Input guardrailInput guardrails run on the initial user inputOutput guardrailA tripwire rejects the candidate final outputApprover for toolsApprove, reject, or escalate a tool call
See also
Claims
- id: C1 claim: Input guardrails run on the initial user input. source: S1 evidence: "Input guardrails run on the initial user input"
- id: C2 claim: A tripwire rejects the candidate final output. source: S1 evidence: "A tripwire rejects the candidate final output."
- id: C3 claim: Custom approvers can approve, reject, or escalate a tool call. source: S2 evidence: "Custom approvers that decide to either approve, reject, or escalate to another approver."
Sources
- [S1] Guardrails. OpenAI Agents SDK. https://github.com/openai/openai-agents-python/blob/main/docs/guardrails.md . License: MIT. Accessed 2026-11-22.
- [S2] Tool Approval. Inspect AI (UK AI Security Institute). https://github.com/UKGovernmentBEIS/inspect_ai/blob/main/docs/approval.qmd . License: MIT. Accessed 2026-11-22.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: OpenAI Agents SDK, Guardrails, MIT; Inspect AI, Tool Approval, MIT. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: OpenAI Agents SDK, Guardrails, MIT; Inspect AI, Tool Approval, MIT.
Cite this
iinventedlight. 2026. "Run input and output guardrails, and trip a wire when a check fails." iinventedlight Library, iil:note:kt303tm4, version of 2026-11-22. https://iinventedlight.com/library/notes/writing-agent-guardrails/. License: CC-BY-4.0.
@misc{iil_note_kt303tm4,
author = {{iinventedlight}},
title = {{Run input and output guardrails, and trip a wire when a check fails}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-22},
url = {https://iinventedlight.com/library/notes/writing-agent-guardrails/},
note = {Permanent ID iil:note:kt303tm4. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/writing-agent-guardrails.md.