Skip to content

security: negated denials ("no, don't approve") no longer resolve as allow - #560

Open
coderdailyone wants to merge 1 commit into
andrewyng:mainfrom
coderdailyone:security/inbox-negated-denials
Open

security: negated denials ("no, don't approve") no longer resolve as allow#560
coderdailyone wants to merge 1 commit into
andrewyng:mainfrom
coderdailyone:security/inbox-negated-denials

Conversation

@coderdailyone

@coderdailyone coderdailyone commented Aug 26, 2026

Copy link
Copy Markdown

Rebased on main (2026-09-01). Upstream commit 746db87 ("Parse inbox reply intent from the leading word") already fixes the root cause on main, so the code change here has been dropped. This PR now only adds the regression test test_negated_denial_is_not_parsed_as_allow covering the exact phrasings from #520 ("no, don't approve", "not allowed", "no, do not allow this"), so #520 can be closed with a test pinning it.


Fixes #520.

resolve_from_reply tested _ALLOW_WORDS before _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:

Change

  • Deny words now win on mixed phrasings (deny-first, per the issue's suggested fix).
  • An allow word preceded by a negator (not / never / -n't) counts as a refusal, closing the "not allowed" class as well.
  • Free-text answers to questions are unaffected (north-east node still resolves as free text — existing test keeps passing).

Tests

New test_negated_denial_is_not_parsed_as_allow covers 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. Full tests/ suite run locally: the only failures are the pre-existing environmental ones on main (slack relay / mcp connector websocket timeouts), unrelated to this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CLxsdFGXjdztTRNHjNgPXP

…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
coderdailyone force-pushed the security/inbox-negated-denials branch from 8a74c41 to 35bc14d Compare September 1, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: approval reply parser resolves negated denials ("no, don't approve") as ALLOW — approval gate fails open

1 participant