You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@magpie.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2026/10/15 21:36:32 UTC

[PR] setup: read-only vetted ops must never prompt (install applies, verify checks, update reports drift) [magpie]

potiuk opened a new pull request, #1640:
URL: https://github.com/apache/magpie/pull/1640

   ## Why
   
   Bulk skills run `vetted-op-read` from background gatherer agents, and a background agent cannot show a permission prompt.
   Every prompt there is a **silent denial**: the read fails, and the orchestrator gets a partial report with nothing to show that a read was refused.
   A bulk sync over a few dozen trackers produced exactly that: patchy, unverifiable results.
   
   Two settings shapes cause it:
   
   - With `permissions.blockReadsOutsideWorkingDirectories` on, Claude Code prompts on every call (*"uvx names '~/.claude/magpie/vetted-ops', which cannot be checked against the read block"*).
     - The check cannot resolve the literal `~` in the command, which is the spelling `sandbox.excludedCommands` matches.
     - Neither an `allow` rule nor an absolute `$HOME/.claude/magpie` in `additionalDirectories` overrides it.
   - Any `permissions.ask` rule that matches a `vetted-op-read` command prompts, even when an `allow` rule also matches.
   
   ## What
   
   "Read-only vetted ops never prompt" becomes a requirement of the secure setup.
   Required shape:
   
   1. `permissions.allow` carries `vetted-op-read` for both launchers (`uvx --from`, `uv run --project`) on both bases: `~/.claude/magpie/vetted-ops` and the resolved absolute `$HOME/...`.
   2. `sandbox.excludedCommands` carries a `vetted-op-read` entry for each of those four forms, plus the existing tracker exclusions. An allowed form without its exclusion runs sandboxed, and its `gh` call fails silently.
   3. No `permissions.ask` rule matches a `vetted-op-read` command, including broad rules such as `Bash(uvx *)`.
   4. `blockReadsOutsideWorkingDirectories` is false or absent in every scope. Bash stays sandboxed regardless.
   5. The three vetted-ops `Edit` deny rules (catalogue, fixed path, policy) are required. They are what makes the unprompted read safe.
   
   Where the rules live:
   
   - The `~` allow pair, the `~` exclusions and the deny rules may live in the committed project settings or in user scope.
   - The absolute-`$HOME` allow and exclusion forms are per machine: user scope, or `settings.local.json` when user settings are synced. They are never committed.
   
   This covers the read dispatcher only. `vetted-op-tracker` and `vetted-op` keep their `ask` rules and stay out of `allow`.
   
   Changes:
   
   - `docs/setup/secure-agent-setup.md`: new section *Read-only vetted ops never prompt*, with the rationale. The install, verify and update prompts are updated to match.
   - `setup-isolated-setup-install`: new Step V.1 proposes the exact edits. The operator applies them.
   - `setup-isolated-setup-verify`: new check 16 (16a–16e). Any failure is ✗.
   - `setup-isolated-setup-update`: a fourth vetted-ops check reports drift as must-fix.
   - `sandbox-lint`: runs these checks whenever a `Bash(...)` rule or an `excludedCommands` entry names a dispatcher. It requires both `~` allow forms, no read block and the three Edit denies. It also rejects any `ask` rule that matches a `vetted-op-read` command; rules are pattern-matched, so broad rules are caught. 15 new tests.
   - Doctor probe 9, the troubleshooting doc, `tools/vetted-ops/README.md`, the `sandbox-add-project-root.sh` comment and the spec-loop specs are updated to match.
   
   The framework's own `.claude/settings.json` already has this shape, so it is unchanged.
   
   ## Testing
   
   - **prek:** 33 hooks pass on every changed file.
   - **sandbox-lint:** 252 passed, 2 skipped.
   - **Failure in untouched packages:** workspace-pytest fails in `oauth-api`, `jira` and `typed-decision`, which this PR does not change. `oauth-api` fails because the sandbox blocks binding a local port; `jira` and `typed-decision` could not be run directly here.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] setup: read-only vetted ops must never prompt (install applies, verify checks, update reports drift) [magpie]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #1640:
URL: https://github.com/apache/magpie/pull/1640


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org