chapter eight

8 Deploying agents and agentic systems

 

This chapter covers

  • Strategies for consuming and deploying agents
  • Dockerizing agent systems
  • Considering advanced deployment strategies
  • Security, safety & governance in production

At some point in your agent journey, you will find the need to deploy and perhaps productize your agents. This could be as simple as embedding an agent within an existing application or something more scalable and controlled, like containers. There are numerous strategies, practices, and implementations for building AI agent systems.

In this chapter, we will look at how agents built with OpenAI Agents SDK may be deployed and productized. Keep in mind that there are numerous agent frameworks and platforms you can develop and deploy your agents with, and the skills covered in this book will apply to all of them. By the end you should be able to choose an appropriate deployment strategy for your agent, containerize it, orchestrate multiple agents, and understand the basics of securing and operating them in production.

8.1 Strategies for consuming agents

For much of this book, we have looked at simple toy examples that put into practice agent concepts. However, most of these examples omitted how such agents could be consumed or deployed. How we consume agents may often dictate how we deploy those agents, be they embedded in an application or deployed as a separate microservice.

8.1.1 Embedding real-time voice agents into web applications

8.1.2 Hosting agents through an API

8.1.3 Consuming an agent web service in a web application

8.2 Dockerizing agent systems

8.2.1 Containerizing an agent microservice

8.2.2 Orchestrating agentic systems with Docker Compose

8.2.3 Externalizing local agent microservices

8.3 Considering advanced deployment strategies

8.3.1 Choosing a runtime: edge, API, or event-driven

8.3.2 The three “wires” of communication

8.3.3 Practical multi-agent topologies that adapt well

8.3.4 State, memory, and idempotency

8.3.5 Release engineering for agents (prompts, tools, models)

8.3.6 Observability matters

8.3.7 Reliability patterns: timeouts, fallbacks, and budgets

8.3.8 Cost control and model routing

8.4 Security, safety, and governance in production

8.4.1 A quick threat model for agentic systems

8.4.2 Identity and access—for people, services, and agents

8.4.3 Secrets and configuration management

8.4.4 Tool safety: sandboxing and egress control

8.4.5 Prompt‑injection and data‑exfiltration defenses

8.4.6 Safety and policy enforcement

8.5 Exercises

8.6 Summary