Quick Start
1
Default (already on)
Every sub-agent’s output is enveloped automatically — no setup needed.
2
Trust a specific source
Name a source in
trusted_sources to let its raw output flow through unchanged.3
Wrap manually
Call
wrap_inter_agent directly when you route agent output through your own code.How It Works
The parent receives the sub-agent’s reply already labelled, so the model reads it as information from a subordinate rather than a first-person command.Configuration Options
wrap_inter_agent takes the content plus keyword-only options.
MessageOrigin labels where a message entering an agent originated.
Envelope format
The parent sees a labelled header followed by the sub-agent’s (capped) output.source="", the header omits the origin.
When to trust a source
Trust a source only when its output can never carry text it read from the outside world.Common Patterns
Trust an internal-only planner whose output never touches external text.Best Practices
Keep the default on
Keep the default on
Every sub-agent that could see external text should stay wrapped — leave
trusted_sources unset unless you have a specific reason.Only trust sources that never surface external content
Only trust sources that never surface external content
Add a source to
trusted_sources only when its output cannot include text it read from a web page, inbound message, or tool result.Layer with prompt injection protection
Layer with prompt injection protection
Don’t rely on the envelope alone — combine it with Prompt Injection Protection for defence in depth.
Cap verbose untrusted sub-agents
Cap verbose untrusted sub-agents
Prefer a low
max_chars when a sub-agent is both untrusted and verbose to bound its footprint in the parent’s context.Related
Subagent Tool
Where the envelope wraps automatically
Prompt Injection Protection
The complementary hook-layer defence

