VergGate
VergGate: AI agents on your servers
An AI coding agent that can read your logs and your data can fix a bug in minutes. One that holds a broad token can also delete a database in seconds, and has done so at real companies. VergGate gives the agent a way in that cannot do that: its own identity, a grant that says exactly what it may read on which server, and a server that checks every call itself.
The console is a mailbox. It checks what it can so you and the agent get a plain answer at once, and then your server decides, again, by itself. Agents here read. There is no verb that restarts, deploys, writes or runs a command, so there is nothing for a hijacked agent to misuse.
Set it up in three steps
A server needs agent 1.12.0 or newer on Linux with OpenSSL 3, and operations on (see Operations). db.query also needs psql (postgresql-client) on that server.
- Root, on each server, once. Agents are off until root allows them, and root sets the most any agent may ever do there. Operations come first (how operations work), then agents, then a database profile if the agent needs SQL.
sudo verg-agent allow operations --operator owner-mac ed25519:YOUR-KEY sudo verg-agent allow agents --verbs "inventory.scan app.status app.logs db.query" --apps shop sudo verg-agent allow database shop --profile support --tables orders,refunds --columns customers:id,country - You, on the machine that runs the agent. The agent makes its own key; only the public half reaches the console. Then give it a grant on a server. The grant is staged here, an operator signs it on their own computer, and the server holds it.
verg agent create shop-debug verg agent grant shop-debug --node web-1 --verbs "app.status app.logs db.query" --apps shop --profiles support --days 7 verg agent sign gr_...The same works in the console: add the agent, open it, pick the server and what it may do, and copy the sign command it shows with the exact grant text.
- Connect your coding assistant, one line. It then has tools for status, logs and queries, signed with the agent's own key.
claude mcp add verg -- verg mcp --agent shop-debugCodex, in
~/.codex/config.toml:[mcp_servers.verg] command = "verg" args = ["mcp", "--agent", "shop-debug"]Cursor, in
~/.cursor/mcp.json:{ "mcpServers": { "verg": { "command": "verg", "args": ["mcp", "--agent", "shop-debug"] } } }
What an agent can do
| Verb | What the server sends back |
|---|---|
inventory.scan | What runs on the machine: services, timers, listening ports, containers, Caddy sites and disk use. |
app.status | The state of one app: its services, its containers, its live release and the releases kept for rollback, by name. |
app.logs | The last lines of an app's logs, or of its last deploy, with every secret value of the app hidden before a line leaves the machine. |
db.query | One SELECT against a database profile root made on the machine: a Postgres role that may read only the tables and columns root named, run as a cursor inside a read-only transaction, at most 1,000 rows and 256 KiB. |
inventory.scan shows the whole machine (every service, port, container and site name), not only the apps of the grant, so grant it only where that is fine. Logs are read only for the apps root mapped, and before a line leaves the server every value of the app's secrets and env files, and common shapes of keys and passwords, are replaced by ***.
A grant names the verbs, the apps (for logs and status), the database profiles (for SQL), how many calls an hour and queries a minute, and an end time at most 30 days away. Each server holds its own grant for each agent. The server refuses a grant, or a call, that goes past what root allowed, and it counts every call itself, whatever the console says.
What it cannot do
| Someone with | Can | Cannot |
|---|---|---|
| A prompt injection that reaches the agent (a log line, an issue, a web page) | Make the agent call anything its grants allow, and read rows and log lines the grant lets it read. What it reads can leave through the agent's other tools, so give each job its own profile with only the columns it needs. | Run a verb outside the grant, write SQL, read a table or column outside the profile, run a command, restart, deploy or delete anything: no such verb exists. |
| A stolen agent key | Use the grants of that agent, within their rates, until they end (30 days at most) or you suspend the agent. | Widen a grant, make a new one, reach a server it has no grant on, or keep working after it is suspended or revoked. |
| The console itself, taken over | Hold calls back, show a page that is not true, see the answers that pass through it, suspend agents. | Make a call in an agent's name (its key is on its own machine), make or widen a grant (an operator signs those, on a computer the console cannot reach), go past root's ceiling, or edit what a server logs. |
| Root on one server | Everything on that server. | Reach another server: grants, keys and profiles belong to one machine each. |
How the SQL guard works
The console never parses SQL and never trusts it. Postgres on your server is the guard, in three layers, and it is root who sets them up.
- The role.
verg-agent allow databasemakes a Postgres role that can read only the tables and columns root names. It may open two connections, its transactions are read only by default, a statement is cut off after 5 seconds, and an idle transaction after 10. Its password stays in a root file on that machine. A function can read what its owner can, so a profile refuses to be made when the role could run aSECURITY DEFINERfunction or one in an untrusted language, or when the database hasdblink,postgres_fdw,http,pg_netor another foreign data wrapper, unless root says yes (--allow-functions,--allow-fdw), and then the agent can read whatever those functions return; it prints theREVOKElines that make it safe without saying yes. Every query checks the functions again, so one added later by a migration stops the queries instead of opening a door. - The text. One statement of 8 KiB at most, with no semicolon, no backslash and no control characters, so a psql command cannot hide in it. The server checks it against the SHA-256 the agent signed.
- The transaction. A no-shell user runs
BEGIN READ ONLY, declares the query as a cursor (which takes a SELECT and nothing that changes data), fetches the rows and rolls back. Answers stop at 1,000 rows, 256 KiB, and 2 KiB for a cell; the answer says when there are more.
What a read-only query can still do, said plainly: read the system catalogs (names of tables, columns and databases), take advisory locks, use up to 5 seconds of processor time per query on two connections at most, and hold a read lock that makes a migration wait for those seconds. It cannot write, change a setting for others, or read rows the role has no grant on.
The kill switch and the automatic revoke
- Suspend one agent, or Stop all agents, from the console or the API. The console stops relaying its calls at once and sends each server holding a grant a request that needs no signature, because taking power away is always safe. A server answers it within a few seconds. A suspension opens a VergMind incident that says who or what did it and why, and it ends only when an operator signs a new grant. Sign it at least two minutes after the suspension: a server takes only a grant signed after it stopped the agent, with room for clocks that differ.
- Revoke ends an agent for good: its grants are deleted on every server and its key is refused.
- On the server,
sudo verg-agent deny agentsremoves every grant on that machine, whatever the console says. - Automatic revoke, on every plan. The console suspends an agent by itself when it has 5 refused calls within a minute, when it asked 3 times in ten minutes for something outside its grant, or when its calls in a minute pass 60 or 5 times its usual rate. A server also suspends a grant by itself after 10 refusals in 10 minutes, and the console then suspends the agent on every server, so a console that hid a burst could not keep an agent running.
What is logged, and what is never kept
Every call is a row in Activity: the time, the agent, the server, the verb, its arguments, the decision and the reason in plain words, a one line summary of the result, and how long it took. The text of a SQL query stays with its row, for the history days of your plan. The rows and log lines the server answers with are handed to the agent once and then deleted from the console; an answer nobody took is deleted after 15 minutes. VergGate never receives prompts or transcripts. Each server also keeps its own log of every decision, which the console cannot reach.
Plans
Starter: 3 agents, 20,000 calls a month, 3 database profiles. Team: 15 agents, 200,000 calls a month, 15 database profiles. Business: 100 agents, 2,000,000 calls a month, 100 database profiles. Reads, read-only SQL, the kill switch and the automatic revoke are in every plan. Agents are counted until revoked, and a month's calls are counted from the first of the month, UTC. At the limit, new agents and new calls are refused with a plain sentence; nothing running on your servers stops.
The API
People use a workspace key: reads need a read key, changes a read and write key. Agents have no key; each call is signed with the agent's own Ed25519 key, so the call itself is the credential.
GET /v1/gate/agents every agent
POST /v1/gate/agents register one: name, public_key, client
GET /v1/gate/agents/{agent} one agent with its grants and their exact text
POST /v1/gate/agents/{agent}/grants stage a grant: node, verbs, apps, profiles, days, calls_hour, queries_minute
GET /v1/gate/grants/{id} one grant, with its text and what its server says about it
POST /v1/gate/agents/{agent}/suspend suspend
POST /v1/gate/agents/{agent}/revoke revoke
POST /v1/gate/stop-all suspend every active agent
GET /v1/gate/activity calls and refusals; ?agent= ?node= ?limit=
POST /v1/gate/calls an agent's call: {"request", "signature", "sql"}
GET /v1/gate/calls/{id} the state of a call that was still running
GET /v1/gate/self the agent, and the grants it can use nowA call is the same one-line canonical JSON as an operator's request, in version 2, with the agent and the grant named and signed by the agent's key. It waits up to 25 seconds for the server's answer and returns it, signed by the server, or answers 202 and lets the agent ask again. The two GET calls carry Authorization: VergAgent AGENT_ID.UNIX_SECONDS.SIGNATURE, where the signature is over verg-agent-auth v1 METHOD PATH UNIX_SECONDS, accepted within 2 minutes of our clock.
{"agent":"agt_3f2a91c2d4e5b6a7c8d9e0f1","args":{"app":"shop","lines":"200","source":"app"},"grant":"gr_8c1e4b7a9d2f6e0a3c5b7d19","id":"op_5d0e8a7b3c1f9e2d4a6b8c0e","issued_at":"2026-11-30T11:02:00Z","node":"nod_8c1e4b7a9d2f","not_after":"2026-11-30T11:07:00Z","signer":"SHA256:If4x36FU...","v":2,"verb":"app.logs"}Staging a grant when the server would refuse it answers 409 with the command root runs, for example sudo verg-agent allow agents --verbs "app.logs". The full description is in openapi.json.