Skip to content

Conversation

@Wania-Kazmi
Copy link

Summary:
This PR updates the description of Guardrails in the OpenAI Agents SDK documentation to reflect that they apply to both input and output validations.

Original Text:

Guardrails: Run input validations and checks in parallel to your agents, breaking early if the checks fail.

Proposed Update:

Guardrails: Run input and output validations and checks in parallel to your agents, breaking early if the checks fail.

Why this change is necessary:
The original statement is incomplete and potentially misleading, as it only mentions input validations. However, the [Agents SDK Guardrail Documentation] defines two distinct types of guardrails:

  • InputGuardrail: Validates user input before it reaches the agent.
  • OutputGuardrail: Validates the agent’s final output before it is returned to the user.

Both types of guardrails are critical for ensuring the safety and reliability of agent behavior. Additionally, both can trigger a Tripwire (e.g., InputGuardrailTripwireTriggered, OutputGuardrailTripwireTriggered) to halt execution when a validation fails—hence, the phrase “breaking early” applies to both.

Impact:
This correction improves clarity and accuracy, helping developers better understand the full lifecycle of guardrail checks in the SDK.

…rrect Output guardrail first step.

Enhanced the documentation for input and output guardrails by specifying that input guardrails apply only to the first agent in a sequence, while output guardrails apply only to the last agent. This clarification improves understanding of how guardrails function in agent chains.
Updated the documentation for output guardrails to specify that the guardrail receives the output produced by the agent, enhancing clarity in the guardrail process.
@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2025

This PR is stale because it has been open for 10 days with no activity.

@github-actions github-actions bot added the stale label Jun 5, 2025
@github-actions
Copy link
Contributor

This PR was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant