TL;DR: A coding agent can act on a fact that has already changed, with stale context driving destructive outcomes even when every step looks ordinary, according to Backslash Security. The finding matters because AI coding agents are only as safe as the harness checks around them, and re-reading at the moment of action becomes the real control.
Editorial analysis by NHI Mgmt Group, based on content published by Backslash Security: “When your coding agent acts on a fact that has already changed”.
Key questions
Q: What breaks when a coding agent loses context during a long session?
A: The agent can start optimising for the wrong goal, repeat tool calls, or produce code that fits the local test but violates the broader requirement.
Q: Why do branch switches and file edits create risk for coding agents?
A: Because those changes can alter the meaning of a previously read value without the harness announcing it.
Q: How can security teams tell when an agent workflow is becoming unsafe?
A: Look for sessions where private data, untrusted input, and an external communication path all appear in the same task.
Practitioner guidance
- Require runtime re-reading before privileged actions Make the agent re-read any file, branch, host, or secret that can affect the command immediately before it writes or executes.
- Confirm resolved targets, not just commands Show the actual environment, database, or key the command will resolve to before approval, so reviewers see the live target rather than the nominal script name.
- Reset agent context after branch switches Force a fresh session or a mandatory state refresh after checkout, pull, or any environment change that can alter the meaning of previously read values.
Bottom line: The core risk is not model rebellion but stale context, where an agent acts on a snapshot that no longer matches the machine.
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
Stale context is the real trust boundary for coding agents. The important control is no longer just who can trigger an agent, but whether the agent’s picture of state is still true when it acts. That shifts governance from prompt safety to execution-time verification. Practitioners should treat every stateful action as a live trust decision, not a one-time approval.
A few things that frame the scale:
- Claude Code-assisted commits leaked secrets at a rate of 3.2%, more than double the human-only baseline of 1.5%, with peaks reaching 31 secrets per 1,000 commits in August 2025, according to the State of Secrets Sprawl 2026.
A question worth separating out:
Q: Should organisations treat tool-calling agents as part of identity governance?
A: Yes, when those agents can trigger real actions in enterprise systems. At that point they behave like governed non-human identities with a limited operational scope. Identity governance should cover their permissions, review cadence, test coverage, and revocation path before the agent reaches production.
👉 Read our full editorial: Coding agents fail when facts go stale between read and action