You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
security-audits: void_loop hits 2M maxInputTokens cap (~250k tokens/turn) on ~194-file full scan, preventing initial lastSuccessfulScan #966
Scan model / engine:@cf/deepseek-ai/deepseek-v4.1-flash-1017 (void_loop)
App profile: Full scan of ~194 files (pnpm-lock.yaml present; ~99 server .ts/.tsx files + mapped modules)
Measurements on the Exact Same Deployment
maxInputTokens setting
Model calls
Input tokens
Output tokens
Metered USD
Result
lastSuccessfulScan
1,200,000 (default)
29
1,279,208
4,356
$0.0376
incomplete (token_cap), 0 findings
null
2,000,000 (server max ceiling)
32 (+3 turns for +800k cap)
2,034,125
6,931
$0.0571
incomplete (token_cap), 0 findings
null
Observations & Root Cause
By turns 29–32 of a ~194-file initial full scan, void_loop appears to resend the full accumulated tool-call history without compaction, reaching ~250k+ input tokens per turn — so raising maxInputTokens from 1.2M to the 2.0M server maximum (+800k tokens) only yields +3 model calls before hitting token_cap again.
Because incomplete (token_cap) never sets lastSuccessfulScan, subsequent deploys cannot transition to smaller incremental diff scans and continue repeating full scans that hit token_cap.
Related minor note: The very first standard-1 scanner container cold pull right after enabling security policy public exceeded the 120s start timeout (statusReason: infrastructure, failureCause: installation), whereas void platform security probe tests lite (~118ms). Once cached, subsequent standard-1 boots (~97s) succeeded.
Constructive Suggestions
Compact or prune older tool outputs / file contents in void_loop conversation history so token usage scales sub-linearly over multi-turn scans.
Support checkpointing or partitioning large initial full scans across resumable batches so an initial lastSuccessfulScan baseline can complete cleanly.
Expose --max-input-tokens (and --max-output-tokens / --model-calls-per-scan) on void platform security limits — currently /operator/v1/security/policy validates maxInputTokens up to 2,000,000, while the CLI only exposes --concurrency and --scan-timeout.
Thanks @hyfdev for the quick breakdown and for opening #978!
Counting cached input tokens at their cached rate (1/50) explains the 1.2M vs 2.0M numbers completely, and leaving the conversation history unpruned to keep those 93–94% cache hits makes total sense.
Once a Void release containing #978 ships, we'll upgrade, reset maxInputTokens back to the 1,200,000 default, and re-run a full scan on the same ~194-file app to verify how far it progresses within the 40-turn limit and whether lastSuccessfulScan completes, then report back here.
(Regarding the first standard-1 timeout: both subsequent rescans booted cleanly once cached, so that looks like a one-off first cold-pull exceeding 120s.)
Please don't go back to maxInputTokens: 1200000 when you upgrade.
#978 now works differently from what I described above.
In a test with your first scan's totals, a saved 1,200,000 still refused the next call, because cached tokens still count in full.
#978 raises the default to 10,000,000, but upgrading keeps your saved value.
Each scan also gets a spend limit ($0.504 by default for your model), with cached input at its cached price.
Void refuses a call if its estimate, which ignores caching, doesn't fit in what's left.
Actual costs can still go over the limit.
On a release with #978, preview the change by sending this to POST /operator/v1/security/policy on your platform API URL, with an administrator operator token:
Activity
hyfdev commentedon Nov 29, 2026
iPLAYCAFE-dev commentedon Nov 29, 2026
Thanks @hyfdev for the quick breakdown and for opening #978!
Counting cached input tokens at their cached rate (1/50) explains the 1.2M vs 2.0M numbers completely, and leaving the conversation history unpruned to keep those 93–94% cache hits makes total sense.
Once a Void release containing #978 ships, we'll upgrade, reset
maxInputTokensback to the1,200,000default, and re-run a full scan on the same ~194-file app to verify how far it progresses within the 40-turn limit and whetherlastSuccessfulScancompletes, then report back here.(Regarding the first
standard-1timeout: both subsequent rescans booted cleanly once cached, so that looks like a one-off first cold-pull exceeding 120s.)hyfdev commentedon Nov 30, 2026
Please don't go back to
maxInputTokens: 1200000when you upgrade.#978 now works differently from what I described above.
In a test with your first scan's totals, a saved 1,200,000 still refused the next call, because cached tokens still count in full.
#978 raises the default to 10,000,000, but upgrading keeps your saved value.
Each scan also gets a spend limit ($0.504 by default for your model), with cached input at its cached price.
Void refuses a call if its estimate, which ignores caching, doesn't fit in what's left.
Actual costs can still go over the limit.
On a release with #978, preview the change by sending this to
POST /operator/v1/security/policyon your platform API URL, with an administrator operator token:{ "dryRun": true, "limits": { "maxInputTokens": 10000000, "maxScanUsd": null } }Then apply it with the
expectedRevisionfrom the preview (4 is an example):{ "expectedRevision": 4, "limits": { "maxInputTokens": 10000000, "maxScanUsd": null } }fix(platform): give each security scan a spend limit (#978)