Tokenomics: 5 Ways AI Agents Waste Tokens (And How to Stop Them)

Tokens keep getting cheaper. AI bills don’t. Here’s where AI agents waste tokens on work existing tools or people already do for less.

November 4th, 2026

AI tokens are getting cheaper, but enterprise AI bills keep climbing. The question worth asking is what those tokens are being used for. The cost of using large language models (LLMs) has dropped dramatically over the past couple of years, yet companies are spending more than ever on AI. The models are cheaper, the hardware is faster, and the bills keep growing.

Part of this is increased adoption. Organizations have moved beyond asking chatbots to summarize documents and now deploy autonomous agents that write code, review pull requests, investigate security vulnerabilities. These agents don't generate one response and stop. They reason, check their work, and try again, sometimes hundreds of times before completing a single task.

Every one of those steps consumes tokens, and every token costs money.

Managing that spend has a name: tokenomics, the purchasing, spending, budgeting, and management of tokens used by AI applications. It matters more as organizations deploy AI at scale, particularly in software development and security.

Most conversations about tokenomics focus on the price of tokens. Far fewer examine what those tokens are actually doing. As AI becomes embedded in everyday workflows, that distinction matters. Every task handed to an LLM comes with a cost, and not every task needs an LLM. Understanding the difference is where the real savings begins.

Not All Compute Costs the Same

Traditional software runs on CPUs, general-purpose processors that are relatively inexpensive to operate. LLMs depend on GPUs and other specialized accelerators, which are significantly more expensive to purchase, operate, and power. This difference matters because many tasks we're now asking AI to perform can already be handled by traditional software.

Consider something as simple as searching a database. SQL has been doing this efficiently for decades. You can certainly ask an LLM to answer the same query, but now you're using expensive computational resources to accomplish something a conventional database engine can do faster and more predictably.

A 2024 research paper examining the energy costs of LLM-based database queries found substantial overhead compared with conventional SQL approaches, even when using relatively small models.

The same principle applies to application security. Pattern matching, dataflow analysis, and identifying known vulnerability patterns are problems we've been solving with deterministic tools for years. Asking an LLM to rediscover these issues from scratch usually isn't better, just more expensive.

That doesn't mean AI has no place in these workflows. Quite the opposite. AI is extremely useful when a task requires interpretation, contextual reasoning, or generating something new. The key is knowing where those capabilities add value.

Five Ways Organizations Waste AI Tokens

Most organizations looking to reduce AI spending start by comparing model prices, negotiating volume discounts, or setting consumption limits. Those approaches can help, but they don't address how the tokens are being consumed in the first place.

Five ways AI agents waste tokens, each with a fix: run static analysis before the LLM (cost cut from $23,700 to $1,461), have the LLM write a rule once (96 queries for under $13), send only relevant code instead of whole repos (59.4% of tokens went to repeated review), plan before executing (about 5x fewer tokens), and ask an engineer when a person can decide in minutes.

Five ways AI agents waste tokens, and how to fix each one.

1. Using AI to Solve Problems We've Already Solved

Imagine pointing an LLM at an entire code repository and asking it to identify security vulnerabilities. The model reads the code, reasons about possible issues, and attempts to determine which ones matter.

Now imagine doing that across thousands of repositories every time a developer pushes a change. The costs accumulate quickly, particularly when much of that work could be performed by traditional static analysis.

Security tools can identify known vulnerability patterns, trace dataflow, and filter potential issues without requiring an LLM to reason through every line of code. The model can then focus on the smaller set of findings that benefit from additional analysis.

Research published by security vendor Knostic on its OpenAnt vulnerability discovery pipeline illustrates the potential savings. By using static reachability analysis to narrow what the LLM needed to examine, the researchers reported reducing estimated costs from approximately $23,700 to $1,461 across eight projects. That's a reduction of more than 96%.

Those numbers reflect one implementation, so your savings will vary. Still the lesson holds: let inexpensive, deterministic tools do the work they're good at, and save the expensive reasoning for problems that actually require it.

2. Paying AI to Solve the Same Problem Repeatedly

One of the best uses of AI is generating traditional automation. Suppose your organization wants to detect a particular security issue whenever code changes. You could have an LLM inspect the repository every time, reasoning through the vulnerability pattern from scratch. Or you could ask the LLM to create a detection rule once and then execute that rule automatically whenever the code changes.

The second approach uses AI to build something reusable instead of repeatedly paying it to perform the same task.

A 2026 research paper explored this approach using LLM-generated CodeQL queries. The researchers found that having an LLM directly scan entire repositories was computationally and financially impractical. Generating detection queries instead cost less than $13 for 96 queries, which collectively identified 50 known vulnerabilities.

The broader principle extends well beyond security scanning. If an AI agent repeatedly performs the same analysis, ask whether that reasoning can be converted into a script, query, rule, or other reusable automation. Sometimes the smartest thing an AI can do is create something that makes using it unnecessary the next time.

3. Making AI Read the Same Information Over and Over

A less obvious expense in agentic workflows is repeatedly sending the same information back to the model. An agent reviewing code might read a file, suggest a change, review the result, reconsider its suggestion, and then read much of the same code again. Each interaction adds tokens, even when the underlying information hasn't changed.

Multiply that behavior across dozens of files and hundreds of interactions, and the cost of providing context can become more significant than generating the solution. One study of 30 agentic software development tasks found that iterative code review accounted for 59.4% of total token consumption. Input tokens represented the largest share of overall usage, at 53.9%. The findings are preliminary, but the pattern is worth checking on your own workflows. 

Providing an AI model with more context isn't always better. Sometimes it's just more expensive. Organizations should examine how much information their agents repeatedly consume and whether that information can be filtered, summarized, cached, or retrieved only when needed. In application security, this means giving an agent relevant findings and the surrounding code rather than repeatedly feeding it entire repositories.

4. Letting Agents Figure Everything Out as They Go

Many AI agents operate through an iterative process. They decide what to do, execute an action, examine the result, and then decide what to do next. This approach can be effective, especially for unpredictable tasks. But it also means paying for a round of reasoning at every step.

An alternative is to have the model develop a plan before executing the work. The plan can be evaluated and refined, then executed with fewer unnecessary reasoning cycles. This isn't a new concept. A 2023 research paper introduced an approach called ReWOO, which separated reasoning from tool execution. In its experiments, the approach used about five times fewer tokens than agents that reasoned through every individual step, while slightly improving accuracy. The paper is from 2023 and models have changed since, but the pattern still applies. Not every action requires a new decision. If an agent already knows what needs to happen, executing that plan is often cheaper than repeatedly asking it what comes next.

5. Forgetting That Humans Are Still an Option

We've become so focused on automating everything with AI that we sometimes overlook an obvious alternative: asking a person. Not every decision benefits from additional model reasoning. Some questions require organizational context, business judgment, or knowledge that isn't readily available to an AI system.

An agent might spend considerable time and tokens investigating whether a particular security finding represents an acceptable business risk. Meanwhile, an experienced security engineer familiar with the application might resolve the question in a few minutes. Of course, the opposite can also be true. AI can handle many repetitive tasks far more economically than humans.

Humans aren’t always cheaper than AI, and AI isn’t always cheaper than humans.  Organizations should evaluate the cost of reaching a decision rather than assuming automation is always the least expensive option. The goal should be the most effective combination of people, conventional automation, and AI.

What Efficient AI Security Looks Like

These five examples point toward a different way of thinking about AI adoption, particularly in application security. Instead of building workflows where an LLM handles every step, organizations can combine deterministic security tools with AI reasoning.

Traditional security engines identify potential vulnerabilities, trace dataflow, and produce consistent findings. AI agents then use those results to investigate more complex questions, explain issues, assess their significance, and help developers produce fixes.

This is the approach behind Semgrep Agentic Workflows. Rather than requiring an agent to discover every security issue through expensive model reasoning, Semgrep provides findings from its deterministic analysis engine. The agent can then concentrate on work where its reasoning capabilities provide additional value.

Cost isn't the only benefit. Deterministic analysis is faster, produces consistent, repeatable results, and makes security behavior easier to evaluate. It can identify issues without waiting for an AI model to reason through every line of code or hoping it makes the same decision twice. AI still plays an important role, but using it selectively makes the entire process faster, more predictable, and less expensive.

Start Measuring Outcomes, Not Just Tokens

If you're responsible for an organization's AI budget, there's a useful exercise you can perform this week.

Examine your most expensive AI workflows and ask five questions:

  1. Is the model performing work that conventional software could handle?

  2. Is it repeatedly solving a problem that could be automated once?

  3. Is it consuming the same information across multiple interactions?

  4. Is it reasoning through steps that could be planned and executed more efficiently?

  5. Is AI actually the least expensive way to reach the required decision?

These questions shift the conversation away from token prices and toward the economics of getting work done.

A model that costs half as much per token isn't necessarily cheaper if it requires three times as many tokens to complete the task. Similarly, a workflow that uses fewer tokens isn't necessarily better if it produces worse results or requires additional human effort to correct mistakes.

The metric that matters is the total cost of achieving a useful, reliable outcome, including computation, automation, human effort, and verification.

AI is going to become a bigger part of software development and security. That's not particularly controversial anymore. What's still being figured out is how to use it efficiently.

The organizations that get this right won't be the ones buying the cheapest tokens or deploying the largest models. They'll be the ones that understand which problems benefit from AI and which are better handled by tools we already have.

Stop expecting AI to do everything without the right tools. Purpose-built, AI-native tools give AI agents the speed, accuracy, and context they need to work more efficiently. The future of AI isn't just smarter models or cheaper tokens. It's giving those models the right tools to get the job done faster, better, and at a fraction of the cost.

If those five questions turned up a workflow worth rethinking, see how Semgrep Agentic Workflows lets the Semgrep engine find the issues so your agents can focus on fixing them.