AGT-044DocumentedAgent identityIncident 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.

  • EffortHigh
  • Version1.0
  • Reviewed
  • Updated
  • AuthorsTrevonix Innovation

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.

Diagram. Left: four signal sources for one agent: the identity provider (agent risk, sign-ins), the MCP or API gateway (tools called, volumes, denied calls), the decision point (denials, approvals requested), and the agent runtime (prompt-injection detections, outbound destinations, data-loss alerts
Signals from identity, gateway, decision point and runtime meet in the SIEM; shared signals and playbooks respond in proportion.

Signals to collect

SignalSourceExample detection
Agent risk raisedIdentity providerSign-in to an unfamiliar resource, confirmed compromise by an admin
Token used from outside the runtimeIdentity provider, gatewaySource network or client not in the agent's baseline
New tool or data classGateway, decision pointFirst call to a finance tool by a support agent
Volume spikeGatewayTen times the usual record reads in an hour
Denials risingDecision pointRepeated attempts at disallowed actions
Approval pattern changeApproval serviceMany approval requests, or approvals at odd hours
Content signalsAgent runtime, DLPPrompt-injection detector fires; personal data in outbound calls
Unexpected destinationNetwork egressCalls to a domain no task needs

Response ladder

LevelTrigger (examples)Automatic response
1 WatchMinor drift, single anomalyRaise alert, increase logging
2 ReduceDrift on a sensitive tool or data classNarrow scope or move agent to read-only
3 ConfirmHigh-value action during an anomalyRequire human approval for every consequential action
4 ContainCredential misuse or confirmed injectionRevoke sessions and tokens, block at gateways
5 StopConfirmed compromise or tier 4 agent at level 4Kill switch across platforms (AGT-016)

How it works

  1. Baseline each agent: runtime, networks, clients, tools, data classes, volumes and hours, from its first weeks in production and its declared purpose.
  2. Use one agent ID and a correlation ID across identity provider, gateway, decision point, runtime and applications (AGT-025).
  3. Turn on vendor agent risk features and forward their events to the SIEM.
  4. Write detections for the signals above, tuned per risk tier; start in alert-only mode.
  5. Connect products with Shared Signals: gateways and IGA publish risk events; the identity provider and gateways subscribe and act (revoke sessions, block).
  6. Automate the response ladder in SOAR or native policies, with human confirmation for levels 4 and 5 on low-tier agents.
  7. Rehearse: run a stolen-token and a prompt-injection exercise each quarter and measure time to contain.

Design rules#

  1. Every agent has a baseline and a declared purpose to compare against.
  2. One agent ID and correlation ID across all telemetry.
  3. Detect misuse of valid access, not only invalid access.
  4. Share risk between products; do not wait for a person to copy alerts.
  5. Respond in proportion to risk tier, automatically where safe.
  6. Rehearse and measure time to contain.

Anti-patterns#

Anti-patternWhat goes wrong
Reusing human ITDR rules for agentsConstant false positives, then alerts are muted
Logs without agent IDs or correlation IDsAnalysts cannot connect a tool call to a token and a person
Detection without automated responseAgents act at machine speed; people respond hours later
Stopping every agent on any anomalyBusiness stops trusting the controls and asks for exceptions
No baseline update after legitimate changesNew 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

DocumentedLast verified Nov 2026

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

  1. Send PingGateway MCP audit events, PingOne Authorize decisions and Advanced Identity Cloud or PingOne audit logs to the SIEM with the agent ID.
  2. Use PingOne Protect to detect computer-using agents and risky sessions in your own apps.
  3. 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

DocumentedLast verified Nov 2026

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

  1. 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.
  2. Stream System Log events for AI agents, resource connections and Agent Gateway to the SIEM.
  3. 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

DocumentedLast verified Nov 2026

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

  1. 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.
  2. Apply the Conditional Access template that blocks high-risk agent identities.
  3. 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

DocumentedLast verified Nov 2026

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

DocumentedLast verified Nov 2026

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#

TestExpected result
Use a copied agent token from an unknown networkDetected; sessions revoked at level 4
Make a support agent call a finance toolAlert; scope reduced
Plant a prompt injection that triggers exfiltration attemptsRuntime detection plus egress alert; agent contained
Gateway publishes a risk eventIdentity provider revokes the agent's sessions
Quarterly exerciseTime 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.