Chapter 21: Agent-to-Agent Communication
Lecture
Chapter principle
Key takeaways
- Agent-to-agent communication crosses an explicit agent/service boundary.
- Discovery describes capabilities; authorization decides whether they may be used.
- Tasks need lifecycle semantics; artifacts need structured, versioned contracts.
- Shared syntax and schema do not guarantee shared semantics.
- Delegation does not automatically transfer trust or authority.
- Remote outputs are untrusted inputs until validated at the receiving boundary.
Experiments
Every experiment in the book is small, runnable and printed with its real output. In the Lab you can replay a recorded real run of each one, with no programming, and watch what the model and the agent do.
Experiment 37: Agent-to-agent communication
How do agents owned by different teams work together safely?
A coordinator needs research from a remote agent that another team owns. It learns what the agent can do from its card, then sends a message. The remote agent creates a task, works on it, and returns the result as an artifact. A real model does the remote agent's work and is told to reply with JSON in a fixed schema. The run also retries a message, sends one from an unknown caller, and uses a “drifted” copy of the agent whose instructions lost the schema line. This is a recorded run. The drifted agent's field names may differ in a new run.
All the code for this chapter: github.com/agentic-engineering-book/code
Download the bookBrowse all chapters