continuedev / continuedev/continue
Subagent execution replaces TOOL_PERMISSIONS with allow-all — bypasses all user-configured tool restrictions
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 36k
- Forks
- 5.4k
- PR merge metrics
- No merged PRs in 30d
Description
Summary
When the main agent spawns a subagent via the Subagent tool, the executor replaces the entire TOOL_PERMISSIONS service state with { tool: "*", permission: "allow" } — removing every user-configured approval restriction (Bash, Write, Edit, etc.) for the duration of the subagent run. A TODO comment acknowledges this is incomplete:
// allow all tools for now
// todo: eventually we want to show the same prompt in a dialog whether asking
// whether that tool call is allowed or not
The original permissions are restored in a finally block, but by then the subagent has already executed with unrestricted tool access.
Root cause
extensions/cli/src/subagent/executor.ts:85-88:
serviceContainer.set<ToolPermissionServiceState>(
SERVICE_NAMES.TOOL_PERMISSIONS,
{ permissions: { policies: [{ tool: "*", permission: "allow" }] } },
);
The user's granular permission configuration (e.g., Bash → ask, Write → ask, Read → allow) is wholesale replaced by allow-all for the subagent's entire lifetime.
Reproduction (code path)
- User configures granular tool permissions (e.g., Bash → ask, Write → ask)
- Main agent spawns a subagent for a focused task
- Executor sets TOOL_PERMISSIONS to
* → allowbefore subagent runs - Subagent can execute ANY tool (Bash, Write, network, etc.) without prompting
- Original permissions restored only after subagent completes
Impact
One subagent approval = blanket authorization for the subagent to execute ANY tool without review. A prompt-injected subagent task could perform arbitrary file writes, command execution, or network exfiltration using the user's credentials.
Suggested fix
Propagate the main agent's permission configuration to the subagent, or at minimum preserve disabled tools as disabled in the subagent context.
Credit
Chengzhi Yi — yimou@hust.edu.cn — GitHub: @Tardfyou
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in extensions/cli/src/subagent/executor.ts around lines 85-88 and trace how TOOL_PERMISSIONS state is replaced before subagent execution and restored afterward. Review the permission service state and subagent entry path to determine how the main agent's restrictions should be retained. Done means configured restrictions remain effective during the full subagent run, including disabled tools, without leaving permissions altered afterward.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100