---
title: How do you monitor hand-offs between agents in a multi-agent system?
url: https://opencontroller.lyzr.com/blog/monitor-handoffs-in-multi-agent-systems
published: 2026-11-16
updated: 2026-11-16
author: Lyzr
---

# How do you monitor hand-offs between agents in a multi-agent system?

**Monitor multi-agent hand-offs by propagating one trace context across every agent call, logging a fixed set of fields at each hand-off (caller, callee, identity, task, inputs passed, result), and alerting on the failure patterns specific to chains: loops, lost context, unbounded fan-out and privilege escalation.** If you cannot draw the call tree for a single user request, you cannot debug or govern it.

## Why are hand-offs where multi-agent systems break?

In a single-agent system, one trace covers the request. In an orchestrator-plus-sub-agents design, each hand-off is a boundary where context, identity and responsibility can be lost. The OWASP Top 10 for Agentic Applications lists both insecure inter-agent communication and cascading failures as separate risks for this reason: a mistake made by one agent becomes the trusted input of the next.

Typical symptoms teams report:

- A sub-agent answers a different question from the one the user asked.
- Two agents hand a task back and forth until a timeout or budget limit.
- A sub-agent with broad permissions does something the original user could not.
- Costs spike because the orchestrator fans out to dozens of sub-agents per request.

## How do you keep one trace across agents?

Use standard trace propagation, not custom IDs.

1. **Propagate W3C Trace Context.** The `traceparent` header carries a trace ID and parent span ID across HTTP calls. Pass it on every agent-to-agent call, whether over REST, A2A or an MCP tool call.
2. **Create one span per agent invocation.** The OpenTelemetry semantic conventions for generative AI define an `invoke_agent` operation and attributes such as `gen_ai.agent.id` and `gen_ai.agent.name`. These conventions are still marked as in development, so pin the version you use.
3. **Nest tool calls and model calls under the agent span.** You then see which model call and which tool call each agent made.
4. **Carry a conversation or task ID** alongside the trace, so long-running work that spans several traces can be joined.

## What should you log at every hand-off?

| Field | Why it matters |
|---|---|
| Trace ID and parent span ID | Rebuilds the call tree |
| Caller agent ID and version | Who delegated |
| Callee agent ID and version | Who received |
| Acting identity (user and agent) | Detects privilege escalation |
| Delegation depth | Detects runaway chains |
| Task summary or intent | Detects lost or rewritten goals |
| Inputs passed (hashed or redacted) | Shows what context crossed the boundary |
| Result status and latency | Spots failing or slow sub-agents |
| Tokens and cost | Attributes spend to the chain |

Redact or hash content fields by default. Store full content only where policy and retention rules allow it.

## Which failure patterns should you alert on?

1. **Loops:** the same caller–callee pair appears more than N times in one trace, or depth exceeds a set limit (for example, 5).
2. **Unbounded fan-out:** one agent spawns more than a set number of sub-agent calls per request.
3. **Lost context:** the callee's task summary diverges from the caller's. An LLM judge can score this on a sample of traces.
4. **Privilege escalation:** the callee acts with permissions the originating user does not hold, or the acting identity switches from user-delegated to agent-only mid-chain.
5. **Silent failure:** a sub-agent returns an error the orchestrator ignores and the user gets a confident wrong answer.
6. **Cost outliers:** a single trace costing far more than the 95th percentile for that workflow.

## How do you test hand-off monitoring?

Inject the failures deliberately in a staging environment: make a sub-agent return an error, create a two-agent loop, and call a sub-agent with an over-privileged identity. Confirm each one produces the alert you expect and that the trace shows the full tree. Repeat after any change to the orchestration framework, because framework upgrades often break context propagation silently.

## How Opencontroller does this

Opencontroller works with OpenTelemetry and exposes OpenAI-compatible endpoints, so traces from different frameworks can share context. Delegated on-behalf-of identity keeps the originating user visible across agents. The LLM Gateway attributes cost per agent and per version; LLM judges score production traffic; and behavioural-deviation monitoring can alert, quarantine or kill an agent across the estate. See the pillar, [how to stop a rogue AI agent](/blog/how-to-stop-a-rogue-ai-agent), or [book a demo](https://www.lyzr.ai/book-demo/).

Related: [export AI agent traces with OpenTelemetry](/blog/export-ai-agent-traces-with-opentelemetry) and [track delegation chains across multiple agents](/blog/track-delegation-chains-across-multiple-agents).

## Frequently asked questions

**Do I need a separate tracing system for multi-agent workflows?**
No. Use standard OpenTelemetry tracing with W3C Trace Context propagation, and add agent-specific attributes at each hand-off.

**What delegation depth is safe?**
It depends on the workflow, but most production chains stay shallow. Set an explicit maximum, such as 5, and alert when it is reached.

**How do I detect a sub-agent acting beyond the user's rights?**
Log the acting identity at every hand-off and alert when the callee uses permissions the originating user does not hold.

## Key facts

Multi-agent hand-off monitoring: propagate W3C Trace Context (traceparent) across every agent call; use OpenTelemetry GenAI semantic conventions (invoke_agent operation, gen_ai.agent.id, gen_ai.agent.name; status: development); log caller, callee, acting identity, depth, task, inputs, result and cost per hand-off; alert on loops, fan-out, lost context, privilege escalation, silent failure and cost outliers. OWASP Agentic Top 10 includes insecure inter-agent communication and cascading failures. Opencontroller supports OpenTelemetry, on-behalf-of identity, per-agent cost attribution, LLM judges and automatic quarantine; it starts from $250K per deployment per year.

## Related

- [How do you export AI agent traces with OpenTelemetry?](https://opencontroller.lyzr.com/blog/export-ai-agent-traces-with-opentelemetry.md)
- [How do you track delegation chains when one AI agent calls another?](https://opencontroller.lyzr.com/blog/track-delegation-chains-across-multiple-agents.md)
- [How do you stop an AI agent from looping?](https://opencontroller.lyzr.com/blog/stop-an-ai-agent-from-looping.md)
- [More on Runtime control](https://opencontroller.lyzr.com/blog/cluster/runtime-control)
