Black Friday Deals For Authors Are On Now!

Leanpub Header

Skip to main content

Programming Multi-Agents with A2A

Achieve mastery of agent-to-agent security, authorisation, data governance, orchestration and interoperability using Python projects

Programming Multi-Agents with A2A
This book is 100% completeLast updated on 2026-11-25

This book is for developers who think that agent collaboration is only as good as the trust underneath it. Even if you're not a security specialist, I'm sure you'll still be able to follow along. It's like, if you've written a REST service and read a JSON payload, you've already got everything this book asks of you. Each chapter adds another layer, explains why that layer matters, and shows the exact commands and outputs we captured while we built it. It's not just theory, because every control we add is one you can run, break and inspect on your own machine. If something feels a bit weird, we'll just slow down and keep the reasoning in the same breath as the code.

Minimum price

$39.99

$39.99

You pay

Author earns

$

Also available for 2 book credits with a Reader Membership

PDF
EPUB
About

About

About the Book

AI agents are learning to hand work to one another. What's tricky is to make sure the collaboration is safe, governed and reliable.

This hands-on book is for intermediate to expert developers eager to build multi-agent systems on the Agent2Agent protocol and run them with confidence. Using Python on Linux, you start by publishing Agent Cards, turning requests into tasks, streaming progress and retrying without duplicate orders. After that, you sign cards, lock channels with mutual TLS, issue and verify OAuth 2.0 tokens with Keycloak, and pass trust down delegation chains. In OPA, you write least-privilege policies, label and mask sensitive data, isolate tenants and place a gateway that throttles traffic and catches prompt injection.

And finally, you get to orchestrate specialist agents across hub and mesh designs, recover from partner failures with compensating actions, add human approval gates, trace every request with OpenTelemetry and Jaeger, keep tamper-evident audit trails, test protocol conformance, and launch the whole network with Docker Compose. Eventually, you'll be able to design networks of agents that can prove identity, respect limits and keep humans in control.

Key Learnings
  • Build A2A agents in Python with Agent Cards, tasks, messages, parts and artifacts.
  • Publish discoverable skills and run a registry that selects partner agents at runtime.
  • Stream long-running work, deliver push notifications and retry safely with idempotency keys.
  • Sign and verify Agent Cards, rotate keys, and enforce mutual TLS between agents.
  • Issue, validate and exchange OAuth 2.0 tokens across delegation chains using Keycloak.
  • Write least-privilege OPA policies and gateway rules that throttle abuse and stop injections.
  • Label, trim and mask payloads, isolate tenants and validate every incoming artifact.
  • Orchestrate specialist agents with fan-out, provenance merging and saga-style compensation on failure.
  • Set autonomy tiers and approval gates that pause tasks for human review.
  • Trace, audit, drift-test and conformance-check the full network, then launch it with Docker Compose.

Table of Content
  • Getting Two Agents Talking
  • Publishing and Discovering Agent Cards
  • Managing Task Lifecycles and Artifacts
  • Streaming and Resuming Long Tasks
  • Signing and Verifying Agent Identity
  • Authenticating Agents
  • Authorizing Agent Actions
  • Governing Data Sharing Between Agents
  • Hardening Agent Front Door
  • Orchestrating Multi-Agent Workflows
  • Adding Human Approval Gates
  • Tracing and Auditing Agent Networks
  • Deploying and Testing Fulfillment Network

Author

About the Author

GitforGits | Asian Publishing House

We are the engineer’s publisher, the coder’s mentor, and the content alchemist—meticulously turning dense tech into practical gold. With a growing library of 100+ titles, we don’t just develop technical books, rather we build roadmaps for professionals across Python, MySQL, DevOps, Rust, AI, Kotlin, Arduino, Golang and everything around the massive IT ecosystem. Every chapter, every script, every project is a tool in the hands of developers who want to get things done.

Where others summarize, we construct step-by-step learning blueprints, cutting through clutter, banning the fluff, and ensuring every paragraph delivers hands-on value. Our audience isn’t learning from scratch—they’re leveling up with purpose, and we stand by them with code-first content, consistent project workflows, and a zero-redundancy approach.

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub