Guardrails
Screen user input before the agent sees it, and its output and actions before they take effect.
OpenAI, Anthropic, Google, Simon Willison
The problem
An agent left unchecked can leak data, take harmful actions or say things that damage your brand.
Uncontrolled agents can pose risks, including executing misaligned or harmful actions, such as data exfiltration, and generating inappropriate content that can impact your brand’s reputation.
Well-designed guardrails help you manage data privacy risks (for example, preventing system prompt leaks) or reputational risks (for example, enforcing brand aligned model behavior).
Therefore
Guardrails enable you to do checks and validations of user input and agent output.
Filter user input for known injection patterns before it reaches Claude. You can use an LLM to create a generalized validation screen by providing known jailbreaking language as examples.
In use
Claude Code
Auto mode is a new mode for Claude Code that delegates approvals to model-based classifiers—a middle ground between manual review and no guardrails.
Claude (Constitutional Classifiers)
Our final production-grade system … a linear probe screens all traffic, escalating flagged exchanges to a probe-classifier ensemble for final judgment.
Where it breaks
A model that screens for attacks cannot be shown to catch them all, and a check run in parallel may finish after the model starts.
If you patch a hole with even more AI, you have no way of knowing if your solution is 100% reliable.
Blocking execution guarantees that the expensive model does not start; with parallel execution, the expensive model may already have started before the guardrail completes.
Sources
- A practical guide to building agentsOpenAI
- How we built Claude Code auto mode: a safer way to skip permissionsJohn Hughes, Anthropic, Mar 25, 2026
- Next-generation Constitutional Classifiers: More efficient protection against universal jailbreaksAnthropic, Jan 9, 2026
- Guardrails - OpenAI Agents SDKOpenAI
- Safety and Security for AI AgentsGoogle
- Mitigate jailbreaks and prompt injectionsAnthropic
- You can’t solve AI security problems with more AISimon Willison, Sep 17, 2022
Added Nov 14, 2026