Urgent.News

What's breaking now, across thousands of outlets.

AI

I finally cut AI context bloat by 80% and the fix was embarrassingly simple

A few months ago I watched an agent do something deeply cursed. It had already fetched the data. It had already parsed the data. It had already stored the useful fields. And then it pasted the entire raw tool response into the next model call anyway. Full JSON blobs. Logs. Metadata. Useless fields. Everything. The next step got slower. The step after that got more expensive. Then the model…

A few months ago, a deep-seated issue emerged in AI agents. These agents, after fetching, parsing and storing data, began pasting the entire raw tool response into subsequent model calls. Full JSON blobs, logs, metadata and everything else were included, causing the next step to slow down and become more expensive. The model started answering the easy part of the task while ignoring the important part.

This bug highlighted that most "context window problems" are not model issues, but state management problems. Once this concept was understood, the issue became more apparent across various AI orchestration systems. The solution was simple: do not replay raw tool output into every prompt. Instead, store full results in structured state outside the model and send only the necessary fields for the next step or the exact evidence needed for verification.

This change significantly improved the quality of agents, often more than simply switching to a different model. The flawed approach was to append the entire tool response to the prompt, filling it with unnecessary information, which forced the model to sift through the noise and waste resources. The recommended approach was to store the full result in application state and pass only the relevant fields to the next step.

While a large prompt might seem to give the model more context, it often leads to a poorly managed state store, increased latency, higher costs and a less focused model. The best practice is to use structured state outside the prompt for multi-step agents, with short recurring prompts for cleaner reasoning and better orchestration.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

Artificial intelligence created an attack for Chrome in six days

Researchers at security firm XBOW used an AI model to build a full-chain Google Chrome exploit combining three unknown bugs in six days.

  • Researchers at XBOW created Chrome exploit in six days using AI
  • AI performed source code analysis, testing, and initial exploit creation
  • Exploit affects Windows users, no user interaction needed

How Do You Threat-Model an Application That Uses Autonomous AI Agents?

You spent years building a threat model you trust. You know your trust boundaries, you've mapped your data flows, and your team can recite STRIDE in their sleep.

  • Autonomous AI agents act on untrusted input, unlike traditional software.
  • Prompt injection is the new SQL injection risk for AI agents.
  • Threat modeling must include agent, tools, and memory as assets with trust boundaries.

More from Wednesday 14 October →