You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Granular task permissions (permission.task with per-agent allow/deny) are not enforced due to two bugs also present upstream. Upstream has open PRs fixing both issues. We should port them to unblock config-level agent access control.
Scope: 2 files — task.ts (+6 lines), new test file (+178 lines)
What it does: Resolves the calling agent and includes its permission rules in the child session's permission array, positioned BEFORE hard-coded denies so override order is correct
Priority: HIGH — this directly fixes our bug where developer can spawn any agent
PR anomalyco#12136 — Handle permission requests from child sessions (ACP)
Reopen and fix #173 — TaskTool.init() must receive Agent.Info:
// prompt.ts line 329 — current (broken):consttaskTool=awaitTaskTool.init()// fixed:consttaskAgent=awaitAgent.get(task.agent)consttaskTool=awaitTaskTool.init({agent: taskAgent})
Summary
Granular task permissions (
permission.taskwith per-agent allow/deny) are not enforced due to two bugs also present upstream. Upstream has open PRs fixing both issues. We should port them to unblock config-level agent access control.Upstream PRs to Port
PR anomalyco#12584 — Propagate parent agent permissions to subagent child sessions
"*": "allow"agent permissions anomalyco/opencode#12566task.ts(+6 lines), new test file (+178 lines)PR anomalyco#12136 — Handle permission requests from child sessions (ACP)
acp/agent.ts(+18/-4 lines), new test (+61 lines)Context
The Bug
When a subagent (e.g., developer) calls TaskTool:
TaskTool.init()atprompt.ts:329is called without agent contextinitCtx.agentis undefined intask.ts:113"task": {"*": "deny", "adversarial-developer": "allow"}has no effectRelated Issues
"*": "allow"agent permissions anomalyco/opencode#12566 — Subagents don't inherit parent permissionsAlso Required
Reopen and fix #173 —
TaskTool.init()must receiveAgent.Info:Merge Order
Verification
After all three fixes, test with config:
{ "developer": { "permission": { "task": { "*": "deny", "adversarial-developer": "allow" } } } }Expected: developer can spawn @adversarial-developer but NOT @git-agent or @explore.
Risk Assessment
Both upstream PRs are surgical (2 files each, <30 lines of changes). Low conflict risk with fork's custom code.