Skip to content

Docs: Fix Guardrail definition to include both input and output validations #756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant