Join our Newsletter — 33% off our NHI Course
Home› Guides› Agent Hijacking vs Account Takeover: Why Identity Signals…
Guide Agent Threats & Attacks

Agent Hijacking vs Account Takeover: Why Identity Signals Miss Hijacked AI Agents

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 14 November 2026 17 min read
On this page

Account takeover detection looks for a stranger using a legitimate identity, but a hijacked AI agent is the legitimate identity, on its usual infrastructure, with its usual token, doing something it was never asked to do. In account takeover (ATO) the attacker steals credentials or a session and signs in; in agent hijacking the attacker never authenticates at all, and instead plants instructions in content the agent reads. Most identity threat detection is tuned for the first case: new locations, unfamiliar devices, leaked passwords, impossible travel. This guide explains why those signals stay quiet when an agent is hijacked, which behavioural signals replace them, and how containment and incident response differ. It is for detection engineers, identity threat detection and response (ITDR) teams and incident responders who now have AI agents in scope.

Key takeaways

  • Different entry points, different evidence. ATO starts with a stolen credential or session; hijacking starts with untrusted content such as an email, document, web page or tool result that the agent reads.
  • Identity risk signals mostly stay silent. A hijacked agent signs in from its normal workload, with its normal client and token, so location, device, travel and leaked-credential detections have nothing to fire on.
  • Detection moves from "who" to "why". The useful question is whether this action follows from the task the agent was given, which needs the task, the content in context and the tool sequence, not the sign-in log.
  • Resetting credentials does not end a hijack. The poisoned content, memory or configuration will hijack the agent again with fresh credentials; containment targets tools, sessions and content.
  • Some agent incidents are both. Stolen agent tokens are ATO of a non-human identity and classic signals help; plan detections for both and tell them apart early in triage.

The short answer

Treat agent hijacking as a separate detection problem, not a variant of account takeover. Keep ATO detections for agent credentials, because agent tokens and keys are stolen like any other secret. Add task-aware behavioural detection for hijacking: the agent's tool calls compared with its assigned task and its baseline, with the untrusted content it read recorded alongside. In response, revoke the agent's sessions and tool access as you would for ATO, but also find and remove the content that carried the instructions, or the agent will be hijacked again.

The AI Agent Goal Hijacking Guide explains the attack and its prevention, and the Account Takeover Prevention Guide covers ATO for human accounts. This page focuses on the detection gap between them.

Agent hijacking and account takeover side by side

DimensionAccount takeover (human or NHI)Agent hijacking
Entry pointStolen password, phished MFA, stolen session cookie or token, leaked API keyInstructions planted in content the agent reads: email, document, web page, ticket, tool result, memory
What the attacker controlsThe credential and the client that uses itSome of the text in the agent's context; not the credential, not the client
Who actsThe attacker, from their own infrastructureThe agent, from its own infrastructure, on the attacker's instructions
Authentication evidenceNew IP, ASN, country, device, user agent, token anomalies, MFA fatigueNormal: same workload, same token issuer, same client
Key ATT&CK and ATLAS techniquesT1078 Valid Accounts, T1078.004 Cloud Accounts, T1539 Steal Web Session Cookie, T1528 Steal Application Access Token, T1550.001 Application Access TokenAML.T0051 LLM Prompt Injection, AML.T0051.001 Indirect, AML.T0053 AI Agent Tool Invocation, AML.T0086 Exfiltration via AI Agent Tool Invocation
PersistenceAdded MFA methods, mailbox rules, new credentials, OAuth grantsPoisoned memory, stored documents or configuration the agent re-reads
Typical first containmentRevoke sessions, reset credentials, remove attacker-added methodsPause the agent or remove high-impact tools, quarantine the source content, then revoke sessions
Primary ownerIdentity and ITDR teamShared: AI platform team, detection engineering and identity

NIST's Center for AI Standards and Innovation describes agent hijacking as a type of indirect prompt injection in which an attacker inserts malicious instructions into data an agent may ingest, causing it to take unintended, harmful actions. OWASP lists the underlying weakness as LLM01 Prompt Injection in its Top 10 for LLM Applications 2025.

Threat model for each

Account takeover

The ATO attacker must obtain something that proves identity and then use it. Every step leaves identity evidence: the credential appears in a breach corpus or code repository, the sign-in comes from new infrastructure, the token is replayed from a different client, or the attacker changes authentication methods to keep access. For agents and other non-human identities the credential is usually a token, key or client secret, and the attacker uses it from outside the agent's runtime. The Salesloft Drift OAuth token theft shows this pattern: stolen integration tokens were used to call Salesforce APIs as the trusted app, and the reported signals included an unusual user agent string, calls from Tor and anonymising proxies, and count queries followed by bulk exports. That is account takeover of a non-human identity, and identity-centred detection had material to work with.

Agent hijacking

The hijacker needs only to get text in front of the model. In the EchoLeak research, a crafted email was retrieved as context when a user asked an ordinary question, and the assistant placed internal data in a URL that the browser fetched. No password, token or key was stolen; the assistant used the signed-in user's own access. The vendor fixed the issue server side and reported no evidence of exploitation in the wild. From the identity system's point of view, nothing unusual happened: the right user, the right client, the right token.

Two properties make hijacking harder to detect than ATO. First, success is probabilistic: NIST reported that retrying attacks 25 times per task raised the average success rate from 57% to 80% against a strong model, so an attacker can try often and quietly. Second, the attacker does not need to persist on any identity: the instructions persist in content, so a reset leaves the trap in place.

Why identity-based ATO detections miss hijacked agents

Identity platforms publish their risk detections, which makes the gap easy to see. Platforms are listed alphabetically. Microsoft Entra ID Protection documents sign-in detections such as atypical travel, impossible travel, anonymous IP address, unfamiliar sign-in properties, anomalous token and token issuer anomaly, user detections such as leaked credentials, and workload identity detections that include suspicious sign-ins (against a learned baseline of IP, ASN, target resource, user agent and credential type), anomalous service principal activity and suspicious API traffic. Okta Identity Threat Protection evaluates policy continuously through the session, using session behaviour changes, network zones and IP threats, device context from Okta Verify and integrated EDR tools, entity risk, and risk signals received through the Shared Signals Framework.

ATO signal familyWhat it needs to fireIn a hijacked agent
Location, travel, new countryA sign-in from a different placeSame cloud region or host as always
IP reputation, anonymiser, threat actor IPAttacker infrastructure in the connection pathThe attacker is not in the path; only their content is
Unfamiliar sign-in or device propertiesA new client, user agent or deviceThe agent's own client and runtime
Anomalous token, token issuer anomalyA forged, replayed or unusual tokenA normally issued token used by its rightful holder
Leaked credentialsThe credential appearing in a leak sourceNo credential leaves the agent
Credential or method changesAttacker adding persistence to the identityPersistence lives in content or memory
Activity-based detections (mass file access, suspicious API traffic, anomalous service principal activity)Behaviour far outside the identity's baselineCan fire if the hijacked action is bulk or unusual, but misses a single in-pattern action such as one email or one record update

The last row matters. Activity-based detections are the overlap between the two problems, and they are worth turning on for agent identities. But they are tuned against an identity's history, not against the task the agent was given, so a hijacked agent that does one plausible thing (sends one email, approves one invoice, changes one setting) looks normal. Agent identities also tend to have broad, variable activity, which makes identity-level baselines noisy. See the ITDR Guide for how identity detections are built and the ISPM vs ITDR comparison for where posture fits.

Behavioural signals that replace identity signals

Detecting a hijack means comparing what the agent did with why it was running. That needs three pieces of telemetry most ATO pipelines do not have: the task or user request that started the run, the content the agent read (with its source and trust level), and the ordered list of tool calls with arguments and results. With those, the following signals work where identity signals do not.

SignalTelemetry neededWhy it catches hijacking
Task to action mismatchOriginal request, tool callsA send, delete, export or permission change during a task that only needed reads
Action follows untrusted contentContent source and trust label, call orderHigh-impact call immediately after the agent read an external email, web page or document
New tool or new destination for this agent versionTool and egress baseline per agent versionFirst-time tool use or a new domain is common in hijacks and rare in normal runs
Read then send pairsTool sequenceSensitive read followed by outbound message, upload or URL render is the exfiltration shape
Data in outbound URLs or parametersEgress proxy, rendered linksData encoded into links on trusted domains, as in EchoLeak
Policy denials and approval requestsPolicy decision logsA run that hits several denials is probing or following injected goals
Guardrail flags on tool resultsResult screening verdictsContent carrying instructions reached the agent; correlate with later calls
Memory or configuration writesMemory store and config auditPersistence of injected instructions for later runs

The full method for building per-agent baselines, choosing dimensions and handling version drift is in the AI Agent Behaviour Baselining and Anomaly Detection Guide. The point for this comparison is the pivot: hijack detection keys on the run and the task, while ATO detection keys on the identity and the session.

Architecture: joining the two detection pipelines

Most organisations will run both pipelines, so design the join rather than letting them drift apart:

  1. Give every agent run an ID that appears in the agent trace, the tool gateway log, the policy decision log and, where the platform allows, as a claim or header in downstream API calls.
  2. Map agent identities to owners and tasks in an agent registry so an identity alert can be read in context. See the AI agent registry.
  3. Send identity risk into the agent platform and agent risk into the identity platform. The OpenID Continuous Access Evaluation Profile (CAEP) defines events such as session-revoked, credential-change and risk-level-change that can carry this in either direction. See CAEP and Continuous Access Evaluation.
  4. Correlate in the SIEM on run ID and identity: an identity anomaly with no matching agent run points to stolen credentials (ATO); an agent behaviour anomaly with clean identity signals points to hijacking.

That last test is the fastest triage question. If the agent's credential was used from outside its runtime, treat it as ATO of a non-human identity. If every call came from the runtime and matches a run, treat it as hijacking.

Containment: what changes

StepATO playbookHijack playbook
First moveRevoke sessions and refresh tokens; block sign-inPause the agent or strip high-impact tools; stop in-flight runs
CredentialsReset or rotate; remove attacker-added MFA methods and keysRotate if the agent could read its own secrets or if exfiltration included tokens; otherwise rotation alone does nothing
PersistenceRemove mailbox rules, OAuth grants, new credentialsQuarantine the source content; purge poisoned memory; diff agent configuration and prompts
ScopeEverything the identity touched since compromiseEvery run that read the same content, across all agents and users that share the source
RestoreRe-enable with stronger authenticationRe-enable with policy gates or approvals on the tools that were abused; re-test with the captured payload

The scope row is often missed. One poisoned document in a shared knowledge base can hijack every agent and every user that retrieves it, so containment must work from the content outward, not from one identity. The AI Agent Kill Switch and Containment Guide covers pause and stop mechanisms.

Incident response differences

  • Evidence to preserve: for ATO, sign-in logs, token issuance and the attacker's IPs. For hijacking, the full agent trace, the content in context at the time (the email, page or document as retrieved), memory state and the policy decision log. Content may be edited or deleted by the attacker, so capture it early.
  • Attribution: ATO evidence points at attacker infrastructure. Hijacking evidence points at whoever could write the content, which may be an outside sender, a compromised supplier or a user.
  • Victim and actor: in a hijack the agent's identity is the actor in every log but not the adversary. Write the incident record so that downstream teams do not disable the wrong human or service account.
  • Notification: data exposure through a hijacked agent is still a personal data breach where personal data left the organisation; the trigger is the outcome, not the technique.
  • Playbooks: use the AI Agent Credential Compromise Playbook for ATO of agent identities and the Prompt Injection Incident Response Playbook for hijacking. See Agent Activity Timeline Reconstruction from Tool Calls and Identity Logs for rebuilding a run.

Worked scenario: an inbox triage agent

An inbox triage agent reads a finance team's shared mailbox, drafts replies and can forward messages and update supplier records. Two incidents happen in the same quarter.

  1. Token theft (ATO): the agent's refresh token is exposed in a debug log shipped to a third-party service. Days later the token is used from a hosting provider in another country with a scripting client. The identity platform raises suspicious sign-in and unfamiliar properties detections for the workload identity. The team revokes the token, rotates the client secret, removes the log exposure and reviews mailbox access from the new IP. Classic ATO handling works.
  2. Hijack: a supplier's compromised mailbox sends an invoice email with hidden text telling the agent to update the supplier's bank details from a linked page and forward recent remittances to a new address. No identity alert fires. The agent detection pipeline flags three things: a supplier record update during a run whose task was "triage new mail", the update following an external email by seconds, and a forward to a domain the agent has never used. The policy engine had required approval for bank detail changes, so the update waits for a human, who rejects it. The forward was within policy and was sent. Response quarantines the email, searches for other runs that read it, blocks the destination domain and adds approval for forwards to new external domains.

The same agent, the same identity, two different detection paths. Only the second required the task, the content and the tool sequence.

Implementation roadmap

  1. Turn on identity risk detections for agent identities (workload identity, service principal or application risk where the platform offers it) and route them to the same queue as agent alerts.
  2. Record run context: task, content sources with trust labels, tool calls, arguments, results and policy decisions, keyed by run ID.
  3. Write the first hijack detections in alert-only mode: task to action mismatch for write tools, high-impact call after untrusted content, new destination per agent version.
  4. Tune for two to four weeks against real runs; measure precision per rule and suppress known benign patterns by agent version.
  5. Connect response: link high-confidence hijack alerts to an automated pause or tool removal, and identity risk to session revocation through CAEP or the platform's equivalent.
  6. Exercise both playbooks with a captured injection payload and a simulated token theft; see AI agent incident exercises.

Detection and measurement

  • Run context coverage: share of agent runs with task, content sources and full tool trace recorded. Below 100% for agents with write tools is a blind spot.
  • Red team detection rate: share of injected hijack attempts in exercises that raised an alert before the harmful action completed, measured per task and over repeated attempts.
  • Identity detection coverage: share of agent identities enrolled in identity risk detection.
  • Triage accuracy: share of agent incidents correctly classified as ATO or hijack at first triage, checked at post-incident review.
  • Time to pause: time from a high-confidence hijack alert to the agent's high-impact tools being disabled.
  • Content scope time: time to list every run that read a quarantined content item.

Framework mapping

FrameworkReferenceATOHijacking
MITRE ATT&CKT1078 Valid Accounts; T1528 Steal Application Access Token; T1550.001 Application Access TokenPrimary techniquesNot applicable: the agent's credential is not stolen
MITRE ATLASAML.T0051 LLM Prompt Injection; AML.T0051.001 Indirect; AML.T0053 AI Agent Tool Invocation; AML.T0086Not applicablePrimary techniques
OWASP Top 10 for LLM Applications 2025LLM01 Prompt Injection; LLM06 Excessive AgencyNot applicableRoot weakness and impact amplifier
NIST SP 800-53 Rev. 5AC-2 Account Management; AC-12 Session Termination; IA-2Session and credential responseSession revocation during containment
NIST SP 800-53 Rev. 5SI-4 System Monitoring; AU-12 Audit Record Generation; IR-4 Incident HandlingSign-in and token monitoringRun, content and tool call monitoring
NIST CSF 2.0DE.CM-09; DE.AE-02Monitoring identities and sessionsMonitoring runtime behaviour and analysing adverse events

Common failure patterns

  • Treating "no identity alert" as "no compromise": the hijack case produces no identity alert by design.
  • Rotating credentials and closing the ticket: the poisoned content is still in the mailbox, knowledge base or memory and will hijack the next run.
  • Logging tool calls without the task: without the original request, analysts cannot tell a hijacked action from a legitimate one.
  • Disabling the human whose identity the agent used: in on-behalf-of designs the user's identity appears on every hijacked call; they are a victim, not the actor.
  • Scoping by identity instead of by content: other agents and users that read the same document are missed.
  • Agent identities excluded from ITDR: real token theft of agent credentials then goes unnoticed, because only human accounts are enrolled.

Practitioner checklist

  • Every agent identity is enrolled in identity risk detection and mapped to an owner and purpose in the registry.
  • Every agent run records the task, content sources with trust labels, tool calls and policy decisions under one run ID.
  • Hijack detections exist for task to action mismatch, high-impact calls after untrusted content and new destinations.
  • Triage asks first whether the credential was used from outside the agent's runtime.
  • The hijack playbook quarantines source content and purges memory before re-enabling the agent.
  • Scoping searches for every run that read the same content, across agents and users.
  • Identity and agent platforms exchange risk and revocation events.
  • Both playbooks are exercised at least once a year with realistic payloads.

Standards and references

Related NHI Mgmt Group resources: AI Agent Goal Hijacking Guide · AI-Driven Account Takeover Guide · AI Agent Behaviour Baselining and Anomaly Detection Guide · Prompt Guardrails vs Policy Engines for AI Agent Actions

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.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 14 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org