Skip to content

security-audits: void_loop hits 2M maxInputTokens cap (~250k tokens/turn) on ~194-file full scan, preventing initial lastSuccessfulScan #966

Backlog

Description

@iPLAYCAFE-dev

Environment

  • Void version: void@1.12.2 (stock self-hosted platform on Cloudflare Workers + Containers, --security-audits, security policy public)
  • 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

  1. 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.
  2. 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.
  3. 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.

Activity

  1. hyfdev commented on Nov 29, 2026

    @hyfdev
  2. iPLAYCAFE-dev commented on Nov 29, 2026

    @iPLAYCAFE-dev
    ContributorAuthor

    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.)

  3. hyfdev commented on Nov 30, 2026

    @hyfdev
    Contributor

    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:

    { "dryRun": true, "limits": { "maxInputTokens": 10000000, "maxScanUsd": null } }

    Then apply it with the expectedRevision from the preview (4 is an example):

    { "expectedRevision": 4, "limits": { "maxInputTokens": 10000000, "maxScanUsd": null } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions