Skip to content

fix(classifier): bound auth and token secret patterns#109

Merged
coreytshaffer merged 1 commit into
mainfrom
fix/classifier-auth-token-boundaries
Jul 23, 2026
Merged

fix(classifier): bound auth and token secret patterns#109
coreytshaffer merged 1 commit into
mainfrom
fix/classifier-auth-token-boundaries

Conversation

@coreytshaffer

Copy link
Copy Markdown
Owner

What

DangerDetector.SECRETS_AUTH used unbounded substrings r"auth" and r"token", so benign prompts containing words like authorization, authentication, or tokenization matched and were forced into the high-risk blocked profile — which would block the CR-YK approval demo's own authorization prompts from ever reaching the gate (pre-hackathon audit finding F1).

This anchors both to word boundaries — \bauth\b and \btokens?\b — so genuine credential material still blocks while protocol/architecture language does not.

  • auth token, OAuth refresh token, OAuth client secret, stored credentials → still blocked
  • authorization plan, authentication architecture, OAuth callback flow, tokenization algorithm → no longer blocked

No blanket oauth rule: OAuth is a protocol name, not credential material — the dangerous OAuth cases are already caught via token/secret/credentials.

Scope

Two files only:

triage_core/classifier.py
tests/test_classifier.py

Verification

  • pytest tests/test_classifier.py tests/test_routers.py -q19 passed (7 pre-existing classifier + 8 new parametrized cases + 4 router consumers)
  • git diff --check → clean

Known pre-existing lint (intentionally out of scope)

ruff check triage_core/classifier.py reports 2 F401 unused imports — typing.Dict and typing.Any on line 2 — that predate this change and sit on untouched lines. Left as-is to keep this patch strictly the auth/token fix; the unused-import cleanup is tracked separately.

🤖 Generated with Claude Code

Unbounded substrings `auth` and `token` in DangerDetector.SECRETS_AUTH
matched benign words such as "authorization" and "tokenization", forcing
the high-risk `blocked` profile. Anchor them to word boundaries
(`\bauth\b`, `\btokens?\b`) so genuine credential material still blocks
while authentication/authorization protocol language does not. Add a
regression matrix over benign and sensitive prompts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@netlify

netlify Bot commented Jul 23, 2026

Copy link
Copy Markdown

Deploy Preview for poetic-quokka-0fd859 ready!

Name Link
🔨 Latest commit 3859bc6
🔍 Latest deploy log https://app.netlify.com/projects/poetic-quokka-0fd859/deploys/6a61b2611d1539000854f0e1
😎 Deploy Preview https://deploy-preview-109--poetic-quokka-0fd859.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coreytshaffer
coreytshaffer marked this pull request as ready for review July 23, 2026 07:00
@coreytshaffer
coreytshaffer merged commit 7268257 into main Jul 23, 2026
7 checks passed
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.

1 participant