How to Contain an AI Agent When It Goes Wrong

· Original article ↗

Summary

Stopping an AI agent may not stop queued work, active sessions or valid credentials. The article outlines containment, investigation and recovery steps, including revoking access and verifying that controls work.

Key points

  • An agent’s model may stop while its orchestrator, queued jobs, retries, credentials or existing sessions remain active.
  • Containment may require stopping runs and triggers, revoking credentials, disabling tools and restricting network access.
  • A suspicious action does not by itself prove compromise; compare agent logs with identity, API, application and network records.
  • Distinguish attempted actions from completed ones, preserve relevant logs and assess what data or resources the agent actually accessed or changed.
  • Before restoring access, identify and address the cause, then test the workflow and reinstate only the permissions it needs.
  • Test revocation and tool-disabling procedures in the actual environment; the article also promotes Keeper’s secrets-management products.

Article Details

Defense Focus
Contain AI-agent activity by controlling workflows, credentials, tool access, and network connections independently; verify that containment worked and investigate completed actions.
Detection Methods
  • Compare agent logs with identity-provider, API, application, and network records to establish what was attempted and whether it succeeded.
  • Review tool calls, authorization decisions, affected resources, and timestamps; distinguish completed actions from attempted actions.
  • Check for files read or modified, records exported, permissions changed, messages sent, and credentials retrieved.
  • Test credential revocation and tool disabling in the actual environment, including whether existing sessions or tokens remain usable.
Data Sources
  • Agent logs
  • Identity-provider records
  • API records
  • Application records
  • Network records
  • Audit trails for tool calls, authorization decisions, and secret access
Defensive Actions
  • Stop the active run and suspend triggers, retries, and queued work where possible; isolate the affected workflow without disrupting unrelated services when safe.
  • Use controls outside the agent's own instructions to interrupt its workflow.
  • Identify associated credentials, sessions, grants, and service identities; revoke untrusted access, rotate exposed secrets, and verify that revoked access is unusable.
  • Disable the involved tool or integration, restrict access to affected resources, and limit network connections if data may be leaving the organization.
  • Preserve relevant identity, API, and network logs; record the agent identity, run or session ID, timestamps, tool calls, authorization decisions, and affected resources without copying secret values into general-purpose notes or logs.
  • Assess affected accounts and resources, remove unauthorized changes, and follow incident, privacy, and notification processes if data may have left the environment.
  • Before restoring access, identify and address the cause, restore only the permissions required, test in a controlled environment, require authorization for high-impact actions, and monitor resumed activity.
  • Prepare and exercise response procedures for each production agent, including credential revocation, tool disabling, session termination, and network restriction.

Vendors

Products

Related Articles