Guardrails

yes
Summary: Define validators that run alongside the agent loop to enforce business and safety rules.

Editorial Notes

Guardrails are the OpenAI Agents SDK’s mechanism for running validation alongside the agent loop, and they are essential for any agent that touches real users or takes consequential actions. Pay close attention to the distinction between input and output guardrails and to the tripwire pattern that halts execution — this is how you enforce business and safety rules without bloating the agent’s own prompt. A subtle gotcha is that a guardrail often calls a model itself, so it adds latency and cost you must budget. This parallels Mistral’s moderation API and CrewAI’s guardrails; read the agents and handoffs pages to see where validation fits in the loop.

Source: OpenAI Agents SDK
Link last verified: 2026-02-26