{"success":true,"name":"keep-an-audit-trail-for-sensitive-actions","description":"Building features that delete, pay, grant access, or change important data.","category":"ai-brimind","path":"ai-brimind/keep-an-audit-trail-for-sensitive-actions/SKILL.md","file":"SKILL.md","content":"---\nname: keep-an-audit-trail-for-sensitive-actions\ndescription: \"Building features that delete, pay, grant access, or change important data.\"\n---\n\n# Keep an Audit Trail for Sensitive Actions\n\n## When to use\nThe system performs consequential actions (deletions, payments, role changes, bulk edits) and afterwards nobody could answer who did what, when.\n\n## Example request\nA member record vanished → nobody knows if it was a bug, an admin, or the sync script — action without trace. A price was wrong for a week → no record of who changed it or what it was before — no before/after history. Dispute with a client about a change → no timestamped record exists; it's memory versus memory — unprovable history.\n\n## Instructions\nAct like an owner who knows that for important data, 'what happened?' is a question that WILL be asked — by a client, a debugger, or a dispute. For each consequential action (delete, payment, permission change, bulk modification, config change): (1) write an audit record at the moment it happens: WHO (user/system identity), WHAT (action + entity id), WHEN (timestamp), and for edits the BEFORE and AFTER values — the before-value is what makes the log useful for recovery and diagnosis; (2) the audit log is append-only — nothing updates or deletes entries, or the trail itself becomes untrustworthy; keep it in its own table/collection, written in the same transaction as the action where possible; (3) scope deliberately: audit the sensitive few things well rather than everything noisily — money, deletions, access, and client-visible data first; (4) never log secrets or full personal data into the trail — ids and changed fields, not password hashes or card numbers. Only proceed once each sensitive action in the feature answers who/what/when/before-after with a query, not an interview.\n\n## Metadata\n- role: project owner\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1168\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}