Cost of running security agents
A triage task of 40,000 input and 4,000 output tokens costs $0.12 on Claude Sonnet 5.5 ($2 and $10 per million tokens, read 19 Nov 2026) and $0.006 on Claude Haiku 5.5. A fix task with a 30-minute human review costs about $50 in time at $100 an hour, so people cost more than tokens.
The calculation and its assumptions
Cost of a task = (input tokens x input price + output tokens x output price) / 1,000,000, with prices per million tokens at the standard tier on 19 Nov 2026. The token counts are round assumptions for a triage run and a fix-draft run, not measurements. To replace them, sum input and output tokens across every model call in one run from your own logs, then average over 20 or more runs.
- Task A, triage one finding: 40,000 input and 4,000 output tokens in total across all model calls.
- Task B, draft a dependency-fix pull request: 150,000 input and 15,000 output tokens.
- Monthly column: Task A on 2,000 findings, an assumed volume.
- Not included: tool-call fees, hosting, logging and people.
Both tasks sit under OpenAI's 272K long-context threshold, so the short-context rows apply. Task B exceeds the 100,000-token prompt threshold on Claude Haiku 5.5, which Anthropic prices at $0.50 input and $2.50 output above that size. Counts also depend on the tokenizer: Anthropic states its 4.7 and later models produce "approximately 30% more tokens for the same text" than earlier ones, so count tokens with each provider's own counter before comparing.
Cost per task at published prices
| Model | Input / output per million tokens | Task A | Task B | Task A x 2,000 per month |
|---|---|---|---|---|
| Claude Fable 5.2 | $8 / $40 | $0.480 | $1.800 | $960 |
| Claude Haiku 5.5 | $0.10 / $0.50 ($0.50 / $2.50 over 100,000 prompt tokens) | $0.006 | $0.1125 | $12 |
| Claude Opus 5.5 | $4 / $20 | $0.240 | $0.900 | $480 |
| Claude Sonnet 5.5 | $2 / $10 | $0.120 | $0.450 | $240 |
| Gemini 4 Carbon, through 30 Nov 2026 | $2 / $10 | $0.120 | $0.450 | $240 |
| Gemini 4 Carbon, from 1 Dec 2026 | $4 / $20 | $0.240 | $0.900 | $480 |
| Gemini 4 Hydrogen | $1.50 / $7.50 | $0.090 | $0.3375 | $180 |
| Gemini 4 Neon | $3 / $15 | $0.180 | $0.675 | $360 |
| gpt-6-luna | $0.10 / $0.50 | $0.006 | $0.0225 | $12 |
| gpt-6.1-terra | $1 / $5 | $0.060 | $0.225 | $120 |
| gpt-6.2-astra | $8 / $40 | $0.480 | $1.800 | $960 |
| gpt-6.2-sol | $2 / $10 | $0.120 | $0.450 | $240 |
Two scheduled changes move these figures. Google's page lists Gemini 4 Carbon at $2.00 and $10.00 through 30 Nov 2026 and $4.00 and $20.00 from 1 Dec 2026, so the same monthly workload goes from $240 to $480. OpenAI's page says Ultrafast for GPT-6.2 Astra and Sol costs 3 times Standard through 28 Feb 2027 and 6 times from 1 Mar 2027.
What caching, batch and residency change
Worked on Task A with Claude Sonnet 5.5, assuming 30,000 of the 40,000 input tokens are a fixed prompt and tool definitions that can be cached. Anthropic's page prices a 5-minute cache write at $2.50 per million tokens and a cache hit at $0.10, and states these multipliers "stack with other pricing modifiers, including the Batch API discount and data residency".
| Case | Arithmetic | Cost of Task A |
|---|---|---|
| Standard | 40,000 x $2 + 4,000 x $10 | $0.1200 |
| Batch API (50 percent discount, $1 and $5) | 40,000 x $1 + 4,000 x $5 | $0.0600 |
| Cache hit on 30,000 tokens | 10,000 x $2 + 30,000 x $0.10 + 4,000 x $10 | $0.0630 |
| First call that writes the cache | 10,000 x $2 + 30,000 x $2.50 + 4,000 x $10 | $0.1350 |
| Batch and cache hit | 10,000 x $1 + 30,000 x $0.05 + 4,000 x $5 | $0.0315 |
| US-only inference (1.1 times) | $0.12 x 1.1 | $0.1320 |
The cache write costs $0.50 more per million tokens than normal input and each hit saves $1.90, so on these 30,000 tokens the write adds $0.015 and the first hit returns $0.057. One reuse inside the cache window repays the write. On OpenAI's page gpt-6.2-sol lists the same $0.10 cached input and $1.00 and $5.00 batch rates, so the table holds there too.
Blocked runs add to the bill
If a safeguard blocks a run and you retry it, you pay for each attempt you are billed for. With block probability p and retry until accepted, cost per accepted task = cost per attempt / (1 - p). On Task A at $0.12, a 5% block rate gives $0.1263 and a 20% rate gives $0.1500. These are upper bounds because they assume a blocked attempt is billed in full; check your billing export. Block rates a vendor measured, and how they vary by day and task, are on measuring an agent after it ships.
People cost more than tokens
Trail of Bits reports that, excluding setup, preparing and reviewing a straightforward Linux kernel backport takes "about 30 minutes of human attention" and a more involved case "around three hours" (Trail of Bits, 2 Nov 2026). A kernel backport is not a dependency upgrade, but the proportion carries over as an illustration. At an assumed $100 an hour, 30 minutes is $50 and three hours is $300. Task B token cost runs from $0.0225 on gpt-6-luna to $1.80 on Claude Fable 5.2 and gpt-6.2-astra. That is 0.045% to 3.6% of the $50 and 0.0075% to 0.6% of the $300.
A cheaper model that produces more rejected pull requests raises the people cost faster than it lowers the token cost; the worked comparison puts figures on that. For harness upkeep and the build decision see build vs buy. Several agents working together use more tokens than one, and this page prices a single agent. Track cost per accepted result after go-live as described in measuring an agent after it ships.
Sources
- Anthropic, Claude pricing (base, cache, batch, residency, Haiku 5.5 tiers), read 19 Nov 2026
- OpenAI, API pricing (standard, batch, Ultrafast schedule), read 19 Nov 2026
- Google, Gemini API pricing (Gemini 4 models), read 19 Nov 2026
- Trail of Bits, Backporting security fixes at scale with Codex (2 November 2026), read 19 Nov 2026
Last reviewed 19 Nov 2026