← All notes

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.

See also

Claims

Sources

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

Permanent ID: iil:note:kt303tm4

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.},
}

Markdown

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.