docs

VaultKit Overview

Applies to: VaultKit 0.9.0-alpha, vkit 1.2.0, Python SDK 0.3.0

VaultKit lets AI agents and people query production data without holding database credentials. Every request is checked against policies you keep in git: the answer is allowed, masked, sent to a person for approval, or denied. Allowed requests get a short-lived grant for that one query, and everything is recorded.

VaultKit is self-hosted: the control plane, the query runtime and your data stay in your infrastructure.


How it works

Agent or person ──► Control plane ──────────► funl ──────────► PostgreSQL
 (vkit, SDK, MCP)   policies, grants,         translates AQL     your database
                    approvals, audit          to SQL, masks,
                                              runs the query
Component What it does
Control plane (Rails) Signs people and agents in, evaluates policies, issues grants, runs approvals, stores encrypted datasource credentials, records the audit log.
funl (Go) The query runtime. Translates AQL into parameterised SQL, applies masking, and runs the query. It only accepts requests signed by the control plane, and isn’t exposed outside the deployment.
Console (React) Web UI for approvals, the team and sign-in settings.
vkit (CLI) Requests, approvals, datasources, schema scans, and building and deploying policy bundles.
Python SDK and MCP server Lets agents query through VaultKit, including from MCP hosts such as Claude Code, Claude Desktop and Cursor.

A request goes through these steps:

  1. Who’s asking. The requester is identified by their login or agent token. Their role, clearance, region and tenant come from their account or token, never from the request.
  2. What it reads. The control plane works out every table and field the query touches, applies the row limit (100 by default, 10,000 at most), and confines tenant-scoped tables to the requester’s tenant.
  3. What policy says. The active policy bundle decides, field by field and table by table. The strongest action wins: deny, then require approval, then mask, then allow.
  4. A grant. If the request is allowed, the control plane issues a grant for exactly that query, signed and time-limited. If it needs approval, it waits for the right people to sign off.
  5. The rows. funl runs the query with the masking applied and returns the rows. The same question asked again while the grant is valid reuses it.

What you can do today

Policies in git

Masking

Approvals

See Approvals and grants.

Grants

Schema discovery

See Schema discovery.

Multi-tenant SaaS data

See Tenant-scoped datasets.

Agents

Organizations and sign-in

Audit


Not yet


Security model


Example: an agent that never sees raw personal data

# config/policies/mask_pii_for_agents.yaml
id: mask_pii_for_agents
description: Agents see personal data hashed in production.
match:
  fields:
    contains: [pii]
context:
  requester_role: agent
  environment: production
action:
  mask: true
  reason: Personal data is hashed for agents.
  ttl: 15m
masking:
  default_method: hash

The agent asks for customer emails through the MCP server and gets SHA-256 hashes. It can still count and group by them, but never sees an address.

Example: break-glass access to payments

# config/policies/payments_need_review.yaml
id: payments_need_review
description: A payments reviewer approves access to payment records in production.
match:
  dataset: payments
  fields:
    any: [id, amount, status, failure_reason]
context:
  environment: production
action:
  require_approval: true
  approver_role: payments_reviewer
  reason: Payment records need sign-off from a payments reviewer.
  ttl: 1h

An engineer’s request is queued. Someone in payments_reviewer approves it in the console, and the engineer reruns the request for rows, valid for an hour, with any masked fields still masked.

Example: one assistant, many customers

An assistant serves each customer from shared tables. Mark the tables with tenant_column: organization_id, and mint a one-hour token per customer session:

vkit agents tokens create --name support-assistant --tenant org_42 --expires-in 1h

Whatever the assistant asks, it only ever reads org_42’s rows.


Next steps