Skip to content

fix(opencode): add read-only tool permissions for composer and steering agents (#405)#406

Merged
randomm merged 1 commit intodevfrom
feature/issue-405-composer-permissions
Apr 9, 2026
Merged

fix(opencode): add read-only tool permissions for composer and steering agents (#405)#406
randomm merged 1 commit intodevfrom
feature/issue-405-composer-permissions

Conversation

@randomm
Copy link
Copy Markdown
Owner

@randomm randomm commented Apr 8, 2026

Fixes #405

What changed

  • Added READONLY_TOOLS constant to agent.ts with restrictive read-only permissions
  • Updated composer agent to use READONLY_TOOLS (was { "*": "deny" } with no allows)
  • Updated steering agent to use READONLY_TOOLS (was { "*": "deny" } with no allows)
  • Added 13 tests verifying tool visibility and bash pattern restrictions

Root cause

Both composer and steering agents had "*": "deny" with no explicit tool allows. The disabled() function correctly hid ALL tools because there were no non-wildcard allow rules to satisfy the hasSpecificAllow check. This made the Composer agent unable to read source files for task decomposition, causing taskctl start to fail.

READONLY_TOOLS configuration

{
  "*": "deny",
  read: "allow",
  grep: "allow",
  glob: "allow",
  list: "allow",
  codesearch: "allow",
  bash: {
    "vipune *": "allow",
    "colgrep *": "allow",
    "oo help *": "allow",
    "oo gh issue view *": "allow",
    "oo gh issue list *": "allow",
    "oo recall *": "allow",
  },
  external_directory: { [Truncate.GLOB]: "allow" },
}

Write tools (edit, write, patch) remain denied. Bash access is restricted to safe read-only commands only — dangerous commands like rm, curl, git push are denied.

Test plan

  • composer/steering: read tools visible via disabled()
  • composer/steering: write tools disabled via disabled()
  • composer/steering: evaluate() returns "allow" for read/grep/glob/list/codesearch
  • composer/steering: evaluate() returns "deny" for bash wildcard "*"
  • composer/steering: evaluate() returns "deny" for edit/write/patch
  • composer: safe bash patterns allowed (vipune, colgrep, oo help, oo gh issue view/list, oo recall)
  • composer: dangerous bash commands denied (rm, curl, git push, git add, cat ~/.ssh)
  • steering: safe bash patterns allowed (vipune, colgrep)
  • steering: dangerous bash commands denied (rm, curl)
  • user config override via merge (last-match-wins)

…ng agents (#405)

Composer and steering agents had '*: deny' with no explicit tool allows,
causing disabled() to hide ALL tools including read. This made the
Composer unable to read source files for task decomposition.

Add READONLY_TOOLS constant with read/grep/glob/list/codesearch and
restrictive bash patterns (vipune, colgrep, oo help, oo gh issue
view/list, oo recall). Both composer and steering agents now use this
constant for consistent, safe read-only codebase access.
@randomm randomm merged commit 327e68f into dev Apr 9, 2026
1 check passed
@randomm randomm deleted the feature/issue-405-composer-permissions branch April 9, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Composer agent has no tool permissions — cannot read codebase to decompose issues

1 participant