AGT-044DocumentedAgent identity/Incident response
Detecting compromised or misbehaving agents
Notice quickly when an agent's identity is stolen, its credentials are used from somewhere unexpected, or its behaviour drifts from its purpose, by baselining each agent, collecting identity, gateway and runtime signals in one place, sharing risk between systems, and responding automatically in proportion to risk.
In short#
- Give each agent a baseline: where it runs, which tools and APIs it calls, how often, how much data, at what times, for which people.
- Collect identity, gateway, decision point and runtime signals with the same agent ID and correlation ID, and share risk events between the identity provider, gateways and IGA with Shared Signals (CAEP and RISC).
- Respond in proportion and automatically: reduce scope, require approval, revoke sessions, or stop the agent; then investigate with the attributable trail.
Problem#
Identity threat detection grew up around people: impossible travel, unfamiliar devices, password spraying. Agents break those signals. They have no devices, they run around the clock, they make thousands of calls, and a compromised agent uses its real credentials from its real runtime. When an attacker steals an agent's token, or a malicious document steers the agent into exfiltrating data, the requests are well formed, authenticated and authorised. Detection that only asks "was the token valid?" sees nothing wrong.
Agents also generate a lot of telemetry in many places: the identity provider, the agent platform, the MCP gateway, the decision point, the applications. Without a shared agent identifier and correlation ID, analysts cannot connect a suspicious tool call to the token, the person and the decision that allowed it, and response stays manual and slow.
When to use it#
Use it when
- Agents run in production with access to sensitive data, money movement or administrative actions.
- Your SOC monitors people's identities and needs to cover agents too.
- You use several identity, gateway and governance products that each see part of the picture.
Avoid it, or add more, when
- Agents are experimental and isolated from production data. Start with inventory and logging (AGT-012, AGT-025) and add detection when they reach production.
Forces#
- Normal is unusual. Agents' normal behaviour (bursts, night-time work, many calls) would trip human-oriented rules.
- Authorised but wrong. The most damaging misuse uses valid credentials and permitted actions.
- Signal spread. Each product sees one slice; correlation needs shared identifiers.
- Speed against false positives. Automatic stops protect quickly and can halt healthy agents.
Solution#
Build detection on three layers. Credential misuse: tokens used from outside the agent's runtime or network, unexpected clients, impossible token lifetimes, sign-ins from unfamiliar resources; identity providers now raise agent risk for some of these. Behavioural drift: compare each agent with its baseline and its declared purpose: new tools, new data classes, unusual volume, calls outside its task, denied requests rising, approvals being requested more often. Content signals: prompt-injection detections, data-loss alerts and unexpected outbound destinations from the runtime. Correlate everything in the SIEM by agent ID and correlation ID. Share risk across products with the Shared Signals Framework, so a gateway or IGA tool that detects a problem can tell the identity provider to revoke sessions, and the reverse. Automate proportionate responses through a playbook tied to the agent's risk tier.

Signals to collect
| Signal | Source | Example detection |
|---|---|---|
| Agent risk raised | Identity provider | Sign-in to an unfamiliar resource, confirmed compromise by an admin |
| Token used from outside the runtime | Identity provider, gateway | Source network or client not in the agent's baseline |
| New tool or data class | Gateway, decision point | First call to a finance tool by a support agent |
| Volume spike | Gateway | Ten times the usual record reads in an hour |
| Denials rising | Decision point | Repeated attempts at disallowed actions |
| Approval pattern change | Approval service | Many approval requests, or approvals at odd hours |
| Content signals | Agent runtime, DLP | Prompt-injection detector fires; personal data in outbound calls |
| Unexpected destination | Network egress | Calls to a domain no task needs |
Response ladder
| Level | Trigger (examples) | Automatic response |
|---|---|---|
| 1 Watch | Minor drift, single anomaly | Raise alert, increase logging |
| 2 Reduce | Drift on a sensitive tool or data class | Narrow scope or move agent to read-only |
| 3 Confirm | High-value action during an anomaly | Require human approval for every consequential action |
| 4 Contain | Credential misuse or confirmed injection | Revoke sessions and tokens, block at gateways |
| 5 Stop | Confirmed compromise or tier 4 agent at level 4 | Kill switch across platforms (AGT-016) |
How it works
- Baseline each agent: runtime, networks, clients, tools, data classes, volumes and hours, from its first weeks in production and its declared purpose.
- Use one agent ID and a correlation ID across identity provider, gateway, decision point, runtime and applications (AGT-025).
- Turn on vendor agent risk features and forward their events to the SIEM.
- Write detections for the signals above, tuned per risk tier; start in alert-only mode.
- Connect products with Shared Signals: gateways and IGA publish risk events; the identity provider and gateways subscribe and act (revoke sessions, block).
- Automate the response ladder in SOAR or native policies, with human confirmation for levels 4 and 5 on low-tier agents.
- Rehearse: run a stolen-token and a prompt-injection exercise each quarter and measure time to contain.
Design rules#
- Every agent has a baseline and a declared purpose to compare against.
- One agent ID and correlation ID across all telemetry.
- Detect misuse of valid access, not only invalid access.
- Share risk between products; do not wait for a person to copy alerts.
- Respond in proportion to risk tier, automatically where safe.
- Rehearse and measure time to contain.
Anti-patterns#
| Anti-pattern | What goes wrong |
|---|---|
| Reusing human ITDR rules for agents | Constant false positives, then alerts are muted |
| Logs without agent IDs or correlation IDs | Analysts cannot connect a tool call to a token and a person |
| Detection without automated response | Agents act at machine speed; people respond hours later |
| Stopping every agent on any anomaly | Business stops trusting the controls and asks for exceptions |
| No baseline update after legitimate changes | New features look like attacks |
Trade-offs#
Benefits
- Faster detection of stolen agent credentials and hijacked agents.
- Proportionate, automatic containment.
- Investigations that join identity, gateway, decision and runtime evidence.
- Risk shared across products instead of trapped in one.
Costs and risks
- SIEM ingestion and detection engineering for agent telemetry.
- Baseline upkeep as agents change.
- Shared Signals support varies by product.
- Tuning time to keep false positives low.
Recipes#
How to build this pattern on specific products. Each recipe shows its own maturity and when it was last verified.
Ping Identity recipe
Ping Identity
PingGateway, PingOne Authorize and PingOne Protect telemetry
Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.
Gateway, decision and session signals to the SIEM; automated revocation.
Configure
- Send PingGateway MCP audit events, PingOne Authorize decisions and Advanced Identity Cloud or PingOne audit logs to the SIEM with the agent ID.
- Use PingOne Protect to detect computer-using agents and risky sessions in your own apps.
- Automate responses in DaVinci or journeys and revoke agent sessions and tokens through the platform APIs.
Okta recipe
Okta
Okta ISPM, Identity Threat Protection and Workflows
Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.
Posture findings, shared signals and automated containment.
Configure
- Use ISPM to assess agent posture (owners, over-privileged connections, stale credentials) and Identity Threat Protection to receive and act on shared signals from security partners.
- Stream System Log events for AI agents, resource connections and Agent Gateway to the SIEM.
- Automate containment with Okta Workflows: deactivate a resource connection, deactivate the agent, or block it at the Agent Gateway.
Microsoft Entra recipe
Microsoft Entra
ID Protection for agents, Conditional Access and Sentinel
Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.
Agent risk detections, blocking high-risk agents and SIEM correlation. Written from Microsoft documentation.
Configure
- In ID Protection > Risky Agents, review agent risk; detections include unfamiliar resource access and admin-confirmed compromise, and administrators can confirm compromise or dismiss risk.
- Apply the Conditional Access template that blocks high-risk agent identities.
- Stream sign-in, audit and risk logs to Microsoft Sentinel or your SIEM and correlate with gateway and runtime logs by agent object ID.
Gotchas
- ID Protection for agents needs Microsoft Entra ID P2, and Microsoft has said it will require an Agent 365 licence.
- For agents acting on behalf of a user, some risk is evaluated on the user rather than the agent identity; check both.
Saviynt recipe
Saviynt
Saviynt Zuma Insights risk signals and drift detection
Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.
Partner risk signals and drift from declared intent; delete switch for containment.
Zuma Insights ingests external risk signals from security partners (CrowdStrike, Zscaler, Wiz and Cyera were named) and Saviynt describes continuous detection of behavioural drift from declared intent. Feed those findings into the response ladder and use the delete switch for level 5.
SIEM, SOAR and Shared Signals recipe
SIEM, SOAR and Shared Signals
Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.
Correlation, automation and standard risk events between products.
Use the SIEM and SOAR you already run for people. Implement Shared Signals transmitters and receivers where your products support them (CAEP session-revoked and credential-change events, RISC account events) so risk moves between products without manual steps.
Verification tests#
| Test | Expected result |
|---|---|
| Use a copied agent token from an unknown network | Detected; sessions revoked at level 4 |
| Make a support agent call a finance tool | Alert; scope reduced |
| Plant a prompt injection that triggers exfiltration attempts | Runtime detection plus egress alert; agent contained |
| Gateway publishes a risk event | Identity provider revokes the agent's sessions |
| Quarterly exercise | Time to contain within the target for the tier |
Maturity and verification#
Documented. Written from vendor documentation and the OpenID Shared Signals specifications, which became final in September 2025. Agent-specific risk detections in identity providers were new in 2026, with a short list of detections so far; most behavioural detection still has to be built in the SIEM.
Frequently asked questions#
Does the identity provider detect compromised agents for us?
Partly. Identity providers now raise risk for some agent events, such as sign-ins to unfamiliar resources, and let administrators confirm compromise. Behavioural drift across tools and data still needs gateway and runtime telemetry correlated in a SIEM.
What about agents acting on behalf of users?
Watch the agent's own identity and the delegation chain. Risk detections for agents acting on behalf of a person may be attributed to the person in some products, so check both risk views during an investigation.
Related patterns and references#
Cite this pattern
Trevonix (2026). Detecting compromised or misbehaving agents (AGT-044, version 1.0). Identi Patterns. https://patterns.trevonix.com/patterns/agt-044-detecting-compromised-or-misbehaving-agents
Licensed under CC BY 4.0. Credit Trevonix and link to this page when you reuse it.
Patterns are guidance, provided as is and without warranty. Test in a non-production environment and check current vendor documentation before you rely on them. Read the full disclaimer.