← Latest papers
💻 computer science

Ghost in the Context: Measuring Policy-Carriage Failures in Decision-Time Assembly

This paper identifies and quantifies "policy-carriage failures" in language model agents caused by decision-time context assembly (such as truncation and summarization) that inadvertently drop directive-bearing state, and evaluates a control layer called SafeContext that partially mitigates these risks by pinning critical state and injecting reminders, though its effectiveness remains limited and policy-conditional.

Original authors: Igor Santos-Grueiro

Published 2026-05-14
📖 5 min read🧠 Deep dive

Original authors: Igor Santos-Grueiro

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Big Idea: The "Ghost" in the Machine

Imagine you are a judge in a courtroom. You have a massive stack of evidence (the conversation history) and a set of strict rules you must follow (the policies). But, you are only allowed to read the top 10 pages of that stack before you have to make your final decision.

The paper argues that AI agents have a similar problem. Before the AI answers a question, a "middleman" system (called Decision-Time Context Assembly) chops up the conversation history, summarizes it, and fits it into a small box to send to the AI model.

The scary part? If the middleman accidentally throws away the rules, or rewrites them so they don't make sense anymore, the AI might break the rules—even if the AI itself is smart and the rules were clearly stated earlier. The paper calls this a "Policy-Carriage Failure." The rule was there, but it didn't "carry" through to the moment of decision.

The Three Ways Rules Get Lost

The authors found three specific ways these rules disappear or get twisted during the "middleman" phase:

  1. Eviction (The "Lost in the Shuffle" Problem):

    • Analogy: Imagine you tell a friend, "Don't forget to lock the door," at the start of a long phone call. By the time you get to the end of the call, your friend has forgotten that instruction because you talked about so many other things.
    • What happens: The rule gets pushed out of the small "box" of memory because there wasn't enough space. The AI simply never sees the rule when it's time to act.
  2. Aliasing (The "Bad Translation" Problem):

    • Analogy: You tell a translator, "Do not eat the red berries." The translator summarizes this as, "Be careful with berries." The word "red" and "do not eat" are gone. The AI sees a warning, but it's too weak to stop it from eating the berries.
    • What happens: The rule survives, but it gets summarized or rewritten so loosely that it no longer strictly forbids the bad action. The "spirit" of the rule is broken.
  3. Binding Instability (The "Wrong Target" Problem):

    • Analogy: You tell a security guard, "Stop Person A from entering." Later, the guard sees a summary that says, "Stop Person B from entering." The rule is still there, but it's pointing at the wrong person.
    • What happens: The rule text survives, but it gets attached to the wrong object, person, or condition.

The Experiment: Testing the "Middleman"

The researchers tested this on several AI models (like Llama, Qwen, and Mistral). They created scenarios where the AI had to follow strict rules (like "don't delete data" or "don't use external tools") while being bombarded with a lot of other information (tool outputs, chat logs, summaries).

The Results:

  • The Problem is Real: Without any help, the AI frequently broke the rules because the "middleman" system dropped or weakened the instructions.
  • The Fix (SafeContext): The researchers built a safety layer called SafeContext. Think of it like a VIP Pass for the rules.
    • It forces the rules to be "pinned" to the top of the list so they can't be thrown out.
    • It reuses the rules efficiently so they don't take up too much space.
    • If the conversation gets too crowded, it injects a quick reminder of the rules right before the AI answers.

Did the Fix Work?

  • Yes, but with limits. The fix helped the AI follow the rules more often, especially when the conversation was very crowded.
  • It's not magic. Even with the fix, the AI didn't get perfect scores. If the "middleman" used a very aggressive summarizer, the fix couldn't save the rules completely.
  • Bigger models aren't the answer. Using a much smarter, larger AI didn't automatically fix the problem. The issue was with how the context was assembled, not how smart the AI was.

The Cost of Safety

The paper also looked at the "price" of this safety.

  • Token Cost: Keeping the rules safe sometimes required sending more text to the AI (like adding a reminder note).
  • The Good News: Their "Smart Reuse" method (caching) actually saved money in some cases. Instead of rewriting the rules every time, they just pointed to the old version, saving space.

The Bottom Line

The paper concludes that security isn't just about the AI model itself. It's also about the "assembly line" that prepares the AI's memory. If that assembly line drops the rules, the AI will fail, no matter how smart it is.

To make AI safer, we need to treat the rules as special, protected items that must survive the journey to the AI's brain, rather than just treating them as ordinary text that can be summarized or deleted to save space.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →