Part VI: Agentic AI

Chapter 26: Agent Safety, Production & Operations

"With great power comes great responsibility, and with autonomous agents comes the need for even greater guardrails."

Guard Guard, Responsibly Paranoid AI Agent

Chapter Overview

Autonomous agents introduce unique risks that go beyond standard LLM safety concerns: uncontrolled tool execution, cascading failures across agent chains, privilege escalation through prompt injection, and runaway costs from unbounded agent loops. This chapter provides a comprehensive treatment of agent safety and production operations.

You will learn defense-in-depth strategies against prompt injection and tool misuse, configure sandboxed execution environments (E2B, Docker, Firecracker), instrument agent systems with distributed tracing and cost controls, design error recovery patterns including circuit breakers and self-healing behaviors, and build comprehensive test suites for multi-agent systems. The chapter also covers security benchmarks for tool-using agents and supply-chain security for agent sandboxes, bridging the agentic techniques of Part VI with the broader safety discussion in Chapter 32.

Big Picture

Autonomous agents introduce unique risks: uncontrolled tool execution, cascading failures, and unexpected behaviors. This chapter covers sandboxing, human-in-the-loop patterns, cost controls, and monitoring strategies that make agents safe for production. It bridges the agentic techniques of Part VI with the broader safety discussion in Chapter 32.

Learning Objectives

Prerequisites

Sections

What's Next?

In the next part, Part VII: Multimodal and Applications, we extend LLM capabilities to vision, audio, and document understanding, then survey major application domains.