Agents and tools
Context isolation
Each worker should see only its brief and its own tool results. Summaries at the boundary must keep citations and caveats, not raw HTML.
The point of a sub-agent is a clean context: system prompt, task brief and its own tool results. Paste the orchestrator's whole history into every worker and you have paid for extra agents without getting isolation. Paste the worker's full trajectory back and the orchestrator drowns in raw HTML.
Concept
Context isolation means each agent only sees what it needs to do its job. Summarization at the boundary is lossy compression. Design the schema so the losses are dead ends and markup, not the citations and numbers.
The big idea
Two directions, two rules.
Out to the worker. Send the task spec only. Do not send the parent transcript, other workers' notes or the user's full chat history unless a field in the spec truly needs it.
Back to the orchestrator. Require a structured handoff. Status, findings, citations, open questions and tokens used beat a free-form essay.
A filing cabinet is a useful picture. Each clerk gets one folder, not the whole archive, and returns a one-page cover sheet. The analogy breaks because compression can drop a caveat that changes the answer. You have to make that field required.
If a worker fails, return status: "failed" with the error. Let the orchestrator retry with a revised brief or escalate. Silent empty findings are how systems "succeed" while being wrong.
Walking through a handoff
A worker that researched Adyen checkout should return something like this, not a 14,000-token browse trace:
{
"task_id": "t2",
"status": "ok",
"findings": ["Adyen requires company-id on step 2"],
"citations": [{"url": "https://docs.adyen.example/checkout", "quote": "company-id is required"}],
"open_questions": ["Pricing page is geo-gated"],
"tokens_used": 14200
}Failure injection for an eval: put "Adyen requires company-id on step 2" only in W2's raw tool result. If the final brief omits it, the handoff schema or the merge prompt is wrong, not the crawler.
Persona labels ("researcher", "critic", "writer") are fine as system prompts on workers. They are not a substitute for tools. A critic that only re-reads the writer's prose will invent issues or miss factual holes. Prefer a critic with verify_claim(url, quote) or a checklist.
Common mistakes
- Pasting the parent history into every worker. You destroy the isolation you paid for.
- Returning the full trajectory. The orchestrator then cannot see the caveat in the noise.
- Silent empty findings. A failed worker must say it failed.
Check yourself
- The Adyen company-id fact is in the worker's raw tool result but not in the final brief. What broke? The handoff or the merge, not the fetch.
- Should a critic worker only re-read the writer's prose? No. Give it a verify tool or a checklist, or it will invent issues.
Key takeaways
- Workers get a brief and their own tool results, not the parent transcript.
- Handoffs are structured: status, findings, citations, open questions.
- A dropped caveat is a schema bug. Test that known landmines survive the merge.
Further learning
Next, see what isolation does not prevent in coordination and cost.
Related
Orchestrator and workers
One planner writes a task list. Workers run those tasks in parallel with their own tools, then return condensed results.
Coordination and cost
Extra agents multiply tokens and create new failure modes. Budget the fan-out, then watch duplication, conflicting edits and lossy merges.
Multi-agent systems
When multiple agents beat one: orchestrator-subagent designs, context isolation and the cost of coordination.