We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Task Permissions

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 default
  • orchestrator-* allows any subagent ID that starts with orchestrator-
  • code-reviewer requires approval before the orchestrator can invoke that subagent

The 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.

Assignment

Block automatic delegation to explore.

Tell OpenCode to run and submit the CLI tests from the project root.