Repository navigation
No model strike for a user agent alone; payload signatures it exposed - #13
Merged
Merged
Conversation
A request whose only signature hits come from user-agent rules and that was answered below 400 gets at most REVIEW from a model verdict, never a strike. A user agent is an identity, not an act. On the static benchmark, Flash 9B banned an uptime monitor (Go-http-client, GET / 200 every five minutes) on five separate verdicts at 0.80-0.84. Hard rules, rules mode and anything with its own evidence (a 4xx, a login, a known path) are unchanged. tests/guard_access.log with the mock at MOCK_P=0.95 (a model sure of everyone): main bans the monitor, the password guesser and the prober; this branch bans the last two and logs the monitor as REVIEW. CI runs it. Also: the strike label counts only strikes inside findtime (it said 3/3 for strikes that had expired, with no ban). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJFY41846T15QqxmGW2
Evaluating the user-agent guard on LogarX showed a real SQL injection
attacker whose payloads (" AND 1=1--, " AND 1=(SELECT ...)) no signature
knew, so the guard held back the model's 0.99. Narrowing the guard would
expose benign API polling (Gemini 0.52-0.58); the signatures are the fix:
sqli takes double quotes and and n=(select; shell-inject takes id, whoami,
uname, hostname, ifconfig, ping; template-inject (weight 10) is new. Rules
alone: synthetic splits unchanged, LogarX 438 -> 440 caught, 0 benign.
Flash 9B on the static split with the guard: 0 benign banned (was 1), same
attackers. 216 checks.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NPVFJFY41846T15QqxmGW2
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 the false ban found in iteration 9. Flash 9B banned an uptime monitor (
Go-http-client,GET /every five minutes, status 200): it scored five separate requests at 0.80–0.84, and each fresh verdict counted as a strike of its own.The guard
If a request's only signature hits come from user-agent rules and it was answered below 400, a model verdict on it is at most REVIEW, never a strike. The log marks these
user agent only: no strike. A user agent says who a client is, not what it's doing.Unchanged:
What evaluating it turned up
On LogarX, the guard first held back a real SQL injection attacker. Its payloads (
" AND 1=1--and" AND 1=(SELECT ...)in a search query) slipped thesqlisignature, which only knew the single-quote form. So those requests looked like a Go client and nothing else, and Gemini's 0.99 became REVIEW.Narrowing the guard, for example to requests without a query string, would expose benign API clients polling
/api/stock?id=that Gemini scores 0.52–0.58. So the guard stays, and the signatures are the fix:sqli: now matches double quotes andand n=(select(also without quotes, for numeric parameters).shell-inject: addsid,whoami,uname,hostname,ifconfig,ping.template-inject(new, weight 10):{{7*7}},${7*7},<%= 7*7 %>,{{config}}-style probes.Rules-only results: unchanged on every synthetic split. On LogarX, 438 → 440 attack requests caught, still 0 benign banned. The one extra request through on LogarX is that attacker's ordinary page view (
/p/8), which carries no evidence of its own.Also fixed
The strike label counted strikes that had already expired, logging "strike 3/3" with no ban. It now counts only strikes inside findtime.
Tests
tests/guard_access.logrun against the mock atMOCK_P=0.95(a model sure of everyone).mainbans the monitor, the password guesser and thecurlprober; this branch bans the last two and logs the monitor as REVIEW.|identity, a{{name}}placeholder), and the user agent's share of the score.bench/results/iter10-agent-guard/README.md.Generated by Claude Code