Repository navigation
Design: Subagent permission surfaces and implementation agents #52
Description
Context
#49 / #51 added the first foreground read-only subagent foundation: a parent agent can spawn a child run, the child has its own runtime ledger, and the parent can inspect results through agent projection tools.
That is a useful spine, but the next step should be shaped before another implementation PR. Subagents are not one capability. They likely need several permission profiles and product modes.
Why this issue
We need one focused place to discuss the subagent surface before continuing:
- read-only local exploration
- web research subagents
- implementation subagents that can edit in an isolated boundary
- how
agent_*tools are exposed to the parent model - when a child can prompt, block, or continue without UI approval
The design filter stays the same: simple enough, elegant enough, reassuring enough.
Immediate candidates, not yet final decisions
Two cleanup ideas came out of the first read-only pass:
-
Put
agent_spawn,agent_list, andagent_outputbehind a deferredagenttool group.- This is prompt/surface economy, not a permission boundary.
- It may reduce accidental spawning and keep the always-on tool surface smaller.
-
Revisit whether read-only child agents should have raw
Bash.- Current child toolset includes
Bash,Read,Glob,Grep. - Current policy blocks
shell_unsafeinexplore, but allowsshell_safethrough a command classifier. - Without OS/worktree sandboxing, classifier-based shell safety may not be reassuring enough for a feature labeled read-only.
- Possible outcomes: remove
Bash; keep onlyRead/Glob/Grep; introduce structured read tools; or keep Bash only after a stronger sandbox exists.
- Current child toolset includes
These are likely small PR-sized improvements, but they should not be treated as the whole subagent roadmap.
Open questions
1. Read-only local agents
What is the minimum useful local read-only toolset?
Options to discuss:
Read / Glob / Greponly- add structured read helpers such as
git_status,git_diff,list_dir - keep safe Bash with tighter classification
- keep Bash only when a real OS/worktree sandbox enforces read-only
Key invariant to preserve: a read-only child should not park on a permission prompt that no UI can answer.
2. Web research agents
Some research tasks need many subagents doing web search in parallel. That is different from local read-only exploration.
Questions:
- Should web research be a separate subagent profile from local read-only?
- Is
web_readallowed by default for a web-research child, or does the parent/user approve the profile once? - How do we prevent web research children from gaining local write/shell/network-send capability?
- What should the parent see: only summaries, citations, full traces, or all tool events?
3. Implementation agents
Implementation subagents are a separate capability, not just read-only agents with more tools.
Likely shape to discuss:
- run in isolated worktree or sandbox
- allow edits only inside that boundary
- return diff, changed files, artifacts, tests, and summary
- parent/user decides whether to apply changes
- no silent mutation of the parent checkout
Questions:
- Does implementation child need
askmode,executemode, or a dedicated profile? - How are approvals routed if the child needs a risky tool?
- What is the rollback/apply contract?
- Should nested subagents wait until implementation v1 is stable?
4. Parent-facing agent tools
Current parent-facing tools are:
agent_spawnagent_listagent_output
Questions:
- Should they move into a deferred
agentgroup? - Should
agent_spawneventually accept a profile such aslocal_read,web_research, orimplementation? - Should
agent_listandagent_outputstay always-on because they are read-only projections, or move withagent_spawnfor conceptual grouping?
Non-goals for the next PR
- Do not build the full implementation agent until its boundary is shaped.
- Do not introduce nested subagents by default.
- Do not treat deferred tools as a security boundary.
- Do not rely on prompt text alone for read-only guarantees.
Possible next split
After discussion, this may split into separate PRs:
- Read-only subagent surface cleanup: deferred
agentgroup plus local read-only child toolset hardening. - Web research subagent profile: explicit network-read-only child mode with citation/trace expectations.
- Implementation subagent v1: isolated patch-producing worker with apply/review gate.
The exact split should follow from the permission model, not the other way around.
Activity
Astro-Han commentedon Jun 18, 2026
Current working decision
We are not waiting on external review for this issue. Treat this as Maka's internal design workbench for the next subagent slices.
Based on current evidence from Codex, Claude Code, and Google ADK, the clean shape is profile-based subagents, not one generic subagent with a growing permission switch.
1. Profiles
Maka should model subagents as a small set of explicit profiles:
local_read: local repository exploration. No writes, no network, no raw shell. Default first subagent profile.web_research: network-read research. Many children may run in parallel, but the capability is explicit and separate from local filesystem exploration.implementation: isolated worker that can edit only inside a worktree/sandbox boundary and returns diff/artifacts/tests for parent/user review.This keeps permission semantics readable. A child is not "a subagent with some tools"; it is a subagent running under a named product contract.
2. Local read-only boundary
For
local_read, the most reassuring Day 1 boundary is structural:Read,Glob,GrepBashWrite,Edit, browser, WebSearch, network-send, or nested agent spawningIf local shell-like inspection is needed later, prefer structured read tools such as
git_status,git_diff, orlist_dirover arbitrary shell strings. Raw Bash should wait for a real OS/worktree sandbox or an equivalent containment layer.Risk framing: keeping classifier-based safe Bash is not an emergency P0 because it mostly overlaps parent explore capability, but it is a P1 contract mismatch for a feature labeled read-only.
3. Web research boundary
web_researchshould not be folded intolocal_read.It should be an explicit profile with:
agent_outputThis supports the real use case of many research subagents without making every read-only local child network-capable.
4. Implementation boundary
implementationis a separate capability, not a relaxation oflocal_read.The implementation child should:
Nested subagents should wait until this contract is stable.
5. Parent-facing tool surface
agent_spawn,agent_list, andagent_outputshould likely move into a deferredagentgroup. This is prompt/surface economy, not security.When
agent_spawngrows, it should accept an explicit profile rather than overloading instructions text:profile: local_readprofile: web_researchprofile: implementationResearch basis
Likely next PRs
local_readcleanup: child no raw Bash; parentagent_*deferred group.web_researchprofile: explicit network-read child mode with citations, caps, and trace.implementationprofile: isolated patch-producing worker.Do not start #3 until #1/#2 have made the profile model explicit enough.
Astro-Han commentedon Jun 18, 2026
Expanded research pass: Google ADK, OpenCode, OpenHands, LangChain, and local notes
The earlier comment was directionally right but too narrow. I reread the local research notes under
notes/local/plus the reference-app deep dives, then checked Google ADK, OpenCode, OpenHands, and LangChain docs.Sources checked
Local notes:
notes/local/2026-06-18-maka-subagent-design-research.mdnotes/local/2026-06-16-agent-harness-landscape.mdnotes/reference-deep-dive-yuejing-round-2/07-subagent-orchestration.mdnotes/reference-deep-dive-yuejing-round-5/02-sprint-harness.mdExternal docs:
What changed after the wider pass
The profile idea still holds, but the next design should not be framed only as
local_read / web_research / implementation.There are four orthogonal axes:
Invocation pattern
Capability profile
local_readweb_researchimplementationExecution/isolation profile
Write-back mode
The cleanest Maka design is to keep Day 1 as foreground agent-as-tool, but make the data model leave room for profile + writeBack + isolation instead of hardcoding a single read-only child shape.
Lessons from Google ADK
Google ADK is useful because it separates primitives cleanly:
AgentTool: an agent used as a tool by another agentThe lesson for Maka is not to copy ADK state sharing directly. ADK's shared
InvocationContext/session.stateis elegant for app workflows but risky for coding agents if adopted blindly. Maka should keep child context isolated by default and pass state/artifacts explicitly.Lessons from reference app local notes
Reference app's Task tool has more dimensions than our first PR:
subagent_typevs managedagent_idTaskOutputMost important transfer: writeBack mode. Implementation subagents should not simply "edit". They should declare whether the result is
summary,decision,artifact, orpatch.The sprint harness notes add another strong lesson: evaluator should be a separate role from generator. For implementation work, a future verifier/evaluator subagent should not trust the generator's claims.
Lessons from OpenCode
OpenCode already separates:
General,Explore,ScoutExplore: read-only codebase explorationScout: external docs/dependency researchGeneral: full tool access for complex tasksThis is strong evidence for separating Maka's
local_readandweb_researchinstead of treating both as one generic read-only agent.Lessons from OpenHands
OpenHands delegation is explicitly about parallel child agents:
max_childrenexists as a control knobThe useful lesson is the spawn/delegate split for parallel research. The risky part for Maka is same-workspace execution if children can write.
Lessons from LangChain multi-agent docs
LangChain frames subagents as one pattern among several:
It also says subagents are best for parallel execution and large-context domains, but worse for repeat/simple tasks. That argues against making every helper a subagent. Skills/deferred tools still matter.
Revised working shape for Maka
Do not model subagent as one growing tool with many booleans.
Model it as:
This is conceptual, not a proposed exact API yet.
Near-term decisions
local_readweb_researchimplementationagent_*tool exposureagentgroup is still likely rightUpdated likely PR split
PR A: local-read cleanup
agent_*into deferredagentgrouplocal_readchild toolset or otherwise make the no-shell boundary explicitPR B: profile-shaped spawn
local_readPR C: web-research profile
PR D: implementation profile design/first slice
Updated non-goals