Skip to content

fix(adversarial-review): name a fixed path in the sandbox exclusion, not a versioned glob - #1578

Merged
potiuk merged 2 commits into
apache:mainfrom
potiuk:fix/adversarial-review-stable-path
Oct 11, 2026
Merged

potiuk merged 2 commits into
apache:mainfrom
potiuk:fix/adversarial-review-stable-path

Conversation

@potiuk

@potiuk potiuk commented Oct 10, 2026

Copy link
Copy Markdown
Member

Summary

The adversarial-review sandbox exclusion matched the tool as
~/.claude/plugins/cache/apache-magpie/magpie-adversarial-review/*/tools/adversarial-review.
The * stood for the plugin version, but it also matches spaces, so once a
command was approved it ran outside the sandbox even with extra uv options
spliced in at that position (--with <any package>, a second --from).
This is the gap #1406 closed for vetted-ops.

The magpie-adversarial-review plugin now ships a SessionStart hook that points
~/.claude/magpie/adversarial-review at the installed version each session,
and the exclusion, the Claude Code command, the shared pre-PR block and every
skill that runs the tool name that fixed path. The path is covered by the
existing Edit(~/.claude/magpie/**) deny. The Codex, Gemini and Copilot
commands keep resolving the installed version, since only Claude Code runs the
hook and only its exclusion is a permission rule.

sandbox-lint now rejects a * before the end of any sandbox.excludedCommands
entry; #1406 only checked permissions.allow, which is how this one slipped
through. isolated-setup-update and -verify report the old exclusion as a
must-fix, and verify's new check 14d confirms the link resolves into the
installed plugin (a real file or directory at that path would otherwise run
unsandboxed).

Type of change

  • Bug fix

Test plan

  • tools/adversarial-review tests: the Claude invocation matches the
    exclusion, and the exclusion has no wildcard before the tool name and does
    not match a spliced --with command
  • tools/sandbox-lint test for a mid-entry wildcard in
    excludedCommands fails without the lint change and passes with it
  • prek run --all-files passes

Generated-by: Claude Opus 5

🤖 Generated with Claude Code

@potiuk potiuk added family:tools tools/* capability:fix Implement code change to resolve an issue labels Oct 10, 2026
@github-actions github-actions Bot added family:pr-management pr-management-* skills family:security security-* skills family:setup setup-* skills family:docs Docs, MISSION.md, READMEs family:ci .github workflows, prek, validators family:issue issue-* skills capability:review Deep per-item code review or contributor mentoring capability:intake Import external signal + sync tracker state capability:resolve Close-out: invalidate, dedupe, CVE allocate, announcement capability:stats Read-only dashboards, metrics, governance evidence capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) capability:authoring Skills that author or maintain other skills: write-skill, optimize-skill family:release-management release-* skills family:repo-health repo-health skills substrate:sandbox Tool substrate: agent isolation, egress control, settings audit substrate:framework-dev Tool substrate: build / validate / eval the framework itself substrate:review Tool substrate: second-model read of a change before publishing (read-only CLIs, merged findings) labels Oct 10, 2026
…not a versioned glob

The adversarial-review sandbox exclusion matched the tool as
~/.claude/plugins/cache/apache-magpie/magpie-adversarial-review/*/tools/adversarial-review.
The `*` stood for the plugin version, but it also matches spaces, so once
a command was approved it ran outside the sandbox even with extra `uv`
options spliced in at that position (`--with <any package>`, a second
`--from`). This is the gap apache#1406 closed for vetted-ops.

The magpie-adversarial-review plugin now ships a SessionStart hook that
points ~/.claude/magpie/adversarial-review at the installed version each
session, and the exclusion, the Claude Code command, the shared pre-PR
block and every skill that runs the tool name that fixed path. The
existing Edit(~/.claude/magpie/**) deny covers it. The Codex, Gemini and
Copilot commands keep resolving the installed version, since only Claude
Code runs the hook and only its exclusion is a permission rule.

sandbox-lint now rejects a `*` before the end of any
sandbox.excludedCommands entry; apache#1406 only checked permissions.allow.
isolated-setup-update and -verify report the old exclusion as a must-fix.

Generated-by: Claude Opus 5
The sandbox exclusion now names ~/.claude/magpie/adversarial-review, so
what that path points at is what runs outside the sandbox. A broken link
leaves every review sandboxed, with every reviewer reporting unavailable;
a real file or directory there, or a link elsewhere, would run that code
unsandboxed, and the SessionStart hook refuses to replace anything that
is not a symlink. Check 14d reports the first as a warning and the second
as a failure.

Generated-by: Claude Opus 5
@potiuk
potiuk force-pushed the fix/adversarial-review-stable-path branch from e17f34f to 6a55c98 Compare October 10, 2026 21:43
@potiuk
potiuk merged commit 1892f1f into apache:main Oct 11, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:authoring Skills that author or maintain other skills: write-skill, optimize-skill capability:fix Implement code change to resolve an issue capability:intake Import external signal + sync tracker state capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) capability:resolve Close-out: invalidate, dedupe, CVE allocate, announcement capability:review Deep per-item code review or contributor mentoring capability:stats Read-only dashboards, metrics, governance evidence family:ci .github workflows, prek, validators family:docs Docs, MISSION.md, READMEs family:issue issue-* skills family:pr-management pr-management-* skills family:release-management release-* skills family:repo-health repo-health skills family:security security-* skills family:setup setup-* skills family:tools tools/* substrate:framework-dev Tool substrate: build / validate / eval the framework itself substrate:review Tool substrate: second-model read of a change before publishing (read-only CLIs, merged findings) 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