{"id":"AGT-044","title":"Detecting compromised or misbehaving agents","maturity":"documented","collection":"Agent identity","category":"Incident response","complexity":"High","intent":"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.","summary":"A stolen agent token or a hijacked agent looks legitimate in most logs. Baseline each agent's normal behaviour, combine identity provider risk, gateway, decision point and runtime signals, share risk events between systems, and respond in proportion: step down, require approval, or stop the agent.","problems":["Agent credential theft","Prompt injection and goal hijack","Data exfiltration by agents","Slow detection of automated misuse","Alert fatigue"],"standards":["OpenID Shared Signals Framework 1.0","OpenID Continuous Access Evaluation Profile (CAEP) 1.0","OpenID RISC 1.0","MITRE ATLAS","OWASP Top 10 for Agentic Applications 2026 (ASI01, ASI03, ASI10)"],"tags":["ITDR","identity threat detection and response","agent risk","anomaly detection","behaviour baseline","shared signals","CAEP","RISC","SSF","SIEM","SOAR","ID Protection","goal hijack","rogue agent","exfiltration","response playbook"],"roles":["IAM architect","Identity engineer","Security leader","Platform engineering","AI engineering"],"industries":["Cross-industry","Financial services","Healthcare","Retail","Public sector"],"builds_on":["AGT-025","AGT-026"],"related":["AGT-012","AGT-013","AGT-016"],"authors":"Trevonix Innovation","reviewers":"Trevonix IAM architecture","version":"1.0","last_reviewed":"2026-11-25","published":"2026-11-25","og_image":"og-agt-044.png","sections":{"summary":[{"type":"bullets","content":"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.\nCollect **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)**.\nRespond **in proportion and automatically**: reduce scope, require approval, revoke sessions, or stop the agent; then investigate with the attributable trail."}],"problem":[{"type":"paragraph","content":"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.\n\nAgents 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."}],"use_when":[{"type":"bullets","content":"Agents run in production with access to sensitive data, money movement or administrative actions.\nYour SOC monitors people's identities and needs to cover agents too.\nYou use several identity, gateway and governance products that each see part of the picture."}],"avoid_when":[{"type":"bullets","content":"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":[{"type":"bullets","content":"**Normal is unusual.** Agents' normal behaviour (bursts, night-time work, many calls) would trip human-oriented rules.\n**Authorised but wrong.** The most damaging misuse uses valid credentials and permitted actions.\n**Signal spread.** Each product sees one slice; correlation needs shared identifiers.\n**Speed against false positives.** Automatic stops protect quickly and can halt healthy agents."}],"solution":[{"type":"paragraph","content":"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."},{"type":"image","content":"Signals from identity, gateway, decision point and runtime meet in the SIEM; shared signals and playbooks respond in proportion.","title":"Solution overview","media":"agt-044-solution.png","alt":"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"},{"type":"table","content":"Signal | Source | Example detection\nAgent risk raised | Identity provider | Sign-in to an unfamiliar resource, confirmed compromise by an admin\nToken used from outside the runtime | Identity provider, gateway | Source network or client not in the agent's baseline\nNew tool or data class | Gateway, decision point | First call to a finance tool by a support agent\nVolume spike | Gateway | Ten times the usual record reads in an hour\nDenials rising | Decision point | Repeated attempts at disallowed actions\nApproval pattern change | Approval service | Many approval requests, or approvals at odd hours\nContent signals | Agent runtime, DLP | Prompt-injection detector fires; personal data in outbound calls\nUnexpected destination | Network egress | Calls to a domain no task needs","title":"Signals to collect"},{"type":"table","content":"Level | Trigger (examples) | Automatic response\n1 Watch | Minor drift, single anomaly | Raise alert, increase logging\n2 Reduce | Drift on a sensitive tool or data class | Narrow scope or move agent to read-only\n3 Confirm | High-value action during an anomaly | Require human approval for every consequential action\n4 Contain | Credential misuse or confirmed injection | Revoke sessions and tokens, block at gateways\n5 Stop | Confirmed compromise or tier 4 agent at level 4 | Kill switch across platforms (AGT-016)","title":"Response ladder"},{"type":"numbered","content":"**Baseline each agent:** runtime, networks, clients, tools, data classes, volumes and hours, from its first weeks in production and its declared purpose.\n**Use one agent ID and a correlation ID** across identity provider, gateway, decision point, runtime and applications (AGT-025).\n**Turn on vendor agent risk features** and forward their events to the SIEM.\n**Write detections** for the signals above, tuned per risk tier; start in alert-only mode.\n**Connect products with Shared Signals:** gateways and IGA publish risk events; the identity provider and gateways subscribe and act (revoke sessions, block).\n**Automate the response ladder** in SOAR or native policies, with human confirmation for levels 4 and 5 on low-tier agents.\n**Rehearse:** run a stolen-token and a prompt-injection exercise each quarter and measure time to contain.","title":"How it works"},{"type":"tip","content":"The best early-warning signal is often the decision point: an agent that suddenly hits many denials is either broken or being steered. Alert on denial rates per agent before building anything more complex.","title":"Watch the denials"}],"design_rules":[{"type":"numbered","content":"**Every agent has a baseline and a declared purpose to compare against.**\n**One agent ID and correlation ID across all telemetry.**\n**Detect misuse of valid access, not only invalid access.**\n**Share risk between products; do not wait for a person to copy alerts.**\n**Respond in proportion to risk tier, automatically where safe.**\n**Rehearse and measure time to contain.**"}],"anti_patterns":[{"type":"table","content":"Anti-pattern | What goes wrong\nReusing human ITDR rules for agents | Constant false positives, then alerts are muted\nLogs without agent IDs or correlation IDs | Analysts cannot connect a tool call to a token and a person\nDetection without automated response | Agents act at machine speed; people respond hours later\nStopping every agent on any anomaly | Business stops trusting the controls and asks for exceptions\nNo baseline update after legitimate changes | New features look like attacks"}],"benefits":[{"type":"bullets","content":"Faster detection of stolen agent credentials and hijacked agents.\nProportionate, automatic containment.\nInvestigations that join identity, gateway, decision and runtime evidence.\nRisk shared across products instead of trapped in one."}],"costs":[{"type":"bullets","content":"SIEM ingestion and detection engineering for agent telemetry.\nBaseline upkeep as agents change.\nShared Signals support varies by product.\nTuning time to keep false positives low."}],"tests":[{"type":"table","content":"Test | Expected result\nUse a copied agent token from an unknown network | Detected; sessions revoked at level 4\nMake a support agent call a finance tool | Alert; scope reduced\nPlant a prompt injection that triggers exfiltration attempts | Runtime detection plus egress alert; agent contained\nGateway publishes a risk event | Identity provider revokes the agent's sessions\nQuarterly exercise | Time to contain within the target for the tier"}],"maturity_notes":[{"type":"paragraph","content":"**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."}],"faq":[{"type":"faq","content":"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.","title":"Does the identity provider detect compromised agents for us?"},{"type":"faq","content":"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.","title":"What about agents acting on behalf of users?"}],"references":[{"type":"bullets","content":"[Microsoft Learn: ID Protection for agents](https://learn.microsoft.com/en-us/entra/id-protection/concept-risky-agents)\n[OpenID Foundation: Shared Signals Framework, CAEP and RISC become Final Specifications](https://openid.net/press-release-openid-foundation-finalizes-global-standards-for-real-time-identity-security/)\n[Saviynt: Delivering intelligence to the AI identity control plane](https://saviynt.com/blog/identity-security-for-ai-agent-access-gateway-identity-management-posture-management)\n[MITRE ATLAS](https://atlas.mitre.org/)\n[OWASP: Top 10 for Agentic Applications 2026](https://genai.owasp.org/2025/12/09/owasp-top-10-for-agentic-applications-the-benchmark-for-agentic-security-in-the-age-of-autonomous-ai/)"}]},"recipes":{"ping":{"status":"documented","product_name":"PingGateway, PingOne Authorize and PingOne Protect telemetry","summary":"Gateway, decision and session signals to the SIEM; automated revocation.","last_verified":"2026-11","blocks":[{"type":"numbered","content":"Send PingGateway MCP audit events, PingOne Authorize decisions and Advanced Identity Cloud or PingOne audit logs to the SIEM with the agent ID.\nUse PingOne Protect to detect computer-using agents and risky sessions in your own apps.\nAutomate responses in DaVinci or journeys and revoke agent sessions and tokens through the platform APIs.","title":"Configure"}]},"okta":{"status":"documented","product_name":"Okta ISPM, Identity Threat Protection and Workflows","summary":"Posture findings, shared signals and automated containment.","last_verified":"2026-11","blocks":[{"type":"numbered","content":"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.\nStream System Log events for AI agents, resource connections and Agent Gateway to the SIEM.\nAutomate containment with Okta Workflows: deactivate a resource connection, deactivate the agent, or block it at the Agent Gateway.","title":"Configure"}]},"entra":{"status":"documented","product_name":"ID Protection for agents, Conditional Access and Sentinel","summary":"Agent risk detections, blocking high-risk agents and SIEM correlation. Written from Microsoft documentation.","last_verified":"2026-11","blocks":[{"type":"numbered","content":"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.\nApply the Conditional Access template that blocks high-risk agent identities.\nStream sign-in, audit and risk logs to Microsoft Sentinel or your SIEM and correlate with gateway and runtime logs by agent object ID.","title":"Configure"},{"type":"bullets","content":"ID Protection for agents needs Microsoft Entra ID P2, and Microsoft has said it will require an Agent 365 licence.\nFor agents acting on behalf of a user, some risk is evaluated on the user rather than the agent identity; check both.","title":"Gotchas"}]},"saviynt":{"status":"documented","product_name":"Saviynt Zuma Insights risk signals and drift detection","summary":"Partner risk signals and drift from declared intent; delete switch for containment.","last_verified":"2026-11","blocks":[{"type":"paragraph","content":"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."}]},"misc":{"status":"documented","product_name":"SIEM, SOAR and Shared Signals","summary":"Correlation, automation and standard risk events between products.","last_verified":"2026-11","blocks":[{"type":"paragraph","content":"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."}]}},"slug":"agt-044-detecting-compromised-or-misbehaving-agents","updated_at":"2026-12-02T09:48:48.316Z","url":"https://patterns.trevonix.com/patterns/agt-044-detecting-compromised-or-misbehaving-agents","markdown_url":"https://patterns.trevonix.com/patterns/agt-044-detecting-compromised-or-misbehaving-agents.md","publisher":"Trevonix","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"}}