Everything we have written this year about securing agents (identity, least privilege, policy enforcement, approvals, sandboxing) aims to prevent harm. Those controls are essential. They are also incomplete: prompt injection still has no complete fix, agents make mistakes, and configurations drift.
Security teams have been here before. Endpoint protection was never perfect, so we added endpoint detection and response. Cloud configurations drift, so we monitor the control plane. Agents need the same: runtime security that watches what they actually do.
Why agents need runtime monitoring
- Manipulation is probabilistic. An attack that fails 95 times may succeed on the 96th.
- Behaviour changes with context. New documents, new users and new model versions change what an agent does.
- Actions are fast and numerous. A misbehaving agent can do a lot of damage in minutes.
- Humans are not always watching. Scheduled and event-driven agents act without anyone present.
Telemetry: what to capture
Runtime security starts with structured, complete telemetry for every agent run. Useful fields include:
| Event | Key fields |
|---|---|
| Run start | agent ID and version, trigger, delegating principal, task |
| Model call | model, prompt hash and size, token counts, latency |
| Tool call | tool, server, arguments (redacted where needed), result size, duration |
| Policy decision | action, resource, decision (allow, deny, approval), rule |
| Approval | approver, what was shown, decision, time taken |
| Data flow | source classification, destination, volume |
| Run end | outcome, errors, cost |
Emit these as OpenTelemetry traces or structured logs, correlated by run ID, and ship them to your SIEM alongside identity and application logs.
Detections that work
Baseline deviations per agent. Agents are narrower than humans, so their normal behaviour is predictable. Alert on:
- first use of a tool the agent has never used,
- access to resources or data classifications outside its usual range,
- unusual volumes of reads, writes or outbound messages,
- new outbound destinations, and
- runs far longer or more expensive than normal.
Dangerous data flows. Sensitive data read in a run followed by an outbound action (email, HTTP request, message, public repository) to a new or external destination.
Policy denials. A burst of denied actions often means the agent is being steered somewhere it should not go, even if every attempt was blocked.
Injection indicators. Instruction-like patterns in retrieved content or tool results, and sudden changes in the agent's stated goal mid-run.
Approval anomalies. Approvals granted in seconds for high-risk actions, or unusually high approval volumes for one reviewer (fatigue).
An illustrative detection in a SIEM query language:
-- Sensitive read followed by external send within the same agent run
SELECT run_id, agent_id, principal,
MIN(ts) FILTER (WHERE event = 'tool_call' AND data_class IN ('confidential','restricted')) AS sensitive_read_at,
MIN(ts) FILTER (WHERE event = 'tool_call' AND tool IN ('send_email','http_post','post_message')
AND destination_domain NOT IN (SELECT domain FROM approved_domains)) AS external_send_at
FROM agent_events
WHERE ts > now() - interval '1 hour'
GROUP BY run_id, agent_id, principal
HAVING MIN(ts) FILTER (WHERE event = 'tool_call' AND data_class IN ('confidential','restricted'))
< MIN(ts) FILTER (WHERE event = 'tool_call' AND tool IN ('send_email','http_post','post_message')
AND destination_domain NOT IN (SELECT domain FROM approved_domains));Inline runtime controls
Some controls run in the execution path rather than after the fact:
- Runtime policy engines that evaluate each tool call against rules and data-flow policies.
- Circuit breakers that pause an agent automatically after too many denials, errors or unusual actions.
- Budget guards that stop runs exceeding time, step or cost limits.
- Output scanners that check outbound content for secrets and sensitive data before it leaves.
flowchart LR
A[Agent proposes action] --> P{Runtime policy<br/>& data-flow check}
P -->|allow| X[Execute]
P -->|deny| D[Deny + log]
D --> CB{Denials > threshold?}
CB -->|yes| Pause[Pause agent<br/>alert SOC]
X --> T[(Telemetry)]
D --> T
T --> SIEM[SIEM detections]
SIEM --> SOC[SOC triage]Response playbooks
When an agent alert fires, the SOC needs a clear playbook:
- Contain: pause the agent (or the specific deployment), revoke its active delegated tokens, and block affected outbound destinations.
- Preserve: snapshot traces, prompts, retrieved content, memory state and tool results for the affected runs.
- Scope: identify which runs, users and data were affected, and whether similar manipulation occurred elsewhere.
- Find the entry point: which input carried the manipulation (a document, email, web page or tool description)? Remove or quarantine it.
- Remediate: fix the underlying control gap, such as a scope, a policy rule or an approval requirement.
- Learn: add the scenario to evaluation and red-team suites, and tune detections.
Organisational readiness
- Put agents in the SOC's asset inventory, with owners and criticality.
- Give analysts access to agent traces, not just summary logs.
- Rehearse an agent compromise in a tabletop exercise.
- Agree who has authority to pause business-critical agents.
The bottom line
Prevention reduces how often agents are manipulated or go wrong. Runtime security determines how long it lasts and how much damage it does. Instrument every agent, baseline its behaviour, detect deviations and dangerous data flows, and give the SOC a playbook to act on. Agents will become a normal part of the attack surface; they should become a normal part of the SOC's view too.
Our managed detection and response service extends 24×7 monitoring to AI agents, and our SOC design team builds the telemetry and playbooks to support them.