A Rust safety gateway between AI agents and PostgreSQL. The
security seam sits below the agent: least-privilege roles, a proxy-only read
path, bounded disclosure, cancellation, explicit write certification, and
tamper-evident audit evidence.
Current verdict: a credible MVP and
research-grade safety kernel—not a production-safe control plane for
arbitrary PostgreSQL databases. Production Read is the only posture eligible
for production evaluation. Writes remain explicitly experimental.
Runtime postures
Implemented · conditional
Production Read
Five read tools through the proxy to a physical replica. Row, byte,
time, and in-process cumulative budgets; cancellation; warden monitoring;
verified TCP transport; and authoritative audit evidence. Every
deployment prerequisite must be proven; unknown means unsupported.
Experimental · non-production
Experimental Write
A tiny exact-literal-key UPDATE/DELETE
envelope with catalog-bound identity, instance-separated rehearsal,
exact-set approval, durable Recovery Material, and compare-and-swap
revert. Clone governance remains operator-attested.
Development only
Development
Throwaway PostgreSQL, primary transaction rehearsal, local file/HMAC
anchoring, demos, and benchmark fixtures. This posture cannot produce a
production verdict.
Claims we make
Writes
Fail-closed writes for explicitly
certified PostgreSQL shapes. This is an experimental envelope, not a claim
over PostgreSQL's entire behavioral surface.
Reads
Bounded disclosure, not unreadability.
Returned bytes cannot be recalled. The cumulative meter resets on proxy
restart and is independent per proxy process.
Audit
Tamper-evident, not tamper-proof.
Coverage is event-class-specific. MCP-local and some early refusals do not
enter the authoritative chain. Experimental primary mutations and final
audit rows are not atomically co-committed.
Load-bearing limits
The read classifier is default-deny for its recognized SQL subset, but it
is not PostgreSQL-native semantic resolution. The known generic type-literal
AST mismatch is explicitly denied; a current green doctor catalog assessment
and schema-change controls remain mandatory.
The proxy-only origin must be a real process/egress identity. A shared
host, node, NAT, or security group is not sufficient.
The warden terminates tagged runaways and maintains an in-process breaker
model; its marker is not an authenticated external channel, and the proxy
does not consume the state to shed new traffic.
The shipped file/HMAC anchor is a Development Anchor. No independently
retained production WORM/transparency Adapter is shipped.
Experimental rehearsal proves a different running PostgreSQL instance,
not DBLab provenance, snapshot freshness, lifecycle governance, or
isolation from external side effects.
Experimental apply/revert commits can precede recovery finalization and
the definitive audit append; a later failure requires reconciliation.
Evidence and documentation
The machine-readable capability registry is the source of truth. CI checks
active documentation against it and the integration matrix exercises the
covered safety suite on PostgreSQL 14–18.