By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
A developer-productivity agent helped a platform team for a month. Then an exploration subagent, spawned with the parent's full tool set, found a failing test, edited a config file and reported fixed. The coordinator merged the change.
Nobody had decided that exploration needed write access. It inherited everything because inheriting was the default.
Spawning is an isolation decision. Context, tools, permissions and budget are yours to set, and the exam tests whether you set them on purpose.
| Boundary | Default if you decide nothing | What to set |
|---|---|---|
| Context | The subagent starts fresh and sees only its prompt | A compact brief plus the files it needs |
| Tools | Whatever the parent can call | An allow-list for the task, read-only where possible |
| Permissions | The parent's mode | The narrowest mode that still completes the task |
| Return | Free text | A schema the coordinator validates |
| Budget | Shared with the parent | A step and time cap per subagent |
Isolation is not a security product on its own. It is a design choice that limits blast radius, cost and confusion at the same time. A copy of a full transcript saves nothing: it pays the context cost twice.
In the Agent SDK, the model asks for a subagent by calling a tool, usually the Task tool. Your configuration defines the available subagents: a name, a description, a prompt and an allowed tool set.
The model chooses by name and description. Write the description the way you write a tool description: say when to use it and when to leave it alone.
AGENTS = {
"explore": {
"description": (
"Read-only code search. Use before any edit, when you do not "
"know where the code lives."
),
"prompt": (
"Find the code that implements the task. Cite file paths and "
"line numbers. Do not edit anything."
),
"tools": ["Read", "Grep", "Glob"],
},
"fix": {
"description": (
"Apply one reviewed edit to one file. Use only after explore "
"has cited the location."
),
"prompt": (
"Apply the described change to the named file. Do not touch "
"tests or configuration."
),
"tools": ["Read", "Edit"],
},
}
def may_call(agent_name, tool_name):
return tool_name in AGENTS[agent_name]["tools"]
print(may_call("explore", "Edit")) # the isolation decision
print(may_call("fix", "Edit"))
print(len(AGENTS["explore"]["tools"]), "tools for explore")The description field is the routing signal, and it is easy to neglect. Searches the codebase invites use for every search. Read-only code search. Use before any edit, when you do not know where the code lives tells the model when this agent is the right tool.
| Option | What it controls | The decision you make |
|---|---|---|
settingSources | Which filesystem settings and instruction files load | Empty means a reproducible run with no local rules |
allowedTools | Which built-in tools any agent may call | Start empty and add what the task proves it needs |
permissionMode | How much the agent does without asking | Plan or read-only for exploration; a broader mode only for trusted automation |
agents | The subagent definitions and their tools | One job per agent, with the narrowest tool list |
hooks | Code that runs around tool calls | Policy and audit that must hold every time |
These layers stack. allowedTools says what may be called at all. The per-agent tool list narrows it. The permission mode decides what needs a human. A later lesson takes the hook layer apart.
The parent sees the subagent's final return and nothing else. Its reasoning, its wrong turns and its tool calls are gone from the parent's transcript. That is the point of isolation, and it is also the cost.
Ask for evidence, not conclusions: file paths with line numbers, the command it ran, a confidence, and what it did not check. Then validate the return before you act on it.
Extend the configuration from the snippet.
verify with read-only tools and a return of verdict, evidence and gaps.Edit from explore and describe what the parent should do when the subagent says it fixed the file anyway.The second change is the exam question in miniature: a subagent asked for something it cannot do should return an error, not improvise with a tool it does not have.
Key takeaways
A subagent starts with its own context; the parent chooses what to pass.
Restrict tools per subagent: exploration reads, editing writes, and they are not the same agent.
Define subagents in configuration and let the description drive routing.
The parent sees only the return, so require evidence and validate the shape.
Log the subagent's steps; isolation otherwise hides the failure.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.