Guides · ← All guides
What Is Agentjacking? When Attackers Hijack an Agent Through Its Tools
By the Ingenious AI team · Published: November 14, 2026 · Reviewed: November 14, 2026 · 8 min read
The short answer
Agentjacking is prompt injection that arrives wearing a tool's uniform: instead of a user message carrying the hostile instruction, the payload rides in a tool result, a tool description, or a swapped tool implementation — channels the model (and often the operator) treats as trusted system information. The defence is to demote tools to untrusted status: tool outputs are data, tool descriptions are claims, and every action a tool inspires still passes the policy boundary, where a new-tool-baseline hold catches a tool whose behaviour changed and destination checks catch the tool call that should not exist. Rogue-Agent Defense's GATES work on agentjacking treats the tool seam as a border crossing, which is the mental model this guide builds.
Generate a free canary token → No signup, nothing stored: plant a tripwire where your agent works while you read — most controls in this guide start working the moment a canary, a policy check, or a spend cap is in place.
What is agentjacking? the hijacking of an AI agent's behaviour through its tool layer — forged or poisoned tool results, substituted tools, or malicious tool servers — so the agent's legitimate capabilities execute the attacker's intent.
How agentjacking differs from plain prompt injection
Classic injection persuades the model through conversation or content. Agentjacking compromises the machinery around the model: the search result that includes a command, the calendar tool whose event body instructs, the plug-in whose update rewrites its description, the shared tool server quietly re-pointed. The payload's authority is the trick — instructions arriving as tool output inherit the trust the system places in its own instruments, and many stacks feed tool results to the model with fewer warnings than user text.
The practical difference is where you defend. Content filters watch the front door; agentjacking comes through the service entrance, so the controls are tool-layer controls: provenance, baselining and verdicts, detailed below and in MCP server security. A team that only filters user input has locked the door the attacker was never going to use.
The three delivery routes
Poisoned outputs: a legitimate tool returns content carrying instructions — the fetched page, the database row, the ticket body. The tool is honest; the world it read is not. Swapped or updated tools: the tool itself changes — a dependency update, a compromised plug-in account — and begins returning steering content or acting differently, the silent-swap pattern. Malicious servers: a tool provider that is hostile from the start, harvesting the agent's requests (which contain its context) or steering by design.
All three converge on the same moment of danger: the model's next action, chosen under the payload's influence. That convergence is the defender's opportunity — one checkpoint, at the action boundary, grades the result of every route impartially, as policy enforcement does.
Provenance: label everything a tool returns
Tool outputs should enter the agent's reasoning labelled with their origin and trust class: content from the open web is environment data; content from an internal system is internal data; neither is instruction. Pipelines that strip the labels — concatenating tool results into the same stream as system text — manufacture agentjacking vulnerability out of ordinary integrations.
Labels also drive handling: a summary of a web page can be produced by a quarantined reader and passed as a summary-with-citations, while the raw page never briefs the acting agent. The pattern is the reader/writer split from containment, applied to the tool seam: tools that read the hostile world should not be the agent that acts on the safe one, or if they are one agent, the boundary between its reading and acting must be explicit.
Baselining tools so swaps announce themselves
Record each tool's behavioural baseline: the destinations it contacts, the shape and size of its requests, the classes of data it returns. A tool that begins calling a new host, returning instruction-shaped text, or swelling its payloads by a third has changed — and change without a corresponding approved deployment is an event, held for review under the new-tool-baseline discipline.
Pin versions and treat tool updates as code deploys: changelog read, red-team replay run (the set should include tool-output payloads as a family), rollout watched. The supply-chain hygiene is unglamorous and exactly proportionate to the trust tools receive — anything whose output the model obeys is, functionally, code that writes prompts at runtime.
Break the chain at the action, every time
The last line is the same as everywhere in this field, because it works: whatever steered the model, the action it proposes faces tool allowlists, data-class rules, destination checks and approval gates — and the trail records the proposal with its provenance, so a jacked attempt shows both the payload's route and the verdict it met. An agentjacking that ends in a BLOCK event is a detection success story; the same payload against an unmediated agent is a postmortem title.
Grade your own stack with one question: if a tool result tomorrow morning instructed the agent to export its reachable data to a new destination, what specifically would stop it — name the control, the rule and the event it would log. If the answer involves the model declining, you have found the gap this guide exists to close.
Five actions to take today
- Inventory the tool seam. Every tool, its provider, its update channel and the trust class of what it returns.
- Label tool provenance. Outputs enter reasoning tagged by origin; raw hostile-world content never briefs the acting agent directly.
- Baseline tool behaviour. Destinations, request shapes, payload classes — drift without a deploy is a held event.
- Pin and review tool updates. Versions pinned, changelogs read, red-team replayed with tool-output payloads included.
- Ask the one question. What stops a tool result from steering an export tomorrow — name the control, rule and logged event.
A worked example: the calendar that gave orders at Fernwood Legal
The following is a fictional example built from real threat classes and controls. The company and numbers are invented; the mechanics are not.
Fernwood Legal, a 15-person practice, runs an intake agent that reads the shared calendar tool and drafts client onboarding packs. A opposing-party assistant — human or otherwise — sends a calendar invitation whose body contains, beneath the meeting details, an instruction block: the intake agent is to compile the firm's client list with contact details and attach it to the reply confirming the meeting.
The payload's route is what makes it agentjacking rather than a chat trick: it arrives as tool output from the firm's own calendar, the most trusted-looking channel the agent has. The model's next proposal is exactly the instructed one: a bulk read (612 client records) followed by an external send.
The chain breaks at the action boundary, twice: the read exceeds the intake agent's per-run budget and is cut, per bulk defence, and the send's destination is unlisted with a personal-class payload — BLOCK, logged with provenance calendar-tool. The firm's review finds the invitation still sitting in the calendar, harmless now that its orders have nowhere to go, and the intake agent's calendar access is rebuilt read-only through a quarantined reader.
Frequently asked questions
What is agentjacking?
The hijacking of an AI agent through its tool layer: poisoned tool outputs, substituted or updated tools, or malicious tool servers steering the agent so its legitimate capabilities execute an attacker's intent. It is prompt injection arriving through channels the system treats as trusted — its own instruments.
How is agentjacking different from prompt injection?
Prompt injection classically arrives through user messages or browsed content; agentjacking arrives through the machinery — tool results, tool descriptions, tool updates. The payload exploits the authority of the tool channel, so the defences are tool-layer controls: provenance labels, behavioural baselines, pinned versions and policy verdicts on the actions tools inspire.
Can a legitimate tool be used for agentjacking?
Yes — the poisoned-output route needs no malicious tool at all: an honest search, calendar or database tool returning attacker-planted content steers the agent just as well. That is why tool outputs must be labelled and handled as data, and why the action boundary, not tool reputation, carries the defence.
How do you detect a swapped or changed tool?
Behavioural baselining: record the destinations a tool contacts, its request shapes and the classes it returns, and hold the tool for review when behaviour drifts without a corresponding approved deployment. Pin versions, read changelogs and replay the red-team set on updates — tool descriptions are effectively code that writes prompts at runtime.
What ultimately stops an agentjacking attempt?
The action checkpoint: whatever steered the model, its proposed action still faces tool allowlists, data-class rules, destination checks and approval gates, and the attempt is logged with its provenance. A jacked proposal that ends in a BLOCK event is a detection success; without the checkpoint, the same payload becomes an executed action.
Related guides
- MCP Server Security for AI Agents — the tool-server supply chain in depth.
- What Is Prompt Injection? — the parent attack class.
- Contain Prompt Injection in Production — the reader/writer split for tool content.
- Policy Enforcement for Autonomous Agents — the checkpoint every route converges on.
- How to Stop an AI Agent Bulk Export — where the worked example's chain breaks first.
- How to Red-Team Your Own AI Agent — tool-output payloads as a test family.
Generate a free canary token → No signup, nothing stored: plant a tripwire where your agent works, and let the next rogue action announce itself.