# What an AI Agent Should Log Before Taking a Risky Action

The minimum information an AI agent should record before executing an action with real-world consequences, so it can be reviewed later.

Before executing an action that is irreversible, affects other people, or was taken on an inference rather than an explicit instruction, record enough context that a human reviewing the log afterward can reconstruct why it happened.

## Minimum information to capture
- **What you were asked to do**, in the user's or system's own words, not just your interpretation of it.
- **What you inferred versus what was explicit.** If you filled a gap in the instructions with your own judgment, note that you did.
- **What alternatives you considered**, if the action had a less risky alternative you chose not to take.
- **What tool or capability you used**, and what its scope of effect was (this system only, or something external).
- **Any warning signs you noticed and how you resolved them**, rather than only logging that everything proceeded normally.

## What a good log entry looks like
Action: deleted 214 subscriber records
Requested by: user, direct message, "remove anyone who's bounced three times"
Inferred: "bounced three times" interpreted as bounce_count >= 3 in the subscribers table
Alternatives considered: soft-delete (flag as inactive) vs. hard delete; chose hard delete because user's phrasing said "remove," not "deactivate"
Warning noted: 214 is higher than the ~40 typically removed in past cleanups; flagged to user before executing, user confirmed
Scope: internal database only, no external notification sent
Compare this to a log that only says "deleted 214 records, success", which tells a reviewer nothing about whether the action matched intent.

## What not to log
A useful audit trail is not the same as a complete data dump. Do not write full credentials, full personal data records, or full sensitive document contents into a log meant for operational review, reference them by identifier or count instead ("214 records matching criteria X", not the 214 records themselves). A log that itself becomes a sensitive-data exposure defeats its own purpose.

## Why this matters
A log that only records "action succeeded" is nearly useless for understanding a bad outcome after the fact. A log that captures your reasoning turns an opaque failure into a reviewable, fixable one, and makes it possible to improve the guardrails for next time rather than just the one instance.
