Chapter 6. Secure Execution and Tool Governance
In the last chapter you learned how to make your agents more predictable and governable. But predictability doesn’t automatically translate into safety at the execution level once system access or code execution is involved. Running agents that can execute tools or access files in the wild without sandboxes, execution boundaries, or governed tool usage is like free solo climbing. It’s highly dangerous. Except that with agents, the ramifications rarely stop with a single actor. They can spill across your entire system.
One misplaced step, one unexpected tool invocation, or one silent permission leak can propagate far beyond the original boundaries. In agentic systems, failure is rarely dramatic. It’s mostly quiet. A file overwritten, a credential reused, or a tool called just outside its intended scope. By the time something looks wrong, the impact radius may already be significant. Think of your agents as capable junior engineers who never sleep. In this chapter you learn to treat them exactly that way, capable but in need of oversight and clear operational boundaries.
To contain risk, you need to architect for defense. However, in this chapter you don’t look into threats from the outside, and not how to safeguard your agents against prompt injection or malicious users. Instead, you’ll learn how you can govern a potentially rogue agent. Not rogue in the way humans go rogue. But by improvising, overreaching or just by being “helpful” ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access