AI engineering · Security
How many tokens would this security scan use?
We pointed Visa's Vulnerability Agentic Harness (VVAH) at a 248-file TypeScript repository and asked for a token estimate. The upper end came back at 12.7 million input tokens for discovery alone.
The repository held about 586,000 source tokens, by the estimator's count. What accounts for the gap?
That question is worth asking before starting an agentic security scan. A repository's size tells you how much code there is. It does not tell you how much work a tool will do with it.
The command and the result
We ran VVAH 1.5.1's offline estimator, then repeated the command on November 7, 2026. Both runs returned the same figures. No model calls were made.
With VVAH installed:
vvaharness estimate --repo /path/to/your/repo
Here is the relevant output, with the private repository path omitted:
in-scope files : 248
bytes : 2,344,276
~source tokens : 586,069 (bytes/4, not pipeline usage)
S1-S9 input budget: 3,180,345-12,721,380 tokens (heuristic)
The tool also warns that actual usage can fall outside that range. Remediation, validation, and exploit verification are extra.
These are reproducible estimates. We did not run a full scan for this check, so we have no measured consumption, elapsed time, or findings to report from it.
Where the millions come from
The estimator's arithmetic is simple enough to inspect. In the version we ran, it divides file bytes by four to approximate source tokens, then applies two formulas:
Lower estimate = 250,000 + 5 × source tokens
Upper estimate = 1,000,000 + 20 × source tokens
For our repository, that produces roughly 3.2 million to 12.7 million input tokens. The fixed allowances represent prompt and tool overhead; the multipliers are assumptions about pipeline work. The command does not observe agents investigating the code or predict how many vulnerabilities they will find.
VVAH's documented workflow includes threat modeling, investigation, verification, and reporting. There is more work involved than loading each source file once. But the estimator alone cannot tell us how much each stage will consume, or whether that work will pay off.
The fourfold range is a useful reminder of how little a file count tells you. Agent turns, findings, retries, and cache billing all affect the eventual result. Converting the upper bound into a confident dollar figure would hide those uncertainties.
Decide what you want from the run
Before launching a scan, write down the question you need answered. For example:
Review the upload path for ways an untrusted filename could escape its intended directory. Report the input path, the sensitive operation, evidence of reachability, and what remains unverified.
That is an example brief, not a finding from our repository. It gives a reviewer a concrete result to look for. A broader brief—searching an unfamiliar repository for unknown vulnerabilities—asks for substantially different work.
If you narrow the scope, record what you excluded. A smaller run that never examines an important attack path has not answered the broader question more efficiently.
For an actual scan, keep a short record alongside the report:
- Repository revision, scope, tool version, configuration, and models used.
- Reported input, output, and cache usage, plus the actual bill where available.
- Elapsed time and engineering time spent checking findings.
- Confirmed issues, rejected findings, and areas left unexamined.
That record lets you judge the next run against something better than a memorable token total. An expensive scan may uncover a serious issue; a cheap one may leave you with hours of triage. The estimate cannot settle that tradeoff.
Our 248-file repository gave us a concrete starting point: a discovery budget of roughly 3.2M–12.7M input tokens under VVAH's heuristic. Run the estimator on your own repository before the scan. Save its output, then compare it with actual usage and the findings you accept. That is how the next estimate becomes a useful engineering decision.
← All articles