Skip to content

fix(security): fail closed when the public-surface scrub cannot decide - #2071

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/public-surface-scrub-fail-closed
Nov 14, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/public-surface-scrub-fail-closed

Conversation

@potiuk

@potiuk potiuk commented Nov 14, 2026

Copy link
Copy Markdown
Member

Summary

public-surface-scrub is the gating tool.call hook that blocks Bash commands which would publish embargoed security content. Two paths could let a command through:

  • A throw while evaluating. Nothing caught it, so the outcome depended on how the engine treats a throwing gate. It now blocks, naming the error, unless a human set MAGPIE_ALLOW_EMBARGO_TERMS=1 before the session (the escape hatch the evaluation already honours).
  • blocked without a reason. The hook denied only on blocked && reason. It now blocks on blocked alone, with a fallback reason. All eight current block paths set a reason, so this was latent.

The decisions live in two exported helpers, denyFor and denyOnEvaluationError, each with a test.

Found while fixing the 2.1.325 type-check findings (#2070).

Test plan

  • claude plugin test plugins/magpie-security: 167 pass (165 + 2 new)
  • claude plugin validate --strict (2.1.325) and the pinned check-claude-mods pass
  • prek on the touched files passes

Generated-by: Claude Opus 5

🤖 Generated with Claude Code

- A throw while evaluating a command now blocks it, unless a human set
  MAGPIE_ALLOW_EMBARGO_TERMS=1, the escape hatch the evaluation already
  honours; before, the outcome depended on how the engine treats a
  throwing gate.
- A blocked evaluation blocks even without a reason (a fallback reason
  is used); before, blocked with an empty reason was let through.
- denyFor / denyOnEvaluationError are exported and tested.

Generated-by: Claude Opus 5
@potiuk potiuk added family:security security-* skills substrate:sandbox Tool substrate: agent isolation, egress control, settings audit labels Nov 14, 2026
@potiuk
potiuk enabled auto-merge (squash) November 14, 2026 03:40
@potiuk
potiuk merged commit fe74205 into apache:main Nov 14, 2026
9 checks passed
potiuk added a commit that referenced this pull request Nov 14, 2026
Back-fills the specs for what landed since bfc99bb without a spec
change: #2005, #2040, #2055, #2056, #2057, #2063, #2068, #2069, #2070
and #2071, and moves .last-sync to 4d491b0.

Generated-by: Claude Opus 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:security security-* skills 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