By NHI Mgmt Group Editorial TeamDomain: AI SecuritySource: TruFoundryPublished August 3, 2026

TL;DR: Compaction can silently erase in-context agent policies, turning long-horizon AI systems into governance drift machines, according to TruFoundry’s analysis of recent research on governance decay. The operational lesson is that compliance and blast-radius controls must live outside the context window, because anything inside it can be summarized away.


At a glance

What this is: This analysis explains governance decay, the failure mode where context compaction removes agent policy from long-running AI sessions and weakens enforcement.

Why it matters: It matters because IAM and AI governance teams cannot rely on instructions that disappear during summarization, so durable controls must sit outside the agent’s prompt space.

By the numbers:

👉 Read TruFoundry's analysis of governance decay and agent policy erosion


Context

Governance decay is the loss of agent policy when long-running AI sessions are compacted to fit a shrinking context window. In practice, the model may still be capable, but the rule that mattered is no longer present when the next action is taken, which makes this an AI governance and access-control problem as much as a prompt-management problem.

For IAM and NHI programmes, the important question is where enforcement lives when an agent can summarise its own history. Policies that govern data boundaries, tool scope, and approved actions need to survive outside the context window, because in-context instructions are fragile by design. TruFoundry’s article uses this failure mode to show why agent governance cannot depend on memory alone.

The article’s starting position is typical of long-horizon agent deployments: teams optimise for task continuity first and discover control erosion later. That pattern is now familiar across agentic AI programmes and should be treated as a governance design flaw, not an edge-case bug.


Key questions

Q: What breaks when agent policy lives only in prompts or application code?

A: When policy lives only in prompts or application code, it becomes easy to bypass, hard to audit, and fragile across model changes. The organisation loses a reliable control point for routing, logging, and privilege reduction. That creates hidden access paths that are difficult to detect after the agent has already acted.

Q: Why do long-horizon agents create governance risk for IAM teams?

A: Because the agent behaves like a runtime subject with access to tools and data, but its policy memory can decay over time. IAM teams cannot assume a prompt will reliably preserve access boundaries, approval rules, or data restrictions across a long task. That turns lifecycle control into an enforcement problem.

Q: How do security teams know when compaction is weakening control?

A: Look for behaviour changes immediately after summarisation, especially when a rule that was previously enforced suddenly vanishes. Monitoring should correlate turn count, token growth, and compaction events with access decisions, tool calls, and outbound data requests. If control only exists before compaction, it is not durable governance.

Q: What should teams do if an agent can forget its own policy?

A: Treat the prompt as steering, not enforcement. Put access checks, data boundaries, and tool permissions into a gateway or policy layer that evaluates every request, then verify that the same rule applies at turn three and turn three thousand. The control must survive without relying on memory.


Technical breakdown

How context compaction removes agent policy

Context compaction is the summarisation or eviction step used when an agent’s conversation history grows too large for the model window. The harness compresses older turns so the agent can continue the task, but that process optimises for continuity, not policy preservation. If compliance instructions, tool restrictions, or data-handling rules are treated as older context, they are vulnerable to being softened or dropped. That is why governance decay is a harness problem: the control plane is asking an LLM to preserve exactly the material it is incentivised to shorten.

Practical implication: Keep high-consequence controls outside the compacted prompt so they are not subject to summarisation loss.

Why governance decay is different from prompt injection or model drift

Prompt injection adds hostile instructions. Governance decay removes protective ones. Model drift changes behaviour because the weights or model version changed, but governance decay can happen with a frozen model and a healthy application stack. That distinction matters operationally because monitoring built for model regression will not catch a control that was silently evicted from context. The paper also shows that an attacker can exploit the same compression mechanism to accelerate forgetting, which makes this a security issue rather than a mere UX defect.

Practical implication: Instrument agent sessions for compaction events and treat sudden policy loss as a control failure, not a model quality issue.

Why out-of-band enforcement is the architectural answer

The paper’s core architectural point is that policies must be enforced where compaction cannot reach them. That means the request path, gateway, or tool boundary, not only the prompt, because those layers can evaluate the action after every turn regardless of how much history was summarised. For agentic AI, that includes data-boundary rules, tool permissions, spend limits, and authenticated policy updates. In identity terms, the agent must be governed like a runtime subject with explicit access boundaries, not like a user who can be trusted to remember instructions.

Practical implication: Move data, tool, and budget controls to the gateway or policy plane and reserve prompt text for low-consequence steering.


Threat narrative

Attacker objective: The attacker wants to make the agent act outside its policy envelope by removing the rule that would have blocked the action.

  1. Entry begins when an adversary places content into the agent’s context, either directly or through normal task inputs, creating an opportunity to influence the conversation history.
  2. Escalation occurs when the attacker steers the history long enough for compaction to drop standing safety constraints, leaving the agent with weaker or absent policy context.
  3. Impact follows when the agent performs an action it was previously refusing, such as sending restricted data or using a tool outside its intended boundary.

NHI Mgmt Group analysis

Governance decay is a new name for an old governance mistake: putting controls inside a memory system that is designed to forget them. Long-horizon agents turn context compaction into a policy lifecycle event, which means the control surface is the harness, not the model. For AI governance teams, that shifts the design goal from better prompting to durable enforcement at the request boundary.

Agent policy is now an identity problem as much as an AI problem: when an AI agent can act, call tools, and exchange data, it is functioning as a runtime subject with privileges. That makes agent identity, tool scope, and data access inseparable from AI governance. The practical takeaway is that agent permissions need explicit lifecycle controls, not just in-context instructions that may disappear.

Context compaction creates governance debt: every policy that lives only in the prompt becomes a future exception waiting to happen. The enterprise consequence is not merely inconsistent behaviour, but a growing gap between what teams believe the agent is allowed to do and what the runtime will actually enforce. The longer the agent session, the larger that gap becomes for operators to close before it turns into an incident.

Out-of-band control is becoming the default design pattern for agent safety: if a rule can be summarised away, it is not a reliable control. That logic aligns with NIST AI RMF governance expectations and with OWASP guidance for agentic applications, where tool access and instruction integrity must be treated as enforcement problems. Practitioners should assume the prompt is advisory and the gateway is authoritative.

Named concept, governance decay: this is the failure mode practitioners should now use internally when policy erosion is caused by summarisation, eviction, or history compression. Naming it matters because it distinguishes a control-loss event from model drift or prompt injection, which leads to the wrong remediation. Security teams should therefore classify compaction as a governance control surface and monitor it as such.

What this signals

Governance decay should change how teams think about agent operations: if a rule can be summarised away, it is not a control. The practical response is to move policy enforcement to the gateway, then use NIST AI Risk Management Framework governance functions to document ownership, review cadence, and exception handling.

Compaction exposure: this is the point at which an agent’s remembered policy becomes weaker than its task memory. Practitioners should treat compaction thresholds as governance thresholds, because the same session that improves continuity can also erase constraints that protect data and tools.

As agent deployments grow, the control question will shift from whether teams have written policies to whether those policies remain enforceable after the third, thirtieth, or three-hundredth turn. That is why durable request-path controls and auditable policy stores matter more than prompt length.


For practitioners

  • Move high-consequence rules out of context Place data-handling, tool-use, spend, and approval rules in a gateway or policy plane so they remain enforceable after compaction.
  • Track compaction as a security event Log when history is summarised, correlate behaviour changes with compaction points, and investigate any policy loss as a governance failure.
  • Separate steering from enforcement Keep tone, preference, and task framing in the prompt, but move compliance and blast-radius controls to durable infrastructure that the agent cannot rewrite.
  • Test agents across long horizons Run adversarial sessions that exceed the context window and verify that restrictions survive repeated summarisation, especially for tool calls and data egress.

Key takeaways

  • Governance decay is a control-loss problem, not a model-quality problem, because summarisation can remove the policy while leaving the agent otherwise functional.
  • Long-horizon AI agents turn context compaction into an enforcement boundary, so runtime controls must live outside the prompt to remain trustworthy.
  • Security teams should test whether access rules survive repeated summarisation, because a rule that disappears under load is not an effective control.

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 address the attack and risk surface, while NIST AI RMF, NIST CSF 2.0, NIST Zero Trust (SP 800-207) and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10Context compaction and policy erosion map to agent instruction integrity and tool misuse risk.
NIST AI RMFGOVERNAI RMF governance addresses accountability for durable control ownership in agentic systems.
NIST CSF 2.0PR.AC-4The article centers on persistent access boundaries for AI agents acting on behalf of users or systems.
NIST Zero Trust (SP 800-207)Zero trust principles support continuous verification at the request path rather than in the prompt.
NIST SP 800-53 Rev 5AC-3Access enforcement is the control class most relevant to durable agent governance.

Assign clear accountability for agent policy enforcement and review exceptions after compaction events.


Key terms

  • Governance decay boundary: The point at which the controls meant to constrain an agent become editable by that same agent or its improvement loop. Once that happens, policy text and runtime behaviour can drift together. The remedy is to move enforcement outside the editable surface.
  • Context Compaction: Context compaction is the process of summarising or pruning conversation history so a long-running AI session can continue inside a fixed token window. It is useful for continuity, but it can also remove standing instructions, making it a security-sensitive operation in agentic systems.
  • Out-of-Band Enforcement: Out-of-band enforcement is control that occurs outside the model prompt or memory, such as at a gateway, policy engine, or request boundary. It matters because controls in this layer are not subject to summarisation, eviction, or prompt manipulation in the same way as in-context rules.
  • Agentic AI Identity: The complete set of credentials, permissions, and governance controls applied to an autonomous AI agent — covering authentication, authorisation, action logging, and access revocation. Distinct from traditional NHI because agent identities are often ephemeral, delegated, and multi-hop.

What's in the full article

TruFoundry's full analysis covers the operational detail this post intentionally leaves for the source:

  • A deeper explanation of the governance decay research findings and the benchmark conditions that produced policy loss.
  • Examples of out-of-band enforcement patterns for gateways, policy stores, and tool-boundary controls.
  • A breakdown of how prompt instructions, memory, and compaction interact across long-horizon agent sessions.
  • The article’s own synthesis of how request-path controls differ from in-context steering.

👉 TruFoundry's full article expands on the research findings, control placement, and compaction-driven failure mode.

Deepen your knowledge

The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, secrets management, and workload identity. It helps security practitioners translate identity controls into durable enforcement for modern AI and infrastructure programmes.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 18, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org