Docs: Fix Guardrail definition to include both input and output validations #756
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Proposed Update:
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.