CLI Reference: Anomaly Detection

Commands for viewing anomaly detection events.

The anomaly detector monitors agent behavior for patterns that deviate from expected norms: unusually high tool invocation rates, repeated failures, excessive resource consumption, or suspicious capability usage. See Anomaly Detection for background.

ash anomaly list

List recent anomaly detection events.

ash anomaly list [--agent <agent-id>] [--limit <n>]
FlagDefaultDescription
--agent(all agents)Filter events by agent ID
--limit20Maximum number of events to show

Examples:

# Last 20 anomaly events across all agents
ash anomaly list

# Filter to a specific agent, show more events
ash anomaly list --agent 550e8400-e29b-41d4-a716-446655440000 --limit 50

Output format

Each anomaly event includes:

FieldDescription
event_idUUID
agent_idAgent that triggered the event
detected_atRFC3339 UTC timestamp
kindAnomaly type (see below)
severitylow, medium, high, critical
detailHuman-readable description

Anomaly kinds

KindDescription
HighToolInvocationRateAgent exceeded the per-minute tool call threshold
RepeatedToolFailureSame tool failed more than N times in a row
CapabilityEscalationAttemptAgent attempted to use a capability it does not hold
ResourceExhaustionAgent approached or hit its memory/CPU limits
UnexpectedStateTransitionAgent lifecycle state changed in an unexpected way
CostBudgetExceededAgent exceeded its declared cost budget

Integration with audit log

All anomaly events are also written to the audit log. Use ash audit to see them alongside other events:

ash audit --agent <agent-id>

Automatic responses

Depending on the severity, agentd may automatically:

  • Log the event (all severities)
  • Pause the agent pending operator review (high)
  • Terminate the agent (critical)

Automatic response behavior is configured in agentd.toml.