// threat detection

Agentic attacks: how to detect and respond to them

Attackers have started handing whole intrusions to AI agents that plan, run real tools and keep going until they reach a goal. You will not win this by chasing each new tool. The durable move is to catch the behaviour they all share, and to have a response ready for an adversary that works at machine speed.

By Saleem Yousaf, Cloud and Cyber Security Architect  ·  21 November 2026  ·  12 min read

For most of the last decade an intrusion had a person at the keyboard. They were fast or slow, skilled or not, but they were one operator making one decision at a time. That assumption is now breaking. A class of open-source tooling has appeared that hands the keyboard to an AI agent: you give it a target and a goal, and it plans the steps, runs real attack tools, reads the output, decides what to do next, and carries on without waiting for a human. Some of these frameworks run a team of agents at once, each in its own container.

Security vendors have begun cataloguing them. ThreatDefence maintains an open agentic attack detections repository that tracks eight so far, including ARTEX and its renamed AntiFox fork, Cairn, PentAGI, HexStrike, CyberStrikeAI, Strix, Hermes Agent and Agent Zero, each studied from its source code and the public reporting on its use. The detail of who used which tool against whom sits after my own reliable knowledge of the field, so I will point at that reporting rather than restate it as settled fact. What matters for a defender is the shape of the problem, and that is clear enough to act on.

Many tools, a few behaviours, the telemetry you already have. Tap to enlarge.
Why signatures lose this race

Chasing the tool is a treadmill

The instinct is to write a detection for each framework: its user agents, its file paths, its command lines. Do that and you sign up for a treadmill, for three reasons.

First, volume. Eight frameworks today, more next quarter, most of them a weekend fork away from the last one. Second, renaming. ARTEX became AntiFox with the same code under a new name, and any indicator tied to the old label went stale the day that happened. Third, and most important, the model is swappable. These frameworks are mostly a planning loop wrapped around whatever large language model you point them at, a Chinese model today, a Western one tomorrow, a local one next week. Fingerprint the model and you catch nothing when it changes.

The thing that does not change is the work. Whatever planner is driving, an intrusion still has to enumerate identities, spray credentials, find a path, reach the data. An agent does that work faster and more repetitively than a person, and that very regularity is what gives it away.

Detect the behaviour, not the tool

What they all do, and where you see it

Group the tell-tale behaviours by the telemetry you already collect. None of this needs a new sensor. It needs you to look at the logs you have with the agent in mind.

On the endpoint

An agent CLI running with its approval prompt turned off
Qwen Code, Kimi CLI, Claude Code, Codex, Pi and the like have a mode that stops asking the human before each action. A coding assistant launched in that mode, then spawning scanners, network tools and credential utilities, is not a developer at work. Watch process creation for the agent binary as a parent of attack tooling.
A web or database service spawning a shell
An agent that lands through a web application behaves like any web shell, the service account suddenly has children it never had before. Old signal, still the fastest one.
Scripts written into web roots, config and backup files read in bulk
Agents are thorough to a fault. They hoover configuration and backup files and drop helpers into web directories far more systematically than a human in a hurry.

In network and DNS

A server calling out to a model API
The agent has to talk to its brain. A production server making calls to DeepSeek, Qwen, GLM, Kimi, MiniMax, OpenRouter or any model gateway is almost never doing legitimate work. This is one of the strongest single signals, and it survives a change of tool.
Lookups to out-of-band interaction domains
When an agent tests for blind injection, SSRF or XXE it uses callback services, interactsh oast.*, Burp Collaborator, dnslog.cn. A server resolving those domains has had a payload run on it.
One target probed through hundreds of rotating proxy addresses
Agents lean on proxy pools, so the same application gets hit from a wide spread of addresses in a pattern no single human session produces. Do not block one address and call it done.
A server calling back to the address that was just probing it
Reconnaissance from an address, then a connection from your estate back to that same address, is a short and high-value window.

In identity and Active Directory

Kerberos user enumeration, then Kerberoasting, DCSync and WinRM or SMB fan-out from one source
The classic post-foothold sequence, run end to end at machine speed from a single origin, is the agent working a domain the way a checklist would.

In the cloud

Credentials used at machine speed
Several identities checked from one address in quick succession, bulk reads of user data, instance role keys suddenly used from outside the instance. In AWS, Azure, M365 and Okta the pattern is the same: an agent testing the blast radius of what it stole, far faster than a person would.
The pointEach of these is a behaviour, not a tool. One rule for "a server is calling a model API" catches every framework that needs a brain, including the one that ships next month. That is why the behaviour layer is where your effort pays back, and why the ThreatDefence repository keeps those cross-framework rules in their own folder, separate from the per-tool fingerprints.
Turn the signal into coverage

You already have the telemetry

Map the behaviours above to what you run. Endpoint process creation comes from your EDR or Sysmon. The model-API and out-of-band and proxy signals live in DNS logs, netflow and your proxy or firewall. The identity sequence is in your domain controller and sign-in logs. The cloud patterns are in CloudTrail, Azure and M365 audit and Okta system log. The ThreatDefence set ships the same detections as Sigma, Microsoft Sentinel analytics and KQL hunts, Splunk, Elastic, Suricata and Zeek, so whichever stack you run, the behaviour rules convert into it. Start with the model-API hunt and the auto-approve agent hunt. They are the highest signal and the hardest for an attacker to avoid.

DisciplineTreat address and domain indicators as perishable. Cloud and VPS addresses get reassigned, and the ThreatDefence feed puts a 180-day review date on every one for that reason. Baseline the medium-confidence rules before you alert on them, and remember the maintainer's own warning: no rule in that set has been tested against a captured intrusion yet, so each is a lead to validate on your own data, not a verdict.
When you find one

Responding to an adversary that does not pause

The hard part of an agentic intrusion is not that it is cleverer than a human one. It is that it is faster and more complete. By the time an analyst opens the ticket, the agent may have tried fifty things, touched a dozen identities and planted two ways back in. Your response has to assume breadth and move quickly, which usually means automating the first containment step rather than waiting for a person to click.

Contain, and assume it moved wide

Capture what the agent tells you

An agent leaves a better account of itself than a human intruder does. Its logs, its prompts, its configuration and its tool output record what it was told to achieve and everything it tried. Preserve the container layers, the agent's working directory, /tmp and the web roots before you wipe. That evidence is the fastest way to scope the incident, because the agent has effectively written its own after-action report.

Eradicate and recover

A worked example

A sanctioned agent in a Microsoft estate

The fair objection to all of this is that not every agent is hostile. Your own business is about to run plenty of benign ones, so does the same thinking help there? It does, it just runs in reverse. Take a concrete build. A person submits a task through Azure API Management. The call crosses an Azure Firewall into an app subnet, where a Durable Functions app orchestrates the run: it fetches from an approved web search and calls one approved Azure OpenAI deployment, then writes the result as JSON to a storage account for a human to check and for downstream systems to use. The runtime is ephemeral, it exists only for the length of the run.

Sanctioned agent architecture in Azure: a human request crosses API Management and Azure Firewall into a Durable Functions app that calls the approved model and a web search, then writes JSON to a storage account for human review // external and internet side // app subnet AZURE FIREWALL Human request a task to run, sent to the API Azure API Management authenticates, throttles, logs it Azure OpenAI the one approved deployment Web search untrusted content enters here Durable Functions app the agent runtime, ephemeral per run Orchestrator, plans and runs the steps Web search activity Call model activity Storage account (blob) results.json lands here Human review, then downstream 1 request 2 model call 3 web fetch 4 writes JSON 5 human check
The sanctioned path. The firewall is the one place every hop crosses, inbound from the caller and outbound to the model and the web, which makes it your richest single vantage point.

For an attacker-run agent, a server calling a model API is rare and therefore suspicious. Here it is the normal case, so that signal inverts. You baseline this agent's legitimate behaviour, which is small and fully known, and you alert on anything outside it. Its honest footprint is four actions: take the request, call the one approved model, fetch from the approved search path, write one JSON. Everything else is a deviation worth a look.

Detection and response map: what to watch at API Management, the firewall, the runtime identity and the storage gate, and what to do when a run leaves its envelope // detection and response map INGRESS API Management Caller and task Rate and quota Streams to Sentinel EGRESS CHOKE Azure Firewall Model + search only Wrong model shows Out-of-band lookups RUNTIME Functions + identity Identity, two jobs Entra sign-in logs No shell, no bulk reads Bounded lifetime OUTPUT GATE Storage (blob) Schema validation Provenance per field Human gate first RESPONSE · WHEN A RUN LEAVES ITS ENVELOPE Kill the orchestration, block egress for that identity, revoke the managed identity, then quarantine the blob and anything downstream that read it.
Where the signals sit. Untrusted web content enters at the search step, which is the injection origin, and the storage write is the gate where the JSON is validated before anything trusts it.

What good looks like, and what breaks it

A call to any model but the approved one
The function app should reach a single Azure OpenAI deployment and nothing else. A call from its identity to another gateway, or to a different deployment, stands out in the Azure Firewall egress logs and the Azure OpenAI diagnostic logs. This is the model-API signal from earlier, narrowed to one allowed destination.
The agent reaching a domain its task never needs
The web search returns untrusted content, and a page can carry instructions. If a fetched page steers the agent into resolving an interactsh or dnslog callback, or calling back to the site that served it, the firewall and DNS logs show a lookup the task has no reason to make. In this design that is your clearest sign of a prompt injection in progress.
The runtime or its identity doing a second job
The function app spawning a shell, reading files beyond its task, or the managed identity used from anywhere other than the running instance. Microsoft Defender for Cloud and the Entra sign-in logs carry it. The identity has two jobs, so a third is the tell.
An orchestration that loops or outlives its run
A bounded ephemeral job that suddenly runs long, retries in a loop or re-spawns is off its own pattern. The Durable Functions status and the Application Insights traces show the shape of a normal run, so a long tail is easy to flag.
The pointBecause the agent's legitimate behaviour is this small, the allow-list is short and the deviations are obvious. You are not hunting a tool, you are watching one known-good envelope and alerting when a run steps outside it. Every box in the diagram is somewhere you already keep the log.

The risk the envelope does not catch

There are two ways an injection plays out here. The first steers the agent off its task, and the envelope above catches it. The second changes nothing about the agent's behaviour, it only poisons the content of the JSON, so the agent performs its four actions perfectly and hands a human a file with false data in it. The envelope will not see that. The control for it lives at the storage write: validate the JSON against a strict schema, attach provenance so each value can be traced to the page it came from, and treat the human check as a gate that must pass before anything downstream reads the blob, not a courtesy after the fact. The agent is faster and more complete than the reviewer, so a poisoned file can be consumed downstream before the person opens it unless that gate is enforced.

Responding in this estate

Prove it before you need it

Validate with simulation

A detection you have not fired is a hypothesis, and a runbook you have not run is a document. The way to trust either is to emulate the behaviours safely and watch what happens. Stand up a benign agent loop that calls a model API from a server, run a scripted credential check at machine speed against a test tenant, resolve an out-of-band domain from a host that should never do it. If your model-API hunt, your machine-speed-credential rule and your isolation playbook all fire and run, you have coverage. If they do not, you found the gap in a drill instead of an incident. In the Azure example above, that is a test page carrying a benign injection, then a check that the firewall alert fires, the orchestration is torn down, and a poisoned value is caught at the storage gate rather than downstream. This is the whole premise of breach and attack simulation, and it is exactly what I build toward with BreachForge: validate the behaviour, not the brand of tool, because the brand will change and the behaviour will not.

Sources and credit

The framework catalogue, the cross-framework behaviour rules and the indicator feed described here are the work of ThreatDefence, published openly as the agentic-attack-detections repository under an MIT licence, and built from each tool's source code and the public reporting the repository cites. The attributions and campaign details in that reporting post-date my own reliable knowledge, so I have kept this article on the durable detection and response concepts and credited the source for the specifics. A match is a lead, not a verdict, and absence of a match is not absence of compromise.

Behaviour map, full size