This page covers containment and investigation. For how AI changes incidents, detection and identity, and a readiness checklist, see our AI incident response guide. A worked incident and tabletop scenarios are in rehearsing AI incidents.
Containment and investigation get harder
Containment decisions assume you know what to switch off and who has the authority to do it. For a compromised laptop or a phished email account, that assumption is usually easier to meet, although dependencies can complicate the decision there too. It holds less well for a compromised AI agent wired into your CRM, your finance system and a customer-facing chat interface simultaneously. Revoking its credentials might be the right call. It might also break three production workflows at once. Revoking credentials also only stops abuse through those credentials: it does not remove malicious scheduled jobs, altered permissions, contaminated memory or persistent tool integrations, so restoring the agent to a known-good state is a separate step. Deciding that in the middle of an incident, without having mapped what the agent touches in advance, costs time you do not have.
Before an incident, know which AI agents and integrations exist, what systems and data each one can reach, and who has the authority to revoke its access. Building that inventory during a live incident is how a containment decision that should take minutes ends up taking hours.
Investigation runs into a related problem: evidence quality. Traditional systems produce logs your incident responders know how to read: authentication events, file access, network traffic. Many AI tools and agent frameworks do not log prompts, outputs, and the actions an agent took with the same fidelity, or retain them for as long, as your existing SIEM does for conventional systems. Reconstructing what an AI agent actually did can mean piecing together partial logs from several vendors rather than obtaining one complete, consistent audit trail. Where you control the deployment, set logging requirements before the tool goes live: what is recorded, with prompts and outputs minimised where they contain personal data; protection of the logs against tampering; a defined retention period, with a way to preserve records beyond it during an incident; and trace or correlation IDs that link a user's request to the agent's actions in other systems. Document and risk-assess any gaps the tool cannot cover. Where you do not, such as a third-party AI feature embedded in a SaaS product, know that limitation before the incident, not during it.
There is also a supply-chain version of this problem. If a third-party AI provider embedded in one of your critical workflows suffers its own breach or outage, your containment options are limited to whatever your contract and their status page allow. Know in advance which workflows depend on an external AI vendor and what the manual fallback is if that vendor goes dark or is itself compromised, because that is not a decision you want to be making for the first time mid-incident.
The question used to be what happened and who did it. With an AI agent in the chain, you may first need to reconstruct the instructions and context it received, the tools it called, the permissions it used and the actions it took before you can establish what happened.
What to record and preserve during an AI agent incident
Preserve evidence before you change or rebuild anything, and record who collected each item and when. For an incident involving one of your own AI agents, that means:
- the agent and model version in use, with its system instructions and configuration
- tool definitions, integrations and the permissions each one held
- prompts, retrieved content and outputs, where you retain them lawfully
- API request IDs and traces
- identity provider sign-in and token events for the agent's credentials
- database and file access logs for the systems the agent could reach
- outputs, messages and configuration changes the agent produced
- a timeline of the incident and a chain-of-custody record for the evidence
This is the same evidence practice set out in NIST SP 800-61 Rev. 3, which maps incident response to CSF 2.0, including collecting incident data and preserving its integrity and provenance. The list above applies it to the records an AI agent produces.
When Shadow AI becomes an incident
Shadow AI, staff using AI tools your IT team has not assessed or approved, is usually discussed as a data governance problem. It is also an incident response problem, and it shows up in two different ways. The first is a standalone exposure event: an employee pastes customer data, source code or financial information into a personal AI account, and your organisation is now dealing with a data protection incident with no clear scope, because you do not know what else has gone through that channel or where it ended up. Our Shadow AI guide covers the governance and compliance side of this in full.
The second is subtler and more relevant here: Shadow AI shows up in the middle of an unrelated incident. A stressed engineer, trying to resolve an active outage or breach faster, pastes log data, error messages or a description of the compromise into an AI tool that was never approved for that purpose, in some cases the same tool the attacker is exploiting elsewhere in the estate. Your incident communications and evidence-handling procedures need to explicitly cover this: staff under pressure reach for whatever tool is fastest, and "do not paste incident data into unapproved AI tools" needs to be a stated instruction during activation, not an assumption.