Repository navigation
fix(permission): auto-allow ask rules in the sandbox - #92
Conversation
Inside the sandbox, unmatched commands were already auto-allowed but `ask` rules still prompted - and blocked outright in headless runs where there is no UI. Since the sandbox is the isolation boundary, there is nothing left for these prompts to protect, so `git push`, `git rebase`, and non-read-only `gh` commands now run unprompted there. `deny` rules still block; only YOLO mode bypasses them.
Review complete — limited coverage, no repair-worthy findingsStandards axis only. The Spec axis was skipped at your explicit direction: this PR has no originating issue and no OpenSpec change, so there is no spec to review against. Full diff reviewed at No blockers and no significant bugs. 7 findings were recorded: 0 repair-worthy, 6 report-only, 1 refuted. Nothing was repaired, so there are no new commits and no push. Report-only worth your attention
Validation: Scope: Standards axis only, and no live Pi runtime, Herdr signal, or real Reviewed: Full review reports, finding ledger, and audit detailsStandards report (complete, verbatim)Sources read: Hard violations: none found. Verified against the documented standards:
Judgement calls (baseline smells):
Behavioral risksSeparate from Standards; listed in descending severity. No ordering defect found on the documented invariants.
Spec reportSkipped — explicitly authorized by the user. No originating issue exists (the PR body has a Judge ledgerPrior ledger: empty, confirmed. State verified by the judge: pinned base == merge-base F-001 — Sandbox auto-allow of
|
Problem
PI_SANDBOX=trueonly auto-allowed commands that matched no rule. Commands hitting anaskrule —git push,git rebase, and any non-read-onlyghcommand (rules 1, 2 and 21) — still prompted, and blocked outright in headless runs (-p,--mode json) with... - no UI for confirmation. Inside a sandbox there is nothing for those prompts to protect, so they were pure friction.Change
extensions/permission/index.ts: the sandbox check moves into theaskbranch, ahead of always-allow/no-UI/prompting. Written generically (ask→ allow underPI_SANDBOX=true) rather than listing rule IDs, so futureaskrules inherit the same semantics andrules.tsstays the single source of rule data.denyrules still block in the sandbox — only YOLO mode bypasses them. This is covered by a test so the sandbox cannot silently swallow adeny.README.mdrule list and theAGENTS.mdsandbox bullet now describe the wider sandbox behavior.Net effect: in the sandbox every bash command either proceeds silently or is denied; no prompt, no headless block.
Tests
extensions/permission/index.test.ts:auto-allows an ask rule in a sandbox without prompting— rules 1/2/21, asserts no prompt and noherdr:blockedeventsauto-allows an ask rule in a sandbox even without UI— the previously blocked headless casestill blocks a deny rule in a sandbox— guard against sandbox swallowingdenyVerification
npm run check,npm run typecheck,npm test— 443 tests, 0 failures. Nopackage*.jsonornix/changes, so no lockfile ornpmDepsHashimpact.