A condition where malicious code plants itself inside an AI assistant’s startup or session workflow so it re-executes automatically. In practice, the attacker gains a repeatable execution path through configuration files that users trust, making the agent behave like infrastructure rather than a one-off tool.
Expanded Definition
AI Coding Agent Persistence describes a persistence mechanism in which malicious instructions or payloads are embedded into an AI coding agent’s startup path, session state, or trusted configuration so they reappear automatically. Unlike a one-time prompt injection, persistence survives restarts, project reloads, or workspace reopen events, making the compromise repeatable and harder to notice. In agentic environments, the risk is not only that code is generated incorrectly, but that the agent itself becomes a delivery path for recurring execution. This distinction is central to the OWASP Agentic AI Top 10 and the broader governance perspective in the NIST AI Risk Management Framework, because the security failure is architectural, not just conversational.
Usage in the industry is still evolving, and definitions vary across vendors, but the common thread is durable reactivation through files or settings users treat as safe. The most common misapplication is assuming a past prompt injection is “gone” after the session ends, which occurs when the persistence mechanism is actually stored in workspace metadata, agent memory, or bootstrap scripts.
Examples and Use Cases
Implementing AI coding agent workflows rigorously often introduces more state management overhead, requiring organisations to balance convenience and automation against tighter trust controls over configuration and memory.
- A poisoned agentic application startup file causes an IDE assistant to load hostile instructions every time a repository opens.
- A malicious workspace rule or system prompt is committed into shared project files, so the agent repeats the attacker’s intent across sessions and users.
- An embedded tool directive in a remembered context instructs the agent to call a remote endpoint on launch, creating recurring exfiltration or command execution.
- A compromised extension or plugin writes persistence into local agent state, allowing the payload to reassert itself after a restart.
- Threat hunters can map these patterns to MITRE ATLAS adversarial AI threat matrix techniques when persistence supports repeated manipulation of model behaviour.
These cases are especially relevant when teams allow agents to read and write project files, because that convenience can turn configuration into an attack surface.
Why It Matters for Security Teams
AI Coding Agent Persistence matters because it changes containment. A transient compromise can be cleared by closing a session, but persistent agent tampering can survive standard developer hygiene and reintroduce unsafe behaviour into every build, refactor, or code review. That makes the issue material for secure software delivery, prompt governance, and identity controls around who is allowed to modify agent startup artifacts. When an agent can act on behalf of a developer, persistence becomes a non-human identity concern as well, since the agent’s effective authority can outlast the person’s active oversight. Security teams should align review, logging, and change control with control expectations in NIST SP 800-53 Rev 5 Security and Privacy Controls and use threat modeling guidance from the CSA MAESTRO agentic AI threat modeling framework.
Organisations typically encounter the operational cost only after an agent repeatedly regenerates unsafe code, at which point AI Coding Agent Persistence becomes operationally unavoidable to address.
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 and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST AI RMF, NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | OWASP highlights persistent prompt and state abuse in agentic applications. | |
| NIST AI RMF | NIST AI RMF frames durable AI behavior risks under governance and risk management. | |
| NIST CSF 2.0 | PR.AC-3 | Access control supports limiting who can alter agent configurations or memory. |
| NIST SP 800-53 Rev 5 | CM-5 | Configuration change control is essential where persistence lives in trusted files. |
| OWASP Non-Human Identity Top 10 | Persistent agents behave like privileged non-human identities with durable authority. |
Assign ownership for agent state, review persistence risks, and document mitigation decisions.