Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Agent hijacking is an attack in which instructions hidden in the content an AI agent reads redirect it into performing the attacker’s actions with the agent’s own credentials and tools.

What Is Agent Hijacking?
Agent hijacking happens when an attacker plants instructions in content that an AI agent processes—a web page, a support ticket, a pull request, a calendar invitation, a PDF attachment—and the agent carries those instructions out as if they came from its owner. Nobody steals a password and nobody exploits a memory corruption bug. The agent is simply persuaded, and because it is already authenticated to the mailbox, the repository, or the ticketing system, its actions look entirely legitimate in the logs.
A chatbot that answers questions can be manipulated into saying something embarrassing. An agent plans a sequence of steps, calls tools, and acts on the results without a person approving each move, so manipulation converts directly into actions: a file is sent, a record is changed, a payment is scheduled. This is why indirect prompt injection and agent hijacking are usually discussed together. Injection is the delivery mechanism; hijacking is what the attacker does with it once the model can reach real systems. The US AI Safety Institute published a technical evaluation of agent hijacking in January 2025 that made the same point from a measurement angle: agents that scored well on helpfulness benchmarks still followed injected instructions in a meaningful share of trials, and success rates varied enormously with how the evaluation was constructed.
Researchers at Invariant Labs demonstrated in 2025 that an agent connected to a GitHub integration could be led by a public issue into leaking the contents of private repositories into a public pull request. The pattern generalises: data exfiltration through any channel the agent can write to, unauthorised transactions where a payment or procurement tool is connected, silent changes to configuration or access rules, and poisoned long-term memory, where the injected instruction is stored in the agent’s own notes and keeps influencing later sessions long after the original page is gone. Because the agent holds a valid session, detection usually depends on noticing an unusual pattern of legitimate API calls rather than a failed authentication.
No filter reliably separates instructions from data inside a language model, so the design goal is to keep a successful hijack cheap. Scope every credential the agent uses to the narrowest task that justifies it, and prefer short-lived tokens issued per session over standing access. Split read and write: an agent that researches should not share an identity with one that commits code or sends mail. Require explicit human approval for actions that move money, change permissions, publish externally, or delete data. Put an allow-list in front of outbound network calls so exfiltration has nowhere to go, and record every tool invocation with its arguments so an investigation has something to reconstruct. Where agents hold memory, treat writes to that memory as privileged and expire them.
Agent behaviour needs adversarial testing, not a functional test plan. The OWASP Agentic Security Initiative’s threat and mitigation guidance, published in February 2025, gives a workable list of scenarios, and MITRE ATLAS maps the techniques to adversary behaviour. Under UK GDPR, an agent that sends personal data to an attacker-controlled endpoint is a personal data breach, with the usual 72-hour notification duty to the ICO and the accountability expectations that come with it, so agent deployments belong in your record of processing and your risk assessment rather than in a sandbox nobody reviews. At Privia Security, we probe agent workflows end to end as part of our AI Penetration Test Services.
They are related but not identical. Prompt injection is the technique of smuggling instructions into text a model processes. Agent hijacking describes the outcome when that technique lands on a system that can act: the agent uses its tools and credentials to do what the attacker wants. Every hijack starts with injection, but an injection against a read-only chatbot is not a hijack.
Approval helps if it is meaningful. Asking a user to confirm every step produces fatigue and rubber-stamping, so target approval at the small number of actions that are irreversible or externally visible, and show the user the actual parameters rather than a summary written by the model. Combine it with outbound allow-lists, because many hijacks exfiltrate data through actions that look routine.
Look for deviation rather than failure. Log every tool call with its arguments, baseline what normal task sequences look like, and alert on an agent that suddenly reads far more records than usual, writes to a destination it has never used, or produces output containing encoded blobs. Correlating agent identity activity in your SIEM with the task that triggered it is the most practical starting point.
They need fewer, but not none. A read-only agent can still be steered into retrieving data the requesting user is not entitled to, summarising it misleadingly, or emitting output that causes cross-site scripting in the interface rendering it. Enforce the requesting user’s permissions at retrieval time rather than at display time, and treat agent output as untrusted input to whatever consumes it next.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.