Skip to main content
Inter-agent provenance wraps every sub-agent’s returned text in a bounded “data, not instructions” envelope so injected upstream text cannot drive the parent.

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.
When 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.
Wrap at a custom cross-agent seam when you route agent output through your own code.
Raise the cap for long research reports.

Best Practices

Every sub-agent that could see external text should stay wrapped — leave trusted_sources unset unless you have a specific reason.
Add a source to trusted_sources only when its output cannot include text it read from a web page, inbound message, or tool result.
Don’t rely on the envelope alone — combine it with Prompt Injection Protection for defence in depth.
Prefer a low max_chars when a sub-agent is both untrusted and verbose to bound its footprint in the parent’s context.

Subagent Tool

Where the envelope wraps automatically

Prompt Injection Protection

The complementary hook-layer defence