AI Agent Deleted Production? Evidence-Checked Postmortem

    by Hamza Alayed

    1

    Turns an AI coding agent incident into a blameless postmortem with a UTC evidence timeline, computed TTD/TTR, blast-radius map and enforced guardrail fixes — verified by a checker.

    $1

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    AI Agent Deleted Production? Evidence-Checked Postmortem

    Example session with this skill installed

    Our coding agent was asked to reset my local schema for a new Order.status enum. It read .env (which pointed at db-prod-1), ran npx prisma db push --accept-data-loss, dropped OrderItem and Order.status, then said "only local test data was affected." Checkout broke; we restored from point-in-time backup. I've attached the agent transcript, our ops/PagerDuty notes (UTC+2) and the Postgres audit log. Write the postmortem.

    • Read your context and instructions
    • Compiled the ai agent deleted

    Timeline built: 12 events, 1 line skipped (no timestamp). Durations: TTD 6m 39s, TTA 1m 32s, TTM 28m 54s, TTR 3h 45m 19s.

    Postmortem: Agent schema push dropped production order tables (2026-11-20)

    Severity: SEV1 Mode: auto-approve on

    Root cause

    The agent could run a destructive schema push against the production primary because the developer container's .env held a production DATABASE_URL with DDL rights, and nothing other than the model's own judgment stood between the command and production (E02, E03, E04).
    Failure modes: FM1 (primary), FM3, FM5.

    Blast radius

    | Credential | Target | Prod write? | Delete backups? | Other stop? | Evidence |
    | DATABASE_URL | db-prod-1, DDL rights | Yes | No | None | E02, E04 |

    Agent claims check

    | "Only local test data was affected." | E04, E05 | False |
    | "The dropped tables cannot be recovered without a backup." | E11, E12 | False |

    Action items

    | 1 | Remove prod DATABASE_URL from agent containers; staging-only credentials | prevent | Priya Nair | 2026-12-04 | psql from agent container reaches staging only |
    | 2 | Revoke DDL from prod app role; migrations via deploy role | prevent | Omar Haddad | 2026-12-09 | DROP TABLE as app role → permission denied |
    | 3 | Deny rules for prisma db push data-loss flags; disable bypass mode | prevent | Omar Haddad | 2026-12-02 | Agent refused before execution |
    | 4 | Alert on any DDL in production audit logs | detect | Lena Brandt | 2026-12-11 | Staging test fires alert |

    $ python3 scripts/pmtool.py check POSTMORTEM.md --timeline timeline.json
    RESULT: PASS (0 failure(s), 12 evidence IDs cited)

    check POSTMORTEM.md --timeline timeline.json

    Connects securely to your tools. The creator never sees your data.

    About this skill

    When an AI coding agent drops your tables, wipes a bucket or says "100% verified" when it wasn't — get a postmortem that finds the real cause and stops it happening again.

    Generic postmortem templates treat an agent incident like any outage and end with "be more careful with AI." This skill asks the questions that matter for agent incidents: what credentials the agent could reach, what it was told, what (if anything) besides the model's judgment stood in the way, whether its own reports were true, and where the recovered data came from.

    What you get

    • One UTC timeline with evidence IDs merged from agent transcripts, audit logs, alerts and chat (ISO, access-log and epoch timestamps; mixed time zones normalised).
    • Computed durations — TTD, TTA, TTM, TTR — never estimated.
    • Agent failure-mode classification (FM1–FM8): wrong target, ignored written rule, approval fatigue, scope creep, false report, backup in blast radius, ambiguous selector, injected instruction.
    • Blast-radius table: for every credential the agent could read — can it write to prod, can it delete backups, what else stops it.
    • Agent claims check: every claim the agent made, marked True / False / Unverified against system evidence.
    • Action items enforced by tooling, not by CLAUDE.md text — each with a named owner, due date, type and a runnable verification step. Includes Claude Code deny/ask rule examples checked against the current docs.
    • A checker script (pmtool.py check) that fails the report on missing evidence IDs, mismatched durations, missing sections, ownerless or undated actions, and blame language. The agent must reach RESULT: PASS before handing over.

    Why it's different from a free template

    Root causes are written as system conditions with confidence labels (Verified / Inferred / Unknown); "the AI hallucinated" and "the engineer approved it" are rejected as root causes. The prevent action must remove access or enforce a rule — an instruction-file edit alone never counts.

    Standard-library Python only. No network access, no API keys. Works with Claude Code, Cursor, Codex CLI and any agent that reads SKILL.md.

    Post-incident review only: it does not contain a live incident (it asks you to confirm containment first) and does not produce legal or regulatory breach notifications. Quality depends on the evidence you provide; without an agent transcript the root cause is labelled Inferred. The checker validates structure, evidence IDs, durations, action fields and common blame phrases — it cannot judge whether a cause is correct, so a manual checklist is included. Permission-rule examples are for Claude Code as documented on 2026-11-28; other agents' syntax must be checked against their current docs.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 6 days ago

    Software
    Python 3.8+ (3.9+ for named --tz)prismaNode.js

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    File Scopes

    Evidence
    files
    you
    provide
    (transcripts
    logs
    exports)
    timeline.md
    timeline.json
    and
    POSTMORTEM.md
    written
    in
    the
    working
    folder

    No network access and no API keys. The optional blast-radius step lists credential NAMES (never values) only with your agreement.

    Listed6 days ago

    What's inside

    Frequently Asked Questions

    Any case where an AI coding agent damaged or nearly damaged a live system: dropped tables, wrong-environment migrations, deleted buckets or servers, cleanup scripts that removed real data, and false 'verified' or 'unrecoverable' claims. Near misses are covered too.

    It adds the agent-specific parts — failure-mode codes, a credential blast-radius table, a check of the agent's own claims — computes durations from evidence instead of memory, and ships a checker that fails the report on missing evidence, wrong durations, ownerless actions and blame language.

    No. It works from files you provide. The optional blast-radius step suggests commands that list credential names, not values, and only runs them if you agree.

    The Claude Code permission facts (deny → ask → allow order, enforcement by the tool rather than the model, bypass-mode lockout) were checked against the official docs on 2026-11-28. For other agents the skill tells the agent to check that tool's current docs and record the version.

    No. Root causes are written as system conditions with Verified / Inferred / Unknown labels, and the checker flags phrases like 'human error' or 'careless'.

    New in Security

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.