{"slug": "multi-agent-systems-don-t-fail-inside-agents-they-fail-in-the-handoffs", "title": "Multi-Agent Systems Don't Fail Inside Agents. They Fail in the Handoffs", "summary": "A developer argues that multi-agent AI systems fail primarily in the handoffs between agents rather than inside individual agents, citing a UC Berkeley study that annotated more than 1,600 execution traces across seven multi-agent frameworks and identified 14 distinct failure modes in three categories: specification issues, inter-agent misalignment, and task verification. The writeup recommends capturing handoff data—sender, receiver, and task content—to monitor role violations, lost context, and whether verifiers actually check results.", "body_md": "Splitting one big agent into a team of specialists feels like good engineering. A **planner** breaks the task down, a **researcher** gathers data, a **writer** drafts, a **reviewer** approves. Clean separation of concerns. Smaller prompts. Easier to reason about.\n\nThen it ships, and something weird happens: every individual agent looks fine in testing, yet the system as a whole produces wrong answers you can't explain.\n\nThe reason is that [multi-agent systems mostly fail in the handoffs between agents](https://www.botgauge.com/blog/monitoring-multi-agent-systems-what-to-track), not inside any single one. Unclear roles, lost context, a reviewer that quietly stopped reviewing. None of that shows up when you test agents one at a time.\n\nThis is Part 1 of a three-part series on monitoring multi-agent systems:\n\nWith one agent, one model plans and acts. You read the trace, top to bottom, and the story is right there. Add more agents and three new problems appear.\n\nEach agent often runs in its own process, container or service. Without shared trace context, one user task turns into four disconnected traces in your backend. You can see the researcher's trace and the writer's trace, but nothing tells you they belong together.\n\n```\ntrace a1f3…  planner      ✅ 1.2s\ntrace 7c09…  researcher   ✅ 4.8s\ntrace e44b…  writer       ✅ 3.1s\ntrace 2d8a…  reviewer     ✅ 0.6s\n\n# Four green traces. One wrong answer. Which agent? No idea.\n```\n\nWhen the final output is wrong, the mistake could sit in any agent, or in a handoff between two of them. Working out which agent caused a failure, and at which step, is hard enough that it's an active research topic.\n\nThis is the dangerous one. A small mistake from one agent becomes the next agent's **trusted input**. The researcher grabs a stale figure; the writer builds a confident paragraph around it; the reviewer checks the prose, not the source. By the end, the original error is buried under several layers of competent-looking work.\n\nIt's the same compounding problem single agents have, except now each step is a whole agent with its own reasoning, and none of them is positioned to question what they were handed.\n\nYou don't have to guess. Researchers at UC Berkeley annotated **more than 1,600 execution traces** from **seven popular multi-agent frameworks** and identified **14 distinct failure modes**, grouped into three categories: specification issues, inter-agent misalignment, and task verification ([Cemri et al., NeurIPS 2025](https://arxiv.org/abs/2503.13657)).\n\nOne finding is worth sitting with: many failures came from **system design**, not just model limits. A better model won't fix a team where nobody owns verification.\n\nHere's how those categories translate into things you can actually monitor:\n\n| Category | What goes wrong | What to monitor | \n|---|---|---|\n| **Specification & design** | Unclear roles, ignored constraints, repeated steps | Role violations, duplicate work across agents, steps per agent per task | \n| **Inter-agent misalignment** | Lost context, withheld information, agents talking past each other, conversation resets | Handoff content vs. original task, clarification requests, context dropped between agents | \n| **Task verification** | Ending too early, never ending, no real check of the result | Termination reason, loops between agents, whether the verifier actually checked anything | \n\nNotice how much of the right-hand column is about **what passes between agents**. You can't monitor any of it unless you record the handoffs.\n\nFor every handoff, capture three things:\n\nMany multi-agent failures are plain miscommunication: the task that arrived isn't the task that was sent. Comparing the two is often the fastest route to the root cause.\n\nHere's a minimal schema:\n\n``` python\nfrom dataclasses import dataclass, field\nfrom datetime import datetime, timezone\nimport uuid\n\n@dataclass\nclass Handoff:\n    trace_id: str\n    sender: str                     # \"planner\"\n    receiver: str                   # \"researcher\"\n    task_sent: str                  # what the sender asked for\n    task_understood: str | None     # receiver's restatement (filled on receipt)\n    context_keys: list[str]         # which pieces of context were passed\n    context_tokens: int\n    permissions: list[str]          # tools/data the receiver may use for this task\n    original_goal: str              # the user's goal, carried end to end\n    handoff_id: str = field(default_factory=lambda: uuid.uuid4().hex)\n    ts: str = field(default_factory=lambda: datetime.now(timezone.utc).isoformat())\n```\n\nThe trick that makes this work is `task_understood`. Ask each receiving agent to restate its task in one sentence before it starts work, and log that restatement. It costs a few tokens and gives you something concrete to compare against.\n\n```\nRESTATE_PROMPT = \"\"\"Before you start, restate in ONE sentence the task you\nhave been given and the constraints you must respect. Output only that sentence.\"\"\"\n\ndef receive(handoff: Handoff, agent) -> Handoff:\n    handoff.task_understood = agent.complete(\n        system=agent.system_prompt,\n        messages=[{\"role\": \"user\", \"content\": f\"{handoff.task_sent}\\n\\n{RESTATE_PROMPT}\"}],\n    )\n    log_handoff(handoff)\n    return handoff\n```\n\nOnce you have `task_sent`, `task_understood` and `original_goal`, you can score how far the task drifted at every hop. Embedding similarity is a decent first pass:\n\n``` python\nimport numpy as np\n\ndef cosine(a, b):\n    return float(np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b)))\n\ndef handoff_drift(h: Handoff, embed) -> dict:\n    sent, understood, goal = map(embed, (h.task_sent, h.task_understood, h.original_goal))\n    return {\n        \"sent_vs_understood\": cosine(sent, understood),   # miscommunication\n        \"understood_vs_goal\": cosine(understood, goal),   # drift from user intent\n    }\n\nscores = handoff_drift(h, embed)\nif scores[\"sent_vs_understood\"] < 0.80 or scores[\"understood_vs_goal\"] < 0.70:\n    flag(h.trace_id, reason=\"handoff_task_mismatch\", **scores)\n```\n\nThe thresholds are placeholders. Calibrate them on a few dozen handoffs you've labelled by hand. And for high-risk flows, an LLM judge asking \"does the received task preserve every constraint in the original goal?\" catches dropped constraints that embeddings will miss (a missing \"under $500\" barely moves a vector).\n\n```\noriginal_goal:    \"Summarise Q3 churn for EU enterprise customers only\"\nplanner → researcher\n  task_sent:       \"Pull Q3 churn data for enterprise customers in the EU\"\n  task_understood: \"Pull Q3 churn data for enterprise customers\"   ⚠️ region dropped\n  sent_vs_understood: 0.91\n  understood_vs_goal: 0.74   → flagged\n```\n\nEvery downstream agent did its job well. The report was polished, the numbers were real. They were just the wrong numbers, because a constraint fell out at the first hop. Without the handoff record, you'd be debugging the writer.\n\nMonitoring and design reinforce each other. A few habits make multi-agent systems easier to observe *and* less likely to fail:\n\nIn **Part 2**, we'll stitch every agent into **one trace per task** with OpenTelemetry, give handoffs their own spans, and write a small root-cause walker that finds the agent that actually broke the task.\n\nIf you want the full picture in one place, this guide on [what to track when monitoring multi-agent systems](https://www.botgauge.com/blog/monitoring-multi-agent-systems-what-to-track) covers system, role, handoff and security metrics together.\n\n*Have you seen a constraint quietly disappear between two agents? Tell me where it went missing.* 🤝", "url": "https://wpnews.pro/news/multi-agent-systems-don-t-fail-inside-agents-they-fail-in-the-handoffs", "canonical_source": "https://dev.to/vivekdaily_1122/multi-agent-systems-dont-fail-inside-agents-they-fail-in-the-handoffs-3m46", "published_at": "2026-11-19 22:10:35+00:00", "updated_at": "2026-11-19 22:13:25.144452+00:00", "lang": "en", "topics": ["ai-agents", "ai-safety", "large-language-models", "artificial-intelligence"], "entities": ["UC Berkeley", "Cemri et al.", "NeurIPS 2025", "BotGauge"], "also_reported_by": [], "takeaway": "Log every inter-agent handoff with sender, receiver and task content, because the Berkeley study's 14 failure modes across 1,600+ traces cluster in handoffs—lost context, role violations and unverified results—that per-agent testing never surfaces.", "recommendation": {"advice": "Instrument each handoff with a shared trace ID and record the sent versus received task so you can catch lost context, role violations and verifiers that never actually checked the output.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/multi-agent-systems-don-t-fail-inside-agents-they-fail-in-the-handoffs", "markdown": "https://wpnews.pro/news/multi-agent-systems-don-t-fail-inside-agents-they-fail-in-the-handoffs.md", "text": "https://wpnews.pro/news/multi-agent-systems-don-t-fail-inside-agents-they-fail-in-the-handoffs.txt", "jsonld": "https://wpnews.pro/news/multi-agent-systems-don-t-fail-inside-agents-they-fail-in-the-handoffs.jsonld"}}