Repository navigation
fix(platform): give each security scan a spend limit - #978
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://fix-security-cached-input-cap-void-cloud.voidzero-docs.workers.dev (commit 787ffd9)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
imho we should keep maxInputTokens as a token count and give scans a separate spend limit that accounts for the cache discount. Also can we add a check for whether it can afford the next call? |
889b8bb to
1abf073
Compare
|
I've made both changes.
Before each call, Void checks that its estimated cost fits in what's left of that limit. |
|
Slop Review
|
- Keep `SECURITY_LIMIT_KEYS` paired with `SECURITY_LIMIT_RANGES` and make `SecurityPolicyLimits.maxScanUsd` optional; add `SECURITY_SCAN_USD_RANGE`. - Send `estimatedUsd` (keep `worstCaseUsd` for older CLIs); the CLI shows "Estimated cost: up to $X". - The call ledger keeps a stop on the scan's own limits over later transient failures, so a later 503 no longer turns a spend stop into a retried scan with no findings. - Refuse a call the spend limit cannot fit before it takes a session call or rate token. - Add `--scan-input-tokens` and `--scan-usd <usd|auto>` to `void platform security limits`. - Show the spend limit as $X / automatic in the policy preview and "spend limit reached" in local checks; trim the guide. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1abf073 to
787ffd9
Compare
|
Addressed the three points in 787ffd9:
Also in this commit:
Rebased on main. |
A full security scan can stop as
incomplete(token_cap) long before it costs the $0.504 Void reserves by default, because cached input counts in full towardmaxInputTokens.This raises that limit's default and adds a per-scan spend limit, using the model's cached price if it has one.
Void refuses calls it estimates the scan can't afford, so some scans stop earlier.
Installations that already scan keep their saved
maxInputTokens(1,200,000 unless changed) until it's raised withvoid platform security limits --scan-input-tokens 10000000.--scan-usd <usd|auto>sets or clearsmaxScanUsd.One more 1.6 MB call on the default model, with mocked replies:
maxInputTokensVoid now also refuses a call when:
maxInputTokens, which counts cached input in fullmaxScanUsd, set through the operator APInullby default, or $0.01 to $12maxInputTokensof 2,000,000A refusal ends the scan as
incomplete(spend_cap) and keeps its confirmed findings. The call ledger keeps a spend, token or call-count stop when a later transient failure (such as a 503) comes in, so a later failure no longer turns the stop into a retried scan with no findings:succeededwith 2 findingsincomplete(spend_cap) with 1 findingsucceededwith 2 findingsincomplete(spend_cap) with 1 findingfailedwith 0 findings, retriedincomplete(token_cap) with 1 findingPreviews call the scan amount an estimate (
estimatedUsd;worstCaseUsdis kept for older CLIs), because a call can cost more than estimated: one mocked call, estimated at $0.2117, took a scan from $0.29 to $0.5222, past $0.504, before and now.Concurrent calls can go further over.
Part of #966.