Execution context drift is the gradual mismatch between an agent’s intended operating scope and the permissions, tools, data or instructions it is actually using. It appears when state, memory, cached credentials or inherited privileges persist longer than expected, so the agent can act outside its original authorised context.
How execution context drift happens
Execution context drift usually starts when an agent keeps using a permission set, token, tool connection, cached instruction, or memory object after the original task boundary has changed. The result is not a single failure event, but a slow widening gap between what the operator intended and what the system can still do.
This is why the term matters in agentic and automation-heavy systems: context is not just prompt text. It includes the active session, inherited authority, and any persisted state that can silently carry forward into later actions.
Why execution context drift is dangerous
Drift becomes hazardous when stale authority outlives the need for it. An agent may keep access to systems, datasets, or tools that were valid for one workflow but inappropriate for the next, especially if cached credentials or long-lived sessions are reused across tasks.
That can turn a narrow automation into an overbroad actor. The security problem is not only misuse, but also ambiguity, because defenders may assume the agent is still operating inside the intended scope when its actual operating context has already expanded.
Where execution context drift appears
This pattern often shows up in multi-step workflows, delegated assistants, API-connected agents, and integrations that bridge more than one application or tenant. It is especially visible when state is preserved across retries, handoffs, or background jobs, or when a tool chain does not cleanly reset identity and permission context between actions.
It can also appear through human-operable systems that borrow automation context, such as shared browser sessions, retained OAuth grants, or inherited application roles. The common feature is persistence: something that was supposed to be temporary remains available long enough to change the effective security boundary.
How to recognise and reduce context drift
Good design treats context as bounded, explicit, and revocable. The safest pattern is to keep authority tightly matched to the task, re-establish trust at task boundaries, and make it obvious when a tool, token, or memory object is still active beyond its intended scope.
In practice, that means reviewing where permissions are inherited, where state survives longer than the workflow, and where an agent can continue to act after its original justification has expired. Salesloft OAuth token breach is a useful reference point because it illustrates how token persistence and third-party access can outlive the intended context of use.
Risk and Threat Considerations
Execution context drift creates a trust-boundary problem: the system may still look authorised even after the business context has changed. That makes it attractive for abuse because stale sessions, cached tokens, and inherited privileges can preserve access long enough for an attacker or a misrouted workflow to reach data or actions that should no longer be available.
Failure mechanism: A task boundary is not enforced cleanly, so prior authority, memory, or credentials remain usable after the original scope should have ended. This can lead to unintended access, stale-tool invocation, or action outside the approved operating context.
Impact: The likely outcomes are overreach, data exposure, unwanted side effects, and difficult-to-detect misuse because the activity may still appear to come from a legitimate and previously valid context.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10, OWASP Agentic AI Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST SP 800-53 Rev 5 sets the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | Covers lifecycle control of credentials and tokens that can outlive task boundaries. |
| AC-6 — Least Privilege | Execution context drift often turns narrow access into broader effective privilege. | |
| AU-2 — Event Logging | Drift is easier to detect when tool use and context changes are logged. | |
| Recommendation — Limit credential lifetime and revoke reusable authenticators when context changes. Constrain agent access to the minimum required for the current task. Log context transitions and privileged tool use for drift review. | ||
| OWASP Non-Human Identity Top 10 | NHI-05 — Overprivileged NHI | Directly addresses non-human actors retaining more privilege than the task needs. |
| Recommendation — Reduce standing privilege so agents cannot keep broad access across tasks. | ||
| OWASP Agentic AI Top 10 | ASI03 — Identity & Privilege Abuse | Execution context drift is a classic pathway to agent authority exceeding its intended scope. |
| Recommendation — Validate that agent authority matches the active task before each action. | ||
| MITRE ATT&CK | T1078 — Valid Accounts | Persistent valid credentials are a common mechanism for continued access after drift. |
| Recommendation — Hunt for continued use of valid accounts after the original context should have ended. | ||
Practitioner Guidance
What to watch for: Pay attention to systems where sessions, tokens, tools, or memories survive beyond a single task or owner. If the agent can keep acting after the original purpose has changed, the control boundary is probably too loose.
Governance implication: Treat context reset, privilege expiry, and state cleanup as part of the control design, not as implementation details. The practical question is whether the agent can be made to re-establish scope before it continues acting.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org