A Tour of Agents

Comparisons / OpenAI Agents SDK

OpenAI Agents SDK vs Building from Scratch

OpenAI's Agents SDK (evolved from Swarm) provides Agent, Runner, handoffs, and guardrails. It's intentionally minimal — closer to plain Python than most frameworks. Here's how the concepts map.

ConceptOpenAI Agents SDKPlain Python
AgentAgent(name, instructions, model, tools)A function with a system prompt, model name, and tools dict
ToolsPython functions with type hints, auto-converted to schemasA dict of callables + manually written JSON schema
Agent LoopRunner.run() handles the loop internallyA while loop: call LLM, execute tool_calls, repeat
HandoffsHandoff between Agent objects for multi-agent routingCall a different agent function based on the LLM's tool choice
GuardrailsInputGuardrail and OutputGuardrail with tripwire patternTwo lists of rule functions checked before and after the LLM
ContextTyped context object passed through the agent lifecycleA state dict updated inside the loop

The verdict

The Agents SDK is the thinnest framework on this list — it barely abstracts beyond what you'd write yourself. Use it when you want OpenAI's conventions and auto-schema generation. Skip it when you want full control or use non-OpenAI models.