keeper
keeper sits between an agent and your PostgreSQL database. It runs the agent's
SQL and masks the result before the result enters the agent's context. The agent
gets rows it can join and count on. It does not get the personal data inside them.
database → keeper → MCP response → agent context → cloud provider
↑
masking, tokens
keeper pseudonymises. It does not anonymise. Its output is still personal data
under GDPR Article 4(11).
First run
-
Install the plugin in your agent. The plugin starts keeper through a launcher
that downloads the release, checks its checksum and installs it in
~/.local/bin.
Claude Code:
/plugin marketplace add mtch3n/keeper
/plugin install keeper@keeper
Codex: add the same repository as a plugin marketplace and install the
keeper plugin. Check the Codex plugin docs for the exact command in your
Codex version. See "Codex" below for two settings it needs.
If ~/.local/bin is not on your PATH, the plugin still works. Add the
folder to PATH so that your terminal finds keeper:
export PATH="$HOME/.local/bin:$PATH".
The daemon that keeper mcp starts also serves a local dashboard on
127.0.0.1. Run keeper ui in your terminal for a link that opens it: the
link carries a secret that lasts until the daemon stops, and keeper never
opens a browser by itself. A process that runs as your OS user can still read
the daemon's socket, so the secret keeps out other users and sandboxes with
loopback only, not another process of yours.
-
Register a database. Run this in your own terminal, not in the agent:
keeper connect
Paste a PostgreSQL connection string at the hidden prompt, for example
[REDACTED:DB Connection String] keeper makes one profile for that login. The profile reads and masks. It cannot write. With no sslmodein the string, keeper requires TLS unless the host is loopback. An explicitsslmode, including disable, is used for a new host. A host that keeper already holds keeps its own sslmode`: a string that asks for a weaker
mode does not lower it, and keeper refuses a string that would send the login
with less TLS than it asked for or than its default.
-
Ask the agent a question about your data. The agent calls query, and the
rows come back on the same call.
-
In the first result, the email column is a token, for example
⟨email1:a3f21b4c9d8e7f60⟩. Within one session, the same email gives the same
token, so joins, GROUP BY and COUNT(DISTINCT ...) still work. Another
session gets a different token for the same email. The result also names
the one command that changes how a column is masked:
keeper catalog edit <profile> <schema.table.column> --policy allow
keeper classifies columns on its own, by name and type. You do not have to set up
a catalog before the first query.
Profile settings
Each profile has three settings. Change them with keeper connection set, or in
the dashboard (keeper ui).
| Setting | Values | Meaning |
|---|
reads | always, uncertain, never | always: every read asks a person first. uncertain (the default): a read asks when its plan calls a volatile function. never: reads run without a question. |
writes | off, ask, allow | off: a write is refused. ask: a person approves each write and sees the rows it changes. allow: a write runs. |
detection | off, scan, all | scan (the default): pattern detection examines the text of scan columns. all: it also examines the text of allow columns. off: it examines nothing, so scan cells are redacted whole. |
keeper connection set prod --reads uncertain --writes ask --detection scan
keeper connection show prod
Approvals
When a statement needs a person, the agent's client shows a dialog in the
agent's terminal. The same query call then returns the rows after the person
accepts.
- A read: press Enter to run it.
- A write: the person must choose "Run once" or "Refuse". Nothing is
preselected, so a stray Enter does not commit a write.
- Esc, or a client that cannot show a dialog (a headless run), does not decide
the statement. The agent gets a ticket and a local link, which opens nothing until
you have run
keeper ui in a terminal. The ticket waits in the Inbox of the
dashboard, and keeper sends a desktop notification with a link that signs you
in. The agent polls get_result until a person decides.
Declare personal data columns