Safe database access for AI agents

Let your agent reach your
production database.

maskdb gives your AI agents read-only, masked access to your real Postgres — without ever handing over the password or exposing sensitive data.

never share the password you choose what's visible sensitive data masked every query audited
What maskdb gives you

Open your database to agents, safely

Point it at any Postgres and hand your agents access you stay in full control of.

🔑

No password sharing

Agents connect with a dedicated token, never your database credentials. Revoke it anytime without touching the database.

🫥

Sensitive data masked

Emails, phone numbers, secrets and free-text are masked before they ever leave the proxy. Raw values never reach the agent.

🎛️

You decide what's visible

Choose exactly which tables and columns each agent can read, and how each one is masked. Everything else stays hidden.

🔒

Read-only by design

Agents can query, never write. No raw SQL is accepted — just safe, structured reads against the data you allow.

🧩

Any Postgres, install nothing

Point it at an existing connection string. No extensions, no replicas, no schema changes — your database is untouched.

📋

Scoped tokens & full audit

Issue per-agent tokens with exactly the access they need, and every query is logged for a complete audit trail.

See it

Real data in, masked data out

The same row, as it lives in your database versus what the agent actually receives.

In your database
idemailphoneapi_key
1042ethan@vm0.ai+1 213 555 0142sk_live_9f3a2b…
1043lancy@vm0.ai+1 213 555 7791sk_live_77c1de…
What the agent sees
idemailphoneapi_key
1042e***@vm0.ai+X XXX XXX 0142••••••••
1043l***@vm0.ai+X XXX XXX 7791••••••••

Mask each column your way — partial reveal, redaction, hashing, or hidden entirely.

How simple it is

Live in three steps

01

Connect your database

Give maskdb a read-only connection string. Nothing is installed or changed on your side.

02

Choose what's visible

Pick the tables and columns agents may read, and set how each sensitive column is masked.

03

Hand out a token

Issue a scoped token to each agent. They query safe, masked data — you keep full control and audit.

Get started

Set it up with your AI — in one paste

maskdb is built for AI agents, so the setup is too. Paste this into your AI assistant (Claude Code, Cursor, …). It registers your account, reads your schema, proposes what to mask, and mints a read-only token for your agents — you just approve.

paste into your AI assistant
Set up maskdb (https://api.maskdb.ai) so my AI agents get safe, read-only,
masked access to my Postgres database. Work step by step. Show me each token
ONCE and tell me to store it in a secret manager — never log full tokens.

API base https://api.maskdb.ai · auth header: Authorization: Bearer <token>

1. Register → admin token.
   POST /v1/accounts {"owner_email":"<MY_EMAIL>"}
   The returned token has scopes ["*"] — my root credential. Tell me to save
   it somewhere safe; it cannot be recovered.

2. Ask me for a READ-ONLY Postgres connection string (recommend a SELECT-only
   role, not an owner). If it has channel_binding=require, drop that and keep
   sslmode=require.
   POST /v1/databases {"name":"prod","connection_string":"<CONN>"}  (Bearer admin)
   → save the db_id. It defaults to allowlist mode (only enabled columns show).

3. Read the raw schema and propose a masking policy.
   GET /v1/databases/<db_id>/schema  (Bearer admin)
   For each column decide enable + mask:
     • ids / foreign keys / timestamps / enums / numbers → enable, mask "none"
     • emails → "email"   · phone numbers → "phone"
     • secrets / tokens / api keys / encrypted_* → "redact"
     • free-text user content (prompts, messages, bodies, notes) → "null"
     • unsure if sensitive → mask it, or leave it disabled (it stays hidden)
   Show me the proposed policy and let me adjust before applying.

4. Apply the policy.
   PUT /v1/databases/<db_id>/policy  (Bearer admin)
   {"tables":[{"table":"...","columns":[{"name":"...","enabled":true,"mask":"..."}]}]}

5. Mint the read-only agent token (this is what I hand to my agents).
   POST /v1/tokens  (Bearer admin)
   {"name":"my-agent","scopes":["db:query","db:metadata"],"databases":["<db_id>"]}

6. Verify with the agent token: run a sample
   POST /v1/databases/<db_id>/query {"table":"...","select":["..."],"limit":3}
   and confirm sensitive columns come back masked, and that this token can
   neither change the policy nor reach other databases.

Never give an agent token policy:write (it could unmask). Keep the admin
token offline. Every query is audited.
your AI · maskdb setup
Press Run preview to watch your AI register, read your schema, mask the sensitive columns, and mint a read-only token — right here.

Give your agents data,
not your secrets.