

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Agents
incomplete
2: Temperature
incomplete
3: Custom Agents
incomplete
4: Max Steps
incomplete
5: Subagents
incomplete
6: Task Permissions
incomplete
This lesson's interactive features are locked, please to keep using them
Just because a subagent exists doesn't mean every agent should be allowed to invoke it.
You can control that with subagent permission rules.
{
"$schema": "https://opencode.ai/config.json",
"agents": {
"orchestrator": {
"mode": "primary",
"permissions": [
{ "action": "subagent", "resource": "*", "effect": "deny" },
{
"action": "subagent",
"resource": "orchestrator-*",
"effect": "allow",
},
{ "action": "subagent", "resource": "code-reviewer", "effect": "ask" },
],
},
},
}
These rules give the orchestrator agent the following behavior:
* denies all subagent invocation by defaultorchestrator-* allows any subagent ID that starts with orchestrator-code-reviewer requires approval before the orchestrator can invoke that subagentThe exceptions work because OpenCode evaluates rules in order and the last matching rule wins.
These rules only restrict what an agent can invoke automatically. They do not stop you from manually invoking a subagent directly through the UI.
Block automatic delegation to explore.
Tell OpenCode to run and submit the CLI tests from the project root.