This example project demonstrates how to implement different types of guardrails using the OpenAI Agent SDK for Python with Trigger.dev.
InputGuardrailTripwireTriggered
exceptionsOutputGuardrailTripwireTriggered
exceptions with detailed error info@input_guardrail
decorator that validates user input before processing (example: math tutor that only responds to math questions)@output_guardrail
decorator that validates generated responses using a separate guardrail agentResponseTextDeltaEvent
streams with async guardrail checks at configurable intervals (example: stops streaming if language is too complex for a 10-year-old)