Skip to content

feat(harness): OpenCode support for permission-audit + sandbox-lint — agent-harness 100% - #688

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:opencode-harness-permission-audit-sandbox-lint
Jul 3, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:opencode-harness-permission-audit-sandbox-lint

Conversation

@potiuk

@potiuk potiuk commented Jul 3, 2026

Copy link
Copy Markdown
Member

What

Closes the last two Claude-Code-coupled substrate tools on the
agent-harness axis, each via a genuine OpenCode config auditor (not a
label flip). The agent-harness score reaches 20/20 (100%) — and with
the contract axis already at 10/10, every LLM-integration axis of the
vendor-neutrality score is now fully neutral.

Both tools operate on Claude's .claude/settings.json schema. OpenCode
models permissions differently — opencode.json permission is a string
or an object keyed by tool, and permission.bash maps glob command
patterns → allow/ask/deny, evaluated last-matching-rule-wins
with a "*" default (docs). So
each tool gets a separate OpenCode classifier enforcing the same intent.

permission-audit

New audit-opencode <opencode.json> subcommand (+ opencode.py). Flags
over-permissioning, JSON output, read-only:

  • blanket-allow — permission is the string "allow";
  • bash-allow-all — the default permission.bash decision is "allow";
  • dangerous-allow — a specific rule auto-approves a dangerous family
    (git push, sudo, curl/wget, rm -rf, cloud CLIs, kubectl,
    docker run, ssh, interpreters, npx/uvx) while the default is
    stricter.

The Claude-only apply (atomic allow-list edits) has no OpenCode
counterpart yet — audit-opencode is read-only.

sandbox-lint

New --opencode <opencode.json> mode (+ opencode.py invariants).
OpenCode has no sandbox.filesystem model (its isolation is the OS-level
sandbox), so there's no baseline to diff — the lint asserts permission
invariants
instead: not blanket-allow, permission.bash default not
allow, no dangerous family auto-approved (last-match-wins), and
webfetch / external_directory not blanket-allow.

Tests / verification

Both READMEs: **Harness:** → Claude Code, OpenCode. Tests cover the
rule engine (last-match-wins evaluation, per-rule dedup, safe configs pass)
and both CLIs. Full pre-commit suite green (mypy/pytest/ruff
workspace, validator, doctoc, markdownlint, lychee). Scorer:
agent-harness 20/20 (100%).

By design, still Claude-specific

permission-audit apply (atomic .claude/settings.json edits) and the
sandbox-lint .claude/settings.json baseline diff stay Claude-specific
— the OpenCode side is read-only auditing/linting of opencode.json.

… harness 100%

Closes the last two Claude-Code-coupled substrate tools on the
agent-harness axis, each via a genuine OpenCode config auditor (not a
label flip). The agent-harness score reaches 20/20 (100%); with the
contract axis already at 10/10, every LLM-integration axis is now neutral.

Both tools operate on Claude's `.claude/settings.json` schema; OpenCode
models permissions entirely differently — `opencode.json` `permission` is
a string or an object keyed by tool, and `permission.bash` maps glob
command patterns to allow/ask/deny, evaluated last-matching-rule-wins
with a `"*"` default (https://opencode.ai/docs/permissions/). So each
tool gains a separate OpenCode classifier that enforces the same intent.

permission-audit:
- New `audit-opencode <opencode.json>` subcommand + `opencode.py` module.
  Flags over-permissioning: `blanket-allow` (`permission` == "allow"),
  `bash-allow-all` (bash defaults to allow), and `dangerous-allow` (a
  specific rule auto-approves git push / sudo / curl / rm -rf / cloud
  CLIs / kubectl / docker / ssh / interpreters / npx / uvx while the
  default is stricter). Read-only JSON output; the Claude-only `apply`
  has no OpenCode counterpart yet.

sandbox-lint:
- New `--opencode <opencode.json>` mode + `opencode.py` invariants.
  OpenCode has no sandbox.filesystem model (isolation is the OS-level
  sandbox), so there is no baseline to diff — the lint asserts permission
  invariants instead: not blanket-allow, bash default not allow, no
  dangerous family auto-approved (last-match-wins), and webfetch /
  external_directory not blanket-allow.

Both: `**Harness:**` -> `Claude Code, OpenCode`; tests cover the rule
engine (last-match-wins, dedup, safe configs) and the CLIs. Regenerated
the score block (agent-harness 20/20). permission-audit `apply` and the
`.claude/settings.json` baseline remain Claude-specific by design.
@potiuk
potiuk merged commit 1791c44 into apache:main Jul 3, 2026
33 checks passed
@potiuk potiuk added the substrate:sandbox Tool substrate: agent isolation, egress control, settings audit label Sep 25, 2026
@potiuk potiuk added family:docs Docs, MISSION.md, READMEs family:tools tools/* labels Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:docs Docs, MISSION.md, READMEs family:tools tools/* substrate:sandbox Tool substrate: agent isolation, egress control, settings audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant