Skip to content
  1. Home
  2. AI agents
  3. Observability and cost
  4. Alerting and incident response

Operate · Observability and cost

How do you set up alerting and incident response for AI agents?

Alerting and incident response for AI agents means watching the signals that show an agent misbehaving, such as runaway tool calls, guardrail blocks, falling evaluation scores or unusual write actions, and having a tested plan to contain it, keep the evidence, recover a known-good version and turn the failure into a test.

In this guide: 83 pages

Key takeaways

  1. Alert on behaviour the model cannot talk its way out of: tool calls and model calls per run, write actions to new destinations, guardrail and injection flags, approval patterns and online evaluation scores. Cost alerts arrive too late to stop a loop.
  2. Contain first and diagnose second. Disabling a tool or an agent identity takes minutes, and working out why the agent did something can take days.
  3. Every off switch leaves something running. A Foundry Control Plane stop leaves runs in progress, a block in the Microsoft 365 admin center only affects Copilot Chat for Foundry and SharePoint agents, and a Copilot Studio quarantine still allows the maker’s test pane.
  4. Preserve evidence before retention runs out. CloudTrail event history keeps 90 days and Google’s _Default log bucket 30 days, so export traces and audit records and set holds as part of containment.
  5. Two published frameworks cover agent incidents: the OWASP GenAI Incident Response Guide 1.0 (28 Jul 2025) and the CoSAI AI Incident Response Framework V1.0 (27 Oct 2025), which builds on NIST SP 800-61r3.
Incident response steps for an AI agentFive steps run in order. Detect from metrics, evaluation scores and guardrail events. Contain by disabling a tool, blocking the agent or revoking its tokens. Preserve evidence by exporting traces and audit records and setting holds before retention runs out. Recover by rolling back to a pinned version, fixing the cause and retesting. Learn by turning the failing runs into regression tests and updating the registry record.In this orderDetectMetrics, evals,guardrail eventsContainDisable tool, blockagent, revoke tokensPreserveExport traces andaudit, set holdsRecoverRoll back, fixthe cause, retestLearnFailing runs becomeregression testsContain before you diagnose. Every platform off switch leaves somethingrunning, so test each one on a throwaway agent and write down what remains.Incident response steps for an AI agentFive steps run in order. Detect from metrics, evaluation scores and guardrail events. Contain by disabling a tool, blocking the agent or revoking its tokens. Preserve evidence by exporting traces and audit records and setting holds before retention runs out. Recover by rolling back to a pinned version, fixing the cause and retesting. Learn by turning the failing runs into regression tests and updating the registry record.In this orderDetectMetrics, evals, guardrail eventsContainDisable tool, block agent, revoke tokensPreserveExport traces and audit, set holdsRecoverRoll back, fix the cause, retestLearnFailing runs become regression testsContain before you diagnose. Every offswitch leaves something running, so testeach one and write down what remains.
Five steps in order: detect, contain, preserve, recover and learn. Containment comes before diagnosis because every off switch is quicker than a root-cause analysis.

Which alerts should an agent have?

Start with alerts on the agent’s behaviour, then add quality and identity signals. The table lists the signals we set for production agents, why each one matters and the first thing to do when it fires.

Alert signals for a production agent, with the first response to each. Metric names follow the main branch of the OpenTelemetry GenAI conventions on 2 Nov 2026; the conventions have Development status, so pin the SDK version and retest alerts after upgrades.

SignalFires whenWhy it mattersFirst action
Tool calls and model calls per runThe count jumps well above the baseline for the agent version (gen_ai.invoke_agent.tool_calls and inference_calls)The earliest sign of a loop or a hijacked planOpen the live traces; cap or stop the run
Write actions to new destinationsThe agent emails, posts or writes to a recipient, domain or system it has not used beforeData that leaves the company usually leaves through a write toolDisable the tool; review the arguments
Guardrail and injection flagsBlocks or injection flags rise, for example XPIADetected or JailbreakDetected in Purview audit recordsSomeone is probing the agent, or a poisoned document sits in its sourcesFind the source document or input and quarantine it
Error rate and latencyerror.type rate or duration per run leaves its normal bandTool outages and model changes show up here firstCheck provider status and recent changes
Online evaluation scoreThe sampled score for a criterion drops below its thresholdQuality drift that no error message reportsCompare with the last regression run; consider rollback
Approval patternThe approval rate nears 100 percent or review time drops to secondsAutomation bias: the human check has become a formalityReview the queue and resample decisions
Identity eventsThe agent identity signs in from a new place, gains grants or is used by another workloadStolen or over-broad credentialsDisable the identity and rotate secrets
Model or configuration changeA model version, prompt or tool changes outside the release pipelineAn unplanned change skipped the regression suiteRoll back to the pinned version
Spend per use caseDaily spend passes its budgetConfirms cost damage, too slowly to stop a loop by itselfCheck the run-level signals above

Set baselines per agent version, because a new model or prompt changes the normal number of tool calls. An alert tuned on last month’s version will either fire constantly or stay silent.

How do you rank an agent incident?

Rank by what the agent did and what it can still do; how strange the output looks matters less. The four levels below are the ones we use, and each one sets who gets called and how fast containment must happen.

  • Severity 1: data left the company, money moved, or an irreversible action ran without valid approval. Contain at once, call security, legal and the business owner, and start preserving evidence.
  • Severity 2: a wrong or unauthorised action that was caught or can be reversed, or a confirmed injection that reached a tool call. Contain within the hour and notify the agent owner and security.
  • Severity 3: quality drift, such as an evaluation score below threshold or rising escalations, with no harmful action. Roll back or pause within the working day.
  • Severity 4: a cost or performance anomaly with no effect on outputs. Fix it in the next release.

Personal data in a severity 1 or 2 incident can also trigger breach rules such as those in the GDPR, as it would for any other system, so the privacy team belongs in the call tree from the start.

What are the steps when an agent misbehaves?

Detect, contain, preserve, recover and learn, in that order. The CoSAI framework adds agent-specific containment moves: disable tools, tighten authorisation and check least privilege, and for memory, reset it, isolate sessions and purge conversation history.

  1. Contain. Disable the tool or MCP server involved, then the agent or its identity if the misuse continues, and revoke the OAuth tokens and API keys the agent held. After the Salesloft Drift integration tokens were stolen in August 2025, Cloudflare found 104 of its API tokens in the stolen data and rotated all of them.
  2. Preserve. Export the traces, audit records and tool server logs for the affected runs, set legal holds, and snapshot the agent version, prompt and memory store before retention defaults delete the evidence.
  3. Scope. Use trace ids to list every run, user, document and downstream record the agent touched in the window, and check memory for planted instructions that could come back in a later session.
  4. Eradicate. Fix the cause: narrow the tool permission, remove the poisoned source or patch the SDK. Some fixes need more than an upgrade; the AgentCore Starter Toolkit flaw CVE-2026-105812 required re-importing agents with version 0.3.14 or later.
  5. Recover. Roll back to the last pinned version through its alias or named endpoint, rerun the regression suite, then restore access in steps.
  6. Learn. Add the failing runs to the golden dataset as regression tests, update the registry record and risk tier, and tell the affected users and owners what happened.

Keep one runbook per agent with its tools, identities, off switches, owners and evidence stores, and rehearse it with the people on the call tree. A runbook that names the agent without its identity, its tool servers and its alias or endpoint leaves the on-call engineer to find them in the middle of the incident.

What does each platform’s off switch actually stop?

Each switch stops one layer and leaves others running, so a runbook names several. The table lists the switches the vendors documented on 2 Nov 2026 and what each one leaves behind.

Off switches by platform and what they leave running, as documented on 2 Nov 2026.

Platform and actionWhat it stopsWhat it leaves running
Microsoft 365 admin center: Block agentAccess to the agent across the organisationFor Foundry and SharePoint agents, only availability in Copilot Chat changes
Foundry Control Plane: Stop, for hosted or published agentsNew work on the agentRuns already in progress
Foundry Control Plane: Block, for custom agentsIncoming requestsCredentials and tools the agent holds elsewhere
Copilot Studio: SetAsQuarantined through the Power Platform API, or Block in inventoryUse of the agent by its audienceThe maker’s test pane
Entra Agent ID: disable the agent identity or blueprintToken issuance for that identity, reversiblyThe objects themselves; disabling a blueprint across tenants can break dependent Microsoft experiences
Entra Conditional Access templates that block agent authenticationA tenant-wide, reversible hold on agent sign-insAccess through credentials outside Entra, such as API keys stored in tools
Bedrock Agents Classic: set the alias to REJECT_INVOCATIONSInvocations through that alias, without IAM changesOther aliases and direct access to the tools
AgentCore: repoint the named endpoint to an earlier version, or deny the tool in AgentCore PolicyThe faulty version, or the tool call at the GatewayCalls that bypass the Gateway
Google: block at Agent Gateway and remove IAM bindingsCalls through the Gateway and access granted by those bindingsCalls that bypass the Gateway

Test every switch on a throwaway agent each quarter, time it, and write down what kept running. Record the result next to the agent in the registry, so the person on call knows which switch to use first.

How do Microsoft, AWS and Google implement it?

The alerting and containment tooling each cloud offered, as the vendor pages showed on 2 Nov 2026.

Capability, Microsoft, AWS, Google

CapabilityMicrosoftAWSGoogle
Alerts on agent metricsAlerts in the Foundry Agent Monitoring Dashboard (preview); Azure Monitor alerts on Application Insights dataCloudWatch alarms on AgentCore session count, latency, token usage and error ratesCloud Monitoring; Agent Observability, in preview at the platform launch
Failure pattern detectionContinuous evaluation on sampled runs; AI Red Teaming Agent scans (preview)AgentCore Failure Insights (preview since July 2026) finds recurring failures, including silent onesNot verified for this page
Identity-level stopDisable the Entra agent identity; Conditional Access templatesDeny the tool in AgentCore Policy; remove IAM permissionsRemove IAM bindings; Agent Gateway policy
RollbackImmutable Foundry agent versions; Power Platform pipelines can redeploy earlier solution versionsAgentCore Runtime named endpoints pinned to an earlier versionAgent Runtime revisions with traffic splitting (preview since 19 May 2026)

Frequently asked questions

Who should be on call for an AI agent?

The platform team for containment, because it controls identities, the gateway and the off switches, with the agent owner as the second call for diagnosis. Security joins for anything involving data leaving the company or a suspected attack, and the business owner decides when the agent goes back into service.

Do agent incidents have to be reported to a regulator?

Sometimes, under rules that already apply to you. Assess every personal data breach: under the GDPR you notify the supervisory authority unless the breach is unlikely to put people at risk, and you document each breach either way. Financial firms have their own incident regimes, and the EU AI Act adds serious-incident reporting for high-risk systems as those duties start. Map each agent’s tier to its duties when you register it.

How often should we test the off switch?

Each quarter for production agents and after each platform change, on a throwaway agent that mirrors production. Time each switch and record what kept running, because the vendors document gaps, such as a Foundry stop that leaves runs in progress.

What should the first alert be for a new agent?

Tool calls per run against the baseline for that agent version, which shows loops, hijacked plans and broken tools across runs without any content capture, using the gen_ai.invoke_agent.tool_calls metric from the OpenTelemetry conventions. The metric is recorded per invocation, so stop a loop inside a single run with hard limits on tool calls and run duration.

More in Observability and cost

Sources

Each source was read on 2 November 2026. The date shown is the date on the page, or the page’s ms.date for Microsoft Learn; an undated page shows the date it was read.

  1. Agent actions in the Microsoft 365 admin center Microsoft Learn, 23 September 2026
  2. Manage agents in Foundry Control Plane Microsoft Learn, 15 July 2026
  3. Use the Power Platform API to quarantine agents Microsoft Learn, 14 July 2026
  4. Disable agent identities Microsoft Learn, 29 April 2026
  5. Agent Monitoring Dashboard in Microsoft Foundry Microsoft Learn, 25 September 2026
  6. Audit logs for Copilot and AI applications Microsoft Learn, 26 August 2026
  7. Deploy and use an Amazon Bedrock agent AWS documentation, undated page, read 2 November 2026
  8. AgentCore Runtime versioning and endpoints AWS documentation, undated page, read 2 November 2026
  9. Amazon Bedrock AgentCore release notes AWS documentation, undated page, read 2 November 2026
  10. CVE-2026-105812 CVE Program, 6 October 2026
  11. Working with CloudTrail event history AWS documentation, undated page, read 2 November 2026
  12. Semantic conventions for GenAI metrics OpenTelemetry (semantic-conventions-genai repository), undated page, read 2 November 2026
  13. GenAI Incident Response Guide 1.0 OWASP GenAI Security Project, 28 July 2025
  14. AI Incident Response Framework V1.0 CoSAI (OASIS Open Project), 27 October 2025
  15. The impact of the Salesloft Drift breach on Cloudflare and our customers Cloudflare, 2 September 2025

Planning an AI program?

Talk to the team that builds it and runs it after launch.

  • Built to SOC 2, HIPAA and GDPR standards
  • EU AI Act-aligned delivery
  • Microsoft Solutions Partner