Repository navigation
gemini provider: Google's Decisions API (gemini-decision-1) - #11
Merged
Merged
Conversation
The same questions over its request shape: the client state as the input text, noul criteria as true_description/false_description, the key in x-goog-api-key; answers parse as before. api = gemini selects the shape for a proxy. A batch refused by its safety filter (a client can write such text into its user agent to send its batchmates to the rules) is asked again one client at a time; a client refused alone goes to REVIEW at 0.5. The mock now serves /v1beta/decisions and rejects what the documentation says the service rejects; CI runs jevban against it. Not yet run against the service itself (needs a key). 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.
Google's Decisions API asks the same kind of questions jevban already sends (
noulper client, optionalchoicefor intent) and returns the same answer shape (answers.<key>.noul, a calibrated probability between 0.01 and 0.99). Only the wire format differs. Details below were checked verbatim against the documentation:/v1/systemonegenerativelanguage.googleapis.com/v1beta/decisions,gemini-decision-1state(JSON object)input(text): the same state, as JSONnoulcriteriatrue/falsetrue_description/false_descriptionAuthorization: Bearerx-goog-api-keyapi = geminiin[decider]selects the Gemini format for a proxy in front of the service.Results on the real service (free tier)
These are held-out test splits plus the real LogarX log, on the same build. No benign client was banned by Gemini in any run. Full notes are in
bench/results/iter9-gemini/README.md.On every split Gemini let fewer attack requests through than the rules: 196 → 175, 170 → 160, 216 → 214, and 536 → 457 on LogarX.
What Gemini adds over the rules: two password guessers on WordPress and one stealth scanner each on the static site and the web app. Flash banned one benign uptime monitor on the static site: five separate verdicts at 0.80–0.84 on
GET /200 with aGo-http-clientagent. That's recorded here, and a guard against it is separate work.Changes from the first version of this PR
thresholdorreview_thresholditself.retryDelayfield; 10 s if neither), up to 6 times, in steps that shutdown interrupts. With retries there were 0 errors.MOCK_429=N).Tests
tests/mock_jev.pyserves/v1beta/decisionsand rejects what the documentation says the service rejects (unknown fields orstateinstead ofinput, a missing key, wrongnoulcriteria names, bad question keys). It also returns the documented safety-block and 429 responses.provider = gemini; the System One run is unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01NPVFJFY41846T15QqxmGW2