security: negated denials ("no, don't approve") no longer resolve as allow - #560
Open
coderdailyone wants to merge 1 commit into
Open
security: negated denials ("no, don't approve") no longer resolve as allow#560coderdailyone wants to merge 1 commit into
coderdailyone wants to merge 1 commit into
Conversation
…allow resolve_from_reply tested allow words before deny words, so a refusal phrased around an allow word released the one-shot approval as ALLOW: "no, don't approve" → matched \bapprove\b first → allow "not allowed" → contains no deny word at all → allow The gate now fails closed: deny words win on mixed phrasings, and an allow word preceded by a negator (not / never / -n't) counts as a refusal. Free-text answers to questions are unaffected. Fixes andrewyng#520 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CLxsdFGXjdztTRNHjNgPXP
coderdailyone
force-pushed
the
security/inbox-negated-denials
branch
from
September 1, 2026 23:38
8a74c41 to
35bc14d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #520.
resolve_from_replytested_ALLOW_WORDSbefore_DENY_WORDS, so a refusal phrased around an allow word resolved the one-shot approval as allow and released the suspended agent to run the very action the approver refused:[ow:<id>] no, don't approve→ matched\bapprove\bfirst → allow[ow:<id>] not allowed→ contains no deny word at all → allow (this case isn't covered by the deny-first ordering suggested in Security: approval reply parser resolves negated denials ("no, don't approve") as ALLOW — approval gate fails open #520 — it needs negator handling)Change
not/never/-n't) counts as a refusal, closing the"not allowed"class as well.north-east nodestill resolves as free text — existing test keeps passing).Tests
New
test_negated_denial_is_not_parsed_as_allowcovers the three phrasings from the issue's acceptance criteria (no, don't approve,not allowed,no, do not allow this) — all must never resolve as allow. Fulltests/suite run locally: the only failures are the pre-existing environmental ones onmain(slack relay / mcp connector websocket timeouts), unrelated to this change.🤖 Generated with Claude Code
https://claude.ai/code/session_01CLxsdFGXjdztTRNHjNgPXP