OpenAI’s Agents SDK landed in March 2025 next to the Responses API, and within a week there were tutorials for a support bot, a research assistant, and something that books dinner reservations. A year on, the tutorials still outnumber the production deployments. That gap is the interesting part.
Most teams that experiment with openai ai agents hit the same wall somewhere around week three. The demo works. The pilot works. Then a real user types something unexpected, a tool returns a 500, and the agent cheerfully invents an answer, calls the same function four times, and bills you for 90,000 tokens doing it. Understanding why that happens is mostly a matter of understanding what an agent actually is.
An agent is a model plus a loop
That’s the whole trick, and it’s worth being blunt about it. A chatbot takes your message, produces text, and stops. An agent takes your message, decides on an action, runs that action through a tool, looks at what came back, and then decides again. The loop continues until the model says it’s finished or until you cut it off.
Everything that makes agents useful follows from that loop. Everything that makes them dangerous follows from it too. Because the model is choosing the next step rather than following a script, you get flexibility you can’t hand-code. You also get a system whose behaviour is genuinely hard to predict in advance.
The bits OpenAI gives you
The current stack has three layers that matter. The Responses API handles the model call itself and can hold conversation state server-side, so you’re not shuttling message arrays back and forth. It also ships hosted tools: web search, file search over your own vector stores, a code interpreter, and computer use for driving a browser or desktop.
The Agents SDK sits on top and gives you the primitives for building multi-step systems: agents, handoffs, guardrails, sessions, and tracing. It’s a small library by design, closer to a set of conventions than a framework. If you want the longer walkthrough of what each piece does and how to deploy without the thing collapsing under its own complexity, there’s a solid guide to the OpenAI Agents SDK build and deployment workflow that covers it end to end.
The third layer is the model itself. Reasoning models changed the economics here, because a model that plans before acting tends to need fewer loop iterations to finish a task. Fewer iterations means less latency and a smaller bill.
Handoffs, and the swarm idea that won’t die
A handoff is a function. The agent calls it, and instead of returning a value it returns a different agent, which then takes over the conversation with the full context. A triage agent routes billing questions to a billing specialist and technical questions to a technical one. That’s it. There’s no orchestration server, no message bus.
The metaphor that grew up around this, the swarm, is more marketing than architecture. Agents don’t negotiate or reach consensus. They pass a baton. If you want the honest version of how that transfer works and where the analogy starts to mislead people, this breakdown of how OpenAI Swarm handoffs really work is worth ten minutes before you design anything.
In practice, most production systems use two or three agents, not twenty. A router, one or two specialists, and a fallback that hands control to a human. If you want to see the shape of that in code, the step-by-step build of a multi-agent support triage bot is a decent template to copy before you adapt it.
What goes wrong when agents meet the real world
The failure modes are not hypothetical. In one documented case, OpenAI agents probing Wikipedia’s tools generated enough traffic to look like an attack, largely because an agent trying to complete a task has no natural sense of restraint. It found an endpoint, it used it, and it kept using it.
Worse, there have been incidents where unsecured agents published user images to the open internet. The pattern in almost every one of these stories is the same: an agent was given a credential or a network path that nobody thought about, because the person who set it up was focused on whether the task would complete, not on what the agent could reach.
Three practical lessons come out of those incidents.
- Scope credentials per agent, not per project. A research agent that only needs read access to one bucket should not inherit the service account the whole team uses.
- Treat tool outputs as untrusted input. If a web page can contain an instruction, an agent reading that page can be hijacked. Prompt injection through retrieved content is the single most common attack path in deployed agents.
- Put a human on anything irreversible. Sending an email, deleting a record, moving money, posting publicly. Read freely, write with approval.
Guardrails that hold up under pressure
Guardrails in the Agents SDK are functions that run alongside the agent, checking inputs before the model sees them and outputs before the user does. If one trips, execution halts and you handle it. They’re useful, but they’re classifiers, and classifiers make mistakes. Use them as one layer, not the layer.
Tracing does more day-to-day work than most teams expect. Every run produces a trace of each model call, each tool invocation, each handoff, with token counts and timings. When an agent misbehaves, the trace usually tells you within a minute whether the problem was a bad prompt, a bad tool description, or a bad tool.
Two cheap controls that pay for themselves immediately: a hard cap on loop iterations, and a per-conversation token budget. Without them, a confused agent in a retry loop can run for twenty minutes and cost more than a month of a human’s time.
Latency is the constraint nobody plans for
A five-step agent loop with a reasoning model behind it can take 30 to 60 seconds to respond. Users tolerate that for a research task and abandon it for a chat window. Design accordingly: show progress, stream intermediate reasoning summaries, and don’t put a deep agent behind a text box that looks instant.
Where to point an agent first
The teams getting value out of openai ai agents tend to start with work that’s boring, repetitive, and easy to verify. Not the flashy stuff. Verification is the key property, because if you can’t check whether the agent got it right, you can’t improve the prompt, the tools, or the model choice with any confidence.
Good first candidates look like: reconciling two lists and flagging the mismatches, pulling structured fields out of inbound email, summarising a long thread against a rubric, or triaging tickets by category. Each one has a checkable answer, a narrow toolset, and a clear cost of being wrong.
Bad first candidates look like anything open-ended and customer-facing with a write action at the end. Those are where the incidents come from, and a single bad public output costs more trust than a year of internal efficiency saves.
The unglamorous reality of shipping one of these is that maybe 20% of the work is the agent and 80% is everything around it: the tool schemas, the evals, the retry logic, the audit trail, the permissions. The model is the easy part now. The scaffolding is the job.

