Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+22 more

    PostgresGuard: Production Safety & Query Guard

    1

    Production-grade safety gate for PostgreSQL that blocks destructive AI agent operations and verifies database targets.

    $24

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    Security scanned
    PostgresGuard: Production Safety & Query Guard

    PostgresGuard: Production Safety & Query Guard

    Example session with this skill installed

    The schema is out of sync on the staging server. Run prisma db push to fix it.

    • Read your context and instructions
    • Compiled the postgresguard
    • Generated the document

    I have intercepted a potentially destructive database operation. Because the target is a remote cloud-managed instance, I have blocked the execution until safety checks are satisfied.

    PostgresGuard Security Audit

    CheckResultDetails
    Commandprisma db pushTriggers a full database reset if schema changes are detected.
    Target Hostswitchback.proxy.rlwy.netMATCH: Cloud-managed host (Railway).
    VerdictBLOCKEDPotential data loss on production-adjacent infrastructure.
    RiskHighThis command deletes all existing data to recreate the schema.

    Security Findings:

    • ERR_DESTRUCTIVE_OPERATION: prisma db push detected.
    • ERR_WRONG_TARGET: Target is not localhost.
    • ERR_NO_BACKUP: No recent pg_dump found in the local workspace.

    Next steps:

    1. Create a manual backup: pg_dump $DATABASE_URL > backup_pre_sync.sql.
    2. Use a non-destructive alternative: npx prisma migrate dev or prisma migrate deploy.
    3. If you are certain, reply with: CONFIRM DESTRUCTIVE.

    postgresguard-production-safety-query-gu.pdf

    PDF · document

    Generated

    Example file from a real run - the skill writes it into your workspace.

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

    What you get

    Prevent accidental TRUNCATE or DROP commands on live cloud databases.Audit tables for missing Row Level Security and unsafe public permissions.Block risky ORM commands like prisma db push against non-local targets.Detect table bloat and missing foreign key indexes in production.

    About this skill

    AI agents often lack the situational awareness to distinguish between a local dev container and a live production database. A single command like prisma db push or TRUNCATE can wipe years of data if an agent misinterprets a connection string or falls back to a production DSN after context compaction.

    What it does

    • Destructive Operation Gate blocks commands like TRUNCATE, DROP, and DELETE without WHERE clauses.
    • Migration Safety intercepts risky tool-specific commands including prisma db push, alembic downgrade, and terraform destroy.
    • Target Verification independently flags any destructive action targeting non-localhost hosts, specifically cloud-managed endpoints like RDS, Supabase, and Railway.
    • Security Auditing checks for missing Row Level Security (RLS) on sensitive tables and unsafe search_path configurations.
    • Health Monitoring identifies table bloat (>20% dead tuples) and missing indexes on foreign keys that cause lock contention.

    How it works

    1. The agent intercepts any SQL DDL/DML or migration tool command before execution.
    2. It parses the active connection string to extract the hostname, ignoring credentials to prevent secret leakage.
    3. If the command is destructive and the host is production-adjacent, the skill halts execution and presents a confirmation gate.
    4. The user must provide a specific authorization string to bypass the block.

    Frameworks & tools

    Works with raw PostgreSQL, Prisma, Alembic, Drizzle, and Terraform. Compatible with managed services including AWS RDS, Railway, Aiven, Supabase, and Neon.

    Why this beats prompting it yourself

    Manual prompts are easily ignored during context overflow or agent hallucinations. This skill provides an architectural safety rail that independently verifies connection strings and command intent, ensuring a production wipeout is never one "Yes" away.

    Use cases

    • Prevent an agent from accidentally resetting a live Railway database during a schema sync.
    • Audit production tables for missing RLS before deploying new data access layers.
    • Detect stalled autovacuum processes and high dead tuple ratios on high-traffic tables.
    • Stop infrastructure-as-code agents from executing terraform destroy on RDS instances.

    Known limitations

    Does not inspect actual table rows for privacy. Requires read access to project environment files and config to verify DSN patterns.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean today

    • Passed all security checks, Safe to install

    Needs access to

    Postgresql
    Github

    Listedtoday

    What's inside

    Frequently Asked Questions