About This Book
This book teaches you how to build production-grade AI agents with the OpenAI Agents SDK. You will move beyond prototype scripts to architectures that separate harness logic from sandboxed execution, orchestrate subagents across different models and providers, and recover from failures without losing operator context.
Who this book is for
You are an intermediate Python developer who already writes agent prototypes and now needs to ship them. You have outgrown monolithic function-calling scripts and want clear trust boundaries, isolated execution environments, and patterns for routing work to specialized subagents. If you are ready to treat sandboxing, harness design, and subagent topology as first-class concerns, this book is written for you.
What you will learn and build
You will construct an incident triage platform that exercises every layer of a production agent stack. Starting with a single sandboxed agent that inspects filesystems and applies runbook patches safely, you will progress to multi-agent orchestration where classifier, log analyst, and remediation planner subagents run in parallel across distinct sandboxes. You will implement snapshot and rehydration for long-running investigations, add input and output guardrails, write integration tests that exercise sandbox boundaries, and deploy with a clear operational stance on provider selection and isolation. By the final chapter, you will also have a migration path for converting legacy function-calling agents into sandboxed agents on the new SDK surface.
How to use this book (recommended reading path)
Read Part I to set up your environment and understand the three-layer model of harness, sandbox, and state. Part II guides you through your first sandboxed agent, code mode, and session lifecycle. Part III introduces handoffs, agents-as-tools, parallel fan-out, and advanced manifest strategies. Part IV hardens the platform with guardrails, tests, deployment patterns, and a migration path from legacy function-calling agents. Each chapter builds on the incident triage application, so follow the sequence unless you are already comfortable with the SDK fundamentals.
High-level prerequisites
You should be fluent in Python 3.10+, comfortable with asynchronous programming, and familiar with OpenAI API concepts such as tool calling and chat completions. Basic Docker knowledge helps but is not required. No prior experience with the OpenAI Agents SDK is assumed.
