What do guardrails in the Agents SDK do?
- Exam domain
- OpenAI Responses API and Agents SDK
- Difficulty
- Medium
- In this mock
- 5 questions on this domainPractise this domain
Why A is the answer
They run safety checks and stop runs that fail
Guardrails run input validation and safety checks alongside the agent and fail fast, stopping the run when a check does not pass.
Remember: Guardrails: check and stop.
In detail
- Checks run alongside the agent.
- A failed check stops the run.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. They run safety checks and stop runs that failRight
Guardrails: check and stop.
B. They store the conversation between turnsWrong
Sessions keep history.
C. They record a trace of each runWrong
Tracing records runs.
D. They hand the whole conversation over to a human agentWrong
Escalating to a person is a design choice, not what guardrails are.
Use case
An illustrative scenario, not a real incident.
Illustrative: a homework helper stops a run when the input asks it to write a graded exam answer.
See it in different ways
flowchart LR S0["User input"] --> S1["Guardrail check"] --> S2["Agent runs"] --> S3["Output check"]
How to read this chart
- Read it in order: User input, then Guardrail check, then Agent runs, then Output check.
flowchart TD
Q{"Did the check pass?"}
Q -->|"Yes"| A0["Continue"]
Q -->|"No"| A1["Stop the run"]How to read this chart
- At "Did the check pass?": if "Yes", go to "Continue"; if "No", go to "Stop the run".