Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/rohit-ats/airlock/postgres-safetynpx skills add Rohit-ATS/Airlock --skill postgres-safetygit clone --depth 1 https://github.com/Rohit-ATS/AirlockWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/rohit-ats/airlock/postgres-safety)<a href="https://agentmods.dev/skills/rohit-ats/airlock/postgres-safety"><img src="https://agentmods.dev/badge/skills/rohit-ats/airlock/postgres-safety.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00037 | $0.01779 |
| Opus 5 | $0.00018 | $0.00890 |
| Sonnet 5 | $0.00007 | $0.00356 |
| Haiku 4.5 | $0.00004 | $0.00178 |
Grade A, and why
postgres-safety scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 197 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreSQL safety
The rules a migration must obey before AIRLOCK will let anyone see it. Version-specific behaviour is called out because getting it wrong is how a "safe" migration takes a production table offline.
Always establish the server version first (SHOW server_version). Do not reason from
memory about lock behaviour; it changed materially at 11, 12 and 13.
1. The three questions
Answer these, in order, for every operation:
- Is it reversible? Can I write an inverse that restores the exact prior bytes?
- What lock does it take, and for how long? A lock held for 4 seconds on a 1.2M-row table is a 4-second outage for every writer.
- Does it rewrite the table? A rewrite means the lock is held for the duration of a full copy, not for a catalog update.
If (1) is no, the change needs a scope certificate, not an undo certificate.
2. Irreversible in principle
No rollback script restores these. Do not claim reversibility.
| Operation | Why it cannot be undone |
|---|---|
DROP TABLE / DROP COLUMN |
The data is gone. Re-adding the column gives you nulls. |
TRUNCATE |
No row versions retained. |
DELETE without a retained copy |
Ditto, once vacuumed. |
UPDATE that loses information |
See §3 — the important one. |
ALTER TYPE narrowing (text→varchar(20), bigint→int) |
Truncation and overflow are lossy. |
DROP of a constraint whose violations then land |
The violating rows now exist. |
DROP COLUMNis logically irreversible even though Postgres only marks the column dropped in the catalog. The data is unreachable through SQL. Never present a re-ADD COLUMNas a rollback: it restores the schema, not the data.
3. Lossy arithmetic — the failure people miss
An UPDATE is only reversible if its function is injective (different inputs always
give different outputs).
-- NOT reversible: ROUND collapses distinct values onto the same result
UPDATE invoices SET amount_minor = ROUND(amount_minor / 1.0871);
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 197 lines · 37 tokens per session scan A 3ca6c98a5cd2
postgres-safety is a skill published in the GitHub repository Rohit-ATS/Airlock (1 stars, last pushed yesterday), licensed MIT. It adds 37 tokens to every session and 1,779 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
resonate-server-postgres
Run the Resonate protocol inside Postgres itself using resonate-pg — one SQL file of stored procedures, with no server process at all. Covers installing the schema, the pgcron timer dependency and its silent-failure mode, reaching the protocol through resonaterpc, starting workflows with resonate.invoke, the…
postgres-patterns
Provides PostgreSQL patterns for query optimization, schema design, indexing strategies, RLS, and security. Use when working with PostgreSQL SQL files or when the user mentions PostgreSQL, Postgres, pgvector, Supabase, or database optimization.
prisma-schema-conventions
Data modeling conventions for Prisma + PostgreSQL in multi-tenant systems — workspace isolation, numeric criticality, idempotent recurrence, document versioning by lineage and decoupled audit via a queue in Postgres itself. Use whenever creating or changing schema.prisma, designing new entities, planning migrations or…
reweave-operator
Operate a Reweave self-healing web-data fleet — run pipelines, triage structural-drift incidents, review repair proposals, and manage the human approval workflow. Use whenever a monitored source is broken, a heal is pending, or the operator asks about pipeline health or impact.
postgres-patterns
PostgreSQL database patterns for query optimization, schema design, indexing, and security. Quick reference for common patterns, index types, data types, and anti-pattern detection. Based on Supabase best practices.
alloydb-basics
Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.