Repository navigation
Add repository OpenCode permission defaults - #25326
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds an Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The configuration preserves the intended approval prompts and is admitted by the root-entry guard. No actionable merge-blocking risk is established. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The policy allows unmatched actions while requesting approval for specified environment-file reads, external-directory access, and repeated calls. No newly exploitable path is established, but the effective permissions depend on the installed runtime and existing user and agent settings. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Important
The committed config is equivalent to "permission": "allow". Because OpenCode merges the project ruleset after its built-in defaults and evaluates last-match-wins, it also lifts the default ask on reading *.env files, on external_directory access, and on doom_loop — silently, for anyone whose OpenCode working directory is an Orca checkout. Please confirm that is intended; if the goal is only to drop routine prompts, a narrower key preserves those guards.
Reviewed changes
- Repository OpenCode config — new root
opencode.jsonsetspermissionto{"*":{"*":"allow"}}($schemapresent, schema-valid). - Root-entry guard —
REVIEWED_ROOT_ENTRIESnow acceptsopencode.jsonalongsidecloud, so the CI landing-page bloat guard tolerates the new root file. - Guard regression test — a case asserting the guard returns
0for a rootopencode.json(would fail against the old guard, so it is real coverage).
The guard and test changes are sound. The one substantive point is the effective scope of the wildcard, called out inline.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Narrowed the OpenCode permission catch-all — the repository
opencode.jsonnow keeps the{"*":{"*":"allow"}}default but re-states explicitaskrules for reading*.env/*.env.*, forexternal_directoryaccess, and fordoom_loop, with*.env.exampleleft allowed. This restores the confirmation prompts the wildcard had shadowed, which was the sole finding in the prior review.
The exceptions are ordered after the catch-all within the same project ruleset, and OpenCode concatenates the built-in defaults with the project ruleset last while evaluating findLast, so each guard wins. Verified against sst/opencode dev: Wildcard.match (* → .*, anchored), permission/index.ts evaluate/findLast, and agent/agent.ts (merge(defaults, …, user) plus built-in defaults that already contain these exact rules). The guard script and its regression test are unchanged from the prior review and remain sound.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

ELI5
OpenCode can discover Orca’s repository permission defaults while still asking before reading environment secrets, accessing external directories, or continuing a repeated tool loop.
What Changed
Adapts @Jinwoo-H’s repository-config contribution from #14433. The default allows actions, followed by explicit confirmation rules for
.env,.env.*, external directories and repeated tool loops..env.examplestays allowed. OpenCode uses the last matching rule, so these exceptions follow the default.Extends the existing root-directory guard to allow
opencode.jsonalongside the reviewedcloudentry. Other new root entries remain blocked.Why
OpenCode’s project config discovery applies the same rules to the main checkout and git worktrees without adding launch-time overrides. The explicit exceptions preserve confirmation for sensitive actions that a blanket default would override.
Linked Issue
Replaces #14433. Original contribution by @Jinwoo-H: #14433. This adaptation narrows its original allow-everything policy.
Visual Proof
N/A — repository configuration and a CI guard; no rendered UI change.
Testing
Installed OpenCode 2.0.16 on macOS discovered the exact adapted config and registered all six ordered project rules in the Build agent in a fresh isolated project. The first snapshot contained only default rules; the second registered the project suffix. Both CLI children and the controller exited normally, and the private endpoint refused connections afterward. This verifies configuration and registered-agent discovery, not an executed tool permission decision.
The earlier three isolated controls verified project-config discovery without a root config, with the original config, and in a linked git worktree. The guard regression failed before the change (11 passed, 1 failed), then all 12 passed. Existing cloud, unrelated-root refusal, raw Git pathname and annotation-fencing cases passed. Owned lint, formatting, official anti-slop rules, changed-code quality, syntax, root guard and diff checks passed. The JSON-only adaptation passed formatting and diff checks; no TypeScript behavior changed, so desktop typechecks/builds were not repeated.
Review
Three files. The config follows the installed OpenCode schema and last-match precedence. External-directory confirmation also takes precedence over built-in internal-directory allow rules. The
doom_looprule also retains legacy compatibility; the installed 2.0.16 check verifies its discovery. Session-specific or saved permission rules are outside this discovery check. The existing cloud exception remains unchanged; there are no platform-specific runtime or remote wire changes.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)