Open
Free · Apache-2.0To evaluate, develop with and use the whole ecosystem.
- All seven extensions, open source
- Public image with PostgreSQL 19 RC2 (preview)
- Installable from PGXN on your own PostgreSQL 18 or 19
- Support through GitHub issues
Editions
What each one includes, the control plane, and the questions a decision-maker asks.
Editions
To evaluate, develop with and use the whole ecosystem.
To run the gate and its guards in production on a supported base.
LatamFlows is a Red Hat partner; container certification is the next step.
The piece that makes MCP unnecessary
The agent loop on pg_agent_gate, with no MCP: the model writes SQL and the database decides.
It connects a model to PostgreSQL over the database’s own protocol, through the gate. It works with pg_agent_gate 0.4.0 or later. If your client only speaks MCP, the same gate can be used over MCP; ygg-agent is the path without that intermediary.
pip install ygg-agent
Enterprise · ygg Control · in development
ygg Control is the control plane of the Enterprise edition. It gathers what every AI agent proposed, what the database kept and what it stopped, across all your databases, in a hash-chained record. If anyone edits or deletes a row, the verifier gives it away. The console only reads: neither it nor its API can write.
| # | Database | Agent | Action | Outcome | Rows | Chained hash |
|---|---|---|---|---|---|---|
| 01 | prod-orders | assistant | proposes · DROP TABLE orders | refused kept | — | … |
| 02 | prod-orders | assistant | proposes · DELETE FROM orders | passed kept | — | … |
| 03 | prod-orders | assistant | executes · DELETE FROM orders | aborted kept | 8 | … |
| 04 | prod-orders | assistant | executes · UPDATE orders SET total = 999 WHERE id = 1 | kept kept | 1 | … |
| 05 | staging-billing | reporter | executes · UPDATE invoices SET status = 'sent' WHERE id = 418 | kept kept | 1 | … |
| 06 | staging-billing | reporter | proposes · ALTER TABLE invoices DROP COLUMN tax | refused kept | — | … |
$ POST /api/audit_event {"database_id": 1, "source_kind": "proposal", …}
✓ HTTP 401 Unauthorized · the API role can only read
Simulated in the browser. This is how the real API (PostgREST with a role without INSERT, UPDATE or DELETE) answered in the test of 2026-10-27.
What it includes
Its own PostgreSQL with an append-only record: every event carries the SHA-256 hash of the previous one, per database, and a trigger rejects any UPDATE or DELETE. verify_chain() walks the chain and says exactly where it broke.
Reads the proposals and executions pg_agent_gate already records in each database, by watermark, and pours them into the record without duplicates. In production it connects with a read-only role.
The console shows the fleet, every agent and every act. Its API enters the database with a role that can only read: trying to write answers 401. Only the console faces the world; the API stays internal.
Roadmap
Audit and compliance: the record, the connector and the console.
Human in the loop: approve or reject before anything is kept, on top of the gate's propose / commit.
Central fleet policy, SSO and roles.
Early access
Request early access with your company email. We will contact you to set up a session on a trial environment, with the console and the gate running.
No public price yet. What you see above is a reproduction in your browser of the same algorithm the product uses, on sample data; it is not a real database or customer data.
Questions from the people who decide
Short answers, each with a link to where the detail lives. If your question is not here, write to us.
ContactNot through any client path: it is enforced by hooks inside the server, and in a session registered as an agent nothing executes except the gate’s seven verbs. Who can switch it off is a superuser, or whoever edits postgresql.conf; that is why the gate refuses to register a superuser role as an agent.
Threat model →With any of them. The AI only needs to produce SQL: it arrives through psql, a driver, or an MCP shim with no power of its own. There is no SDK to integrate and no service to run in front of the database.
Writing one statement and letting the database decide took a median of 6 s per task. With the same gate behind both, the agent without MCP used 5x fewer prompt tokens than through MCP (24k vs 126k for 13 tasks) and finished each task 13x faster: a median of 14 s against 185 s, on a CPU-only CI runner anyone can re-run. Measured with pg_agent_gate 0.4.0.
See the run →No. The application keeps connecting as it always has. Only the sessions of the roles you register as agents go through the gate; for the rest of the database nothing changes.
It bounds what the agent names (the statement and the rows it changes) and the row count. It does not judge intent: a mass UPDATE the role is entitled to make is kept, confined by row-level security. What it does not cover is written down, before you find out yourself.
What it does not cover →The code is open, with adversarial tests and fuzzing on every push. The public image is a preview (PostgreSQL 19 release candidate) and must not be exposed to the internet. For production there is the Enterprise edition, on PostgreSQL 18 and Red Hat’s PostgreSQL image, with support.
If the effect exceeds the agent’s limit or breaks an assertion, it is undone and the reason is recorded. If it is within bounds, it is kept with the before and after of up to 50 rows. The record cannot be edited or deleted; it survives pg_dump.
Through the gate, none: everything runs inside your PostgreSQL and talks to no external service. The AI model is whichever you choose, local or not; the vector memory of pg_phasevec (a 0.x preview) lives in your database too.
pg_agent_gate needs PostgreSQL 18 or later (dry_run uses RETURNING old/new). Each of the other extensions states its own requirement in its README; the public image 0.3.6 ships six (all but pg_recall_guard) on 19 and the Enterprise edition runs on 18.
The seven extensions are free, under Apache-2.0, forever. The Enterprise edition and the services are quoted per case; there is no public price yet, and when there is you will read it here.
Contact
Enterprise edition, security audit or agent-to-database integration: one email with two lines about your case is enough. We answer in English and Spanish.
manu@latamflows.com A person reads the email. If you would rather write directly, the address is above.
The seven extensions, the image and the contributions to PostgreSQL core are signed by Manuel Reyes Bravo, from Chile. To talk code, repositories or the PostgreSQL lists, his personal email:
Personal email
manuelreyesbravo@gmail.com Also through GitHub issues: pg_agent_gate/issues