Part 4 of 6 · 5 min read
Interview questions and limits
Covers: Interview questions, with the follow-ups; Common mistakes; What the example does not do.
Interview questions, with the follow-ups
Why use sub-agents instead of one agent with a long context?
"Cost and reliability. An agent re-reads its whole context at each step, so one agent doing 60 steps pays about four times the quadratic term of four agents doing 15. And a long context degrades accuracy, as module 6 showed. Isolation keeps each context short, and the parent holds only results. In my simulation it halved total tokens, and the saving grew from 42 to 63 percent as sub-tasks went from 10 to 40 steps." Follow-up: "What do you give up?" Information at the boundary. The parent can no longer see why a child concluded something, so I need a result contract that carries evidence and caveats.
What should a sub-agent return?
"A typed record rather than its last message: the answer, a pointer to evidence, caveats, and a status. In my test the last message lost half the findings because two children ended with 'Done!', and returning the last few messages carried an injected instruction up to the parent. A schema makes the contract checkable, and I validate it on the parent side." Follow-up: "Is a schema enough?" No: a free-text field can still hold an instruction, and a model can fill a field wrongly. I keep authority-bearing actions out of children that read untrusted content and treat results as data.
How does isolation relate to prompt injection?
"It limits the blast radius. Untrusted content is read in a child with no or few permissions, and only a validated result reaches the parent, which holds the privileged tools. It is containment, not prevention: if the result strategy returns raw messages, the injection crosses, as in my 'last three' and 'everything' rows." Follow-up: "What else?" Least-privilege tools per agent, human confirmation for side effects, and never letting returned text become an instruction.
Does splitting into sub-agents always save tokens?
"No. Each child pays its own system prompt and the parent pays for the handoffs, so for short sub-tasks the overhead can outweigh the quadratic saving. The saving also disappears if the parent needs the child's full trace. I compare total tokens across agents against the single-agent run on the real workload." Follow-up: "What about caching?" Children sharing a system prompt and tools can share a cached prefix (module 7), which reduces the overhead; a reordered tool list in one child breaks that.
Common mistakes
- Returning only the last message and assuming it contains the result.
- Returning everything and expecting isolation to still help.
- No failure status, so a failed child looks like a finished one.
- Forgetting that the child cannot see the parent's context (constraints, user preferences, earlier findings).
- Giving a child that reads untrusted content write or send permissions.
- Judging by the parent's tokens only; the children's tokens are real cost.
- Splitting a task whose steps depend tightly on each other, so the handoffs carry most of the context anyway.
What the example does not do
- No models. Sub-agents are scripted and the typed result is pattern matching, so extraction errors, schema violations and invented fields are not modelled.
- No parallelism or latency. Sub-agents can run concurrently, which changes time but not tokens; I measured tokens only.
- No caching. With a prompt cache (module 7) the quadratic term is much cheaper and the saving from isolation is smaller.
- One topology. A parent calling children once; not nested agents, peer agents or shared memory.
- Optional real-model experiment (I did not run this): run four real research sub-tasks as one agent and as sub-agents with each result strategy, and compare answers, tokens from the provider's usage field, and what the parent received.
Check yourself
A sub-agent finishes with "Done!" and the parent carries on. What is lost, and what should the contract require? (Everything the sub-agent found. Require a typed result: findings, evidence pointers, caveats and a status, with a failed status and a reason when it could not finish.)
For the curious Isolation moves cost, not work
The sub-agents still spend tokens; the saving comes from each one re-reading a smaller context, so cost falls roughly with the square of the steps in each. The example halves total input tokens (355,654 to 178,517) on a synthetic task. If the parent needs the intermediate steps to decide anything, isolating them moves the cost without removing it.
What you will use daily at work
| Practice | What it looks like |
|---|---|
| A result schema | Findings, evidence, caveats, status. |
| Constraints passed down | The child does not see the parent context; its task must carry scope and limits. |
| Returned text is untrusted | Validate it against the schema and do not obey instructions in it. |
Draft: confirm how your orchestration framework passes results between agents.
What you must be able to say (one page)
- Context isolation means a sub-task runs in a separate agent with its own context window; the parent sees only what the sub-agent returns.
- Why it saves tokens: an agent re-reads its whole context on every step, so cost grows roughly with the square of the number of steps. Four sub-tasks of 15 steps in four contexts cost far less than 60 steps in one.
- Why it can lose information: the parent only knows what crosses the boundary. A sub-agent that ends with "Done!" returns nothing. Whether the information crosses depends on the result strategy.
- Quote these numbers, with the caveat that the task is synthetic (4 sub-tasks, 15 steps each, 2,000-token system prompt, 5 seeds):
- one agent keeping everything: 355,654 total input tokens;
- sub-agents returning a typed result: 178,517 (50 percent), the only strategy that returned all four findings, the caveat and no injected text;
- sub-agents returning the last message: 178,445 tokens but only half the findings and no caveat, because two sub-agents ended with "Done!";
- sub-agents returning everything: 186,446 tokens, all information, but 10,051 tokens in the parent and the injected instruction included.
- The saving grows with task length: the ratio of sub-agent cost to single-agent cost fell from 0.58 at 10 steps to 0.37 at 40 steps per sub-task.
- Total cost is not the parent's cost: sub-agents still spend tokens. The saving comes from smaller contexts, not from less work.