~/writing / field guide

Detect on Sequences, Not Anomalies

Every action the agent takes is authorized, so nothing trips an alarm. The harm is in the order, not the events. This is about detecting what a sequence of permitted actions adds up to, because the incident will not look like one.

Field guide: Securing the Agents Already in Production. Part 4 of 5. Last reviewed: September 2026.

The telemetry is in the pipeline now. You can finally query what the agents do, attribute it to a named identity, and pull it back weeks later. So you point your detection at it, and your detection finds nothing.

That is not a configuration error. It is the failure this whole series has been circling. The detection you already own was built to find the action that does not belong. Every action an agent takes belongs. The harm does not arrive as an event that stands out. It arrives as a set of events that each look exactly right.

This part is about writing detection on a different unit. The sequence and the outcome, not the anomaly.

Anomaly detection has nothing to measure against

Behavioral analytics works by learning a baseline and flagging the deviation. It works on people because a person has a stable shape. Certain hours, a few devices, a human pace. When a person’s account starts doing something a person would not, the deviation is the signal.

An agent has no such shape, or rather its shape is the thing you would have to flag. It acts continuously, at machine speed, within its permissions, and the next run looks like the last one. There is no quiet baseline that a burst of activity breaks, because the activity is the baseline. Ask the anomaly engine to find the outlier and it returns either nothing or everything. Neither is detection.

So stop looking for the smoking gun. By design, there is not one. The work is to recognize harm assembled out of actions that are individually clean.

The unit of detection is the run, not the event

In Part Three you carried over the markers that bound a run, the start and the end of one agent doing one job. Use them now. The thing you reason about is the whole run: the set of authorized actions a single identity took, in order, and what came out the other side.

A single read is nothing. A read of the records followed by a send to an external address, inside the same run, is something. Neither call is suspicious alone. The pairing is the unit. You are not scoring events. You are scoring runs.

This is also the case Part Two could not close. Constraint handled the compromised agent and the mis-scoped one. It could not handle the misaligned workflow, where every permission in the chain is legitimate and only the sequence is wrong. The guardrail stops the irreversible step it was told about. Detection is how you catch the sequences you did not think to forbid.

Detect on the combination, the volume, and the outcome

Three handles, and you have already done the groundwork for all three.

The combination. Part One put each agent’s read surface and write surface on the same line precisely so the dangerous pairing would be visible. Now write the rule on it. Read from a sensitive store and write to an external channel in one run. Escalate into a broader scope and then touch what the broader scope unlocked. Each step is allowed. The conjunction is the alert.

The volume. Not whether the agent acted, but how much. A summarizer that reads fifty rows is doing its job. One that reads fifty thousand and then exports is not, even though every single read was permitted. Threshold the aggregate across the run, not the individual call, because the individual call will always look fine.

The outcome. Detect on what happened, not on how it happened. Data crossed the boundary. Records changed at scale. Something irreversible completed. Anchor the rule to the outcome and you stop trying to enumerate every mechanism that could produce it.

The strongest signal is the agent’s own job description

Here is the rule almost nobody writes, and it is the cheapest high-value one available to you.

You do not have to define normal for agents in general. You wrote down what this specific agent is for. Part One recorded it: what it does in one plain sentence, what it reads, what it writes, what triggers it. That is a declared envelope. The detection question is not whether a run is unusual against some population. It is whether the run stayed inside the envelope you wrote down for that agent.

A ticketing assistant that reaches into the data warehouse has left its envelope. That is detectable, cheaply and with almost no false positives, because you defined the envelope in Part One and you attributed the telemetry in Parts Two and Three. Detection against an agent’s stated purpose is the highest-signal rule in this whole guide. The reason it is rare is not that it is hard. It is that almost nobody wrote the purpose down, which is why Part One came first.

Write it as code, against the schema you built

The telemetry you shaped in Part Three has a structure. Identity, action, target, outcome, run markers. Write the detections as version-controlled rules against that structure, the same way your team writes any other detection content, in whatever language your pipeline speaks. They get reviewed, tested, and changed in the open, not carried in one analyst’s head.

You are writing this ahead of the frameworks, and that is fine. ATLAS does not cover it yet. The closest entry on enterprise ATT&CK, valid accounts, bends toward this case but does not fit it, because the credential was issued on purpose and the actions were authorized. You are not waiting for the matrix to catch up. You are writing the content the matrix will describe in two years.

Update, 18 September 2026. The matrix caught up faster than I expected. MITRE ATLAS has now added specific mitigations for AI Agent Scope Drift Detection and AI Agent Authority Expansion Controls, alongside broader coverage of harmful autonomous behavior. That gives this problem a shared vocabulary that did not exist when I wrote this. The operational point here still holds: the useful signal comes from comparing what an agent actually does with the scope and purpose it was given.

The false positives are real, and the register is the answer

A naive combination rule will punish the agent that is supposed to read customers and email them. It will fire every single run, and a detection that fires every run is one the team learns to close without reading.

So the rules cannot be generic. This identity, this combination, outside this declared purpose, over this threshold, to this kind of destination. Tuned to the envelope, not to a pattern in the abstract. That is per-agent work, and it is the reason the register from Part One and the scoping from Part Two were not paperwork. Detection on agents is cheap when the population is named and bounded, and nearly impossible when it is not. Everyone who skipped the inventory arrives here and finds they cannot write a rule that means anything.

What you actually have

Every action in the incident was one the agent was cleared to take.

That was always the problem, and it is now the thing you detect on.

You stopped hunting the action that does not belong and started reading the shape of the actions that do.

A detection that fires into a void changes nothing. Someone has to be answerable for what it finds, and someone has to be able to tell the people who carry the risk what the agents did, what nearly happened, and what it would have cost. That is Part 5.


// keep reading