CI/CD traffic is machine driven, repetitive, and often multiplies across every pull request, test run, and agent step. That makes spend scale far faster than user traffic. A small change in pipeline design can create a large cost spike, especially when prompts include long context, repeated policy text, or multiple model calls per run.
Why This Matters for Security Teams
CI/CD is where LLM spend becomes operational risk, not just product cost. Pipelines are machine driven, repeat constantly, and often fan out across pull requests, test matrices, and agentic build steps. That creates a compounding cost curve that user-facing chat apps rarely match, because human demand is intermittent while pipeline demand is programmatic and predictable in volume. In practice, the fastest-growing exposure often sits alongside credential sprawl and automation, as seen in the State of Secrets Sprawl 2026 and the LLMjacking report.
This is why cost governance for LLMs has to be treated like workload governance, not just budget monitoring. A pipeline that retries on failure, reuses long prompts, or calls multiple models for linting, summarization, code review, and policy checks can multiply spend with very little visible change in developer behaviour. Current guidance from the NIST AI Risk Management Framework suggests tracking risk at the system level, not only at the application layer. In practice, many security teams encounter the cost spike only after a new workflow has already been merged into production CI.
How It Works in Practice
The key difference is that CI/CD systems generate LLM traffic as part of machine execution, so every trigger can create multiple model calls before a human even sees the output. A single pull request may invoke code summarisation, policy validation, secret detection, test generation, and release-note drafting. If each step re-sends large context windows or repeats static instructions, the bill scales with pipeline design rather than user count. That is why organisations should measure token consumption per workflow, per repository, and per stage, not only per team or per month.
Security teams should focus on a few controls first:
- Set per-pipeline and per-step budget caps so an unexpected loop cannot burn through monthly allowance.
- Shorten prompts and remove duplicated policy text where the same instructions are being resent on every run.
- Cache deterministic outputs, especially for repeated scans or policy checks that do not need fresh generation.
- Use routing rules to reserve higher-cost models for rare, high-value decisions and lower-cost models for routine tasks.
- Review retry logic, because failed model calls in CI are often more expensive than the original request.
For workload identity and access control, the cost picture becomes easier to manage when pipelines authenticate as bounded machine identities rather than broad shared service accounts. The SPIFFE workload identity specification gives a useful model for binding execution context to a verifiable identity, while NHIMG guidance on the Guide to SPIFFE and SPIRE helps teams translate that pattern into NHI governance. That matters because cost controls fail when a shared token or overly broad runner identity lets one noisy pipeline consume resources meant for many. These controls tend to break down in monorepos with many parallel jobs and unstable retry behaviour because the token volume becomes difficult to attribute at the stage level.
Common Variations and Edge Cases
Tighter LLM spend controls often increase operational overhead, so teams have to balance predictability against developer throughput. A hard cap can stop runaway usage, but it can also interrupt legitimate release work if the threshold is too low. Best practice is evolving, and there is no universal standard for this yet, especially when agentic workflows mix human approval with autonomous steps.
Edge cases matter most in environments that use AI for code generation, test expansion, or policy synthesis inside the pipeline. The OWASP Agentic AI Top 10 and CSA MAESTRO agentic AI threat modeling framework both reinforce that autonomous tool use changes the risk model: once an agent can chain actions, repeated model calls are not just expensive, they can also amplify failure paths. For cost control, that means teams should distinguish human-requested AI from machine-orchestrated AI, then assign separate limits, logging, and approval gates. NHIMG’s Analysis of Claude Code Security is a useful reminder that code-focused AI systems can shift both spend and exposure at the same time.
The hardest cases are release trains, bulk refactors, and security scanning pipelines that run at scale across many repositories, because small per-run inefficiencies compound into material budget drift very quickly.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10, CSA MAESTRO and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | A2 | Agentic workflows can multiply LLM calls and costs across pipeline steps. |
| CSA MAESTRO | T1 | MAESTRO covers threat modeling for agentic systems with chained actions. |
| NIST AI RMF | AI RMF applies risk management to system-wide AI usage and operational cost. | |
| OWASP Non-Human Identity Top 10 | NHI-03 | Shared tokens and broad runner identities can drive uncontrolled spend. |
| NIST CSF 2.0 | PR.AC-1 | Access governance helps bound which pipelines can invoke costly models. |
Track AI cost risk at the system level and set measurable governance for each workflow.
Related resources from NHI Mgmt Group
- Why do AI agents create more identity risk than traditional LLM applications?
- Why do AI workloads create more risk than traditional applications?
- Why do AI agents create a different access-risk profile than traditional applications?
- Why do static secrets create more risk for AI agents than for traditional workloads?