The Agents SDK (successor to the experimental Swarm framework) is OpenAI's production-ready runtime for building multi-agent workflows. Install via pip install openai-agents.
| Primitive | Purpose | Example |
|---|---|---|
| Agent | An LLM with instructions + tools | A customer support agent |
| Handoff | Delegate to another agent | Triage → Billing Agent |
| Guardrail | Safety validation on input/output | Block PII, reject jailbreaks |
| Tracing | Observability for debugging | Visualize agent execution flow |
from agents import Agent, Runner
# Define a simple agent
support_agent = Agent(
name="Support Agent",
instructions="You are a helpful support agent. Answer questions about our product.",
model="gpt-5.4"
)
# Run it
result = await Runner.run(support_agent, "How do I reset my password?")
print(result.final_output)