Skip to main content

Spawn Detection & Trace Propagation

While sub-agent detection works passively via traffic analysis, spawn detection actively identifies agent creation in MCP tool calls and propagates trace context through the agent hierarchy.

Spawn Patterns

Quint ships with 8 built-in patterns that match tool calls indicating agent creation:
IDDescriptionTool PatternConfidenceSpawn Type
openai-handoffOpenAI Agents SDK transfer*transfer_to_*0.90delegation
generic-create-agentGeneric agent creation*create*agent*0.85direct
a2a-delegationAgent-to-Agent protocol*send_task*0.85delegation
run-agentRunning another agent*run*agent*0.85direct
invoke-assistantInvoking an assistant*invoke*assistant*0.80direct
delegation-flagDelegation keywords in args* (any tool)0.75delegation
shell-agent-spawnShell exec launching agents*exec*0.70fork
subtask-spawnTask decomposition*task*0.65delegation

Argument Scanning

Some patterns also check tool call arguments for keywords:
  • delegation-flag: delegate, handoff, transfer, spawn_agent
  • shell-agent-spawn: agent, assistant, claude, gpt, llm
  • subtask-spawn: subtask, sub_task, child_task, delegate_task
  • generic-create-agent: agent, assistant, model

Child Hint Extraction

When a spawn is detected, Quint extracts the child agent’s identity hint from:
  1. Tool name patterns (e.g., transfer_to_research_botresearch_bot)
  2. Argument fields: agent, agent_name, agent_id, assistant, assistant_id, target_agent, delegate_to

Spawn Tickets

For cryptographically verified parent-child links, Quint issues HMAC-SHA256 spawn tickets when a spawn is detected.

Ticket Format

base64url(claims_json).base64url(hmac_sha256_signature)

Claims

{
  "pid": "parent-agent-id",
  "pname": "anthropic:bold-amber-falcon",
  "child": "research_bot",
  "d": 1,
  "sc": "tools:read",
  "tid": "trace-uuid",
  "st": "delegation",
  "exp": 1709654400,
  "n": "random-16-byte-nonce"
}
FieldDescription
pidParent agent ID
pnameParent agent name
childChild hint (extracted from tool call)
dDepth in agent hierarchy
scNarrowed scopes for child
tidTrace ID for correlation
stSpawn type: direct, delegation, fork
expExpiration (default: 5 minutes from creation)
nRandom nonce (replay protection)
Tickets are signed with a per-instance 32-byte random secret. The child presents the ticket to the proxy, which verifies the HMAC and establishes the parent-child link with 1.0 confidence.

Trace Context

Quint propagates trace context through two mechanisms:

HTTP Header: X-Quint-Trace

X-Quint-Trace: {trace_id}.{depth}
Example: X-Quint-Trace: a1b2c3d4-e5f6-7890.2 The trace ID is a UUID generated at the root agent. Depth increments at each spawn. This header is used in the forward proxy to link CONNECT tunnels to parent agents.

In-Band Field: _quint

For MCP stdio transport (where HTTP headers aren’t available), trace context is embedded in JSON-RPC params:
{
  "method": "tools/call",
  "params": {
    "name": "query_database",
    "arguments": { "query": "SELECT *" },
    "_quint": {
      "trace_id": "a1b2c3d4",
      "depth": 1,
      "spawn_ticket": "eyJwaWQi...signature"
    }
  }
}
The _quint field is stripped before forwarding to the actual MCP server.

In-Band Auth

The _quint field in MCP initialize params can also carry authentication:
{
  "_quint": {
    "api_key": "sk-...",
    "token": "qt_agent_...",
    "agent_name": "my-bot",
    "spawn_ticket": "eyJwaWQi..."
  }
}

Signal Flow

When a spawn is detected, the following happens:
1

Pattern Match

The tool call matches a spawn pattern. A SpawnEvent is emitted with the pattern ID, confidence, and child hint.
2

Ticket Generation

An HMAC-SHA256 spawn ticket is created with the parent’s identity, narrowed scopes, and a 5-minute TTL.
3

Ticket Injection

The ticket is injected into the tool call’s _quint field (MCP) or made available via X-Quint-Trace (HTTP).
4

Child Verification

When the child agent connects, it presents the ticket. Quint verifies the HMAC signature and establishes the relationship with 1.0 confidence.
5

Correlation

The spawn signal is sent to the correlation engine, which merges it with any other signals (temporal, context, model divergence).
6

Streaming

The spawn event is published to the agent.spawns.detected Kafka topic.