A query can be valid and read-only while the full agent session still becomes unsafe. ValkDB limits cumulative access by session, not just individual queries.
Run ValkDB locally against synthetic Postgres data. No production database required. No external connection string required. No hosted ValkDB required. No cloud trust required.
A human asks one query. An agent keeps asking. Each query may pass RLS, read-only access, and validation. The session can still consume more data than intended.
Each query is valid. The behavior is the problem.
ValkDB complements your existing stack. It does not replace it.
Use RLS. Use read replicas. Then add a session budget.
The complete control loop for agent database access.
Track which agent, session, and task is querying. Budget scoped to logical identity, not database connection.
Cumulative row limits and query counts per time window. Warning at 80%. Blocked at limit. Budgets are enforced across the session, not just per request.
AST-level tracking of every table and column accessed, including through aliases, CTEs, and subqueries.
Active → Warning (≥80%) → Exhausted. Clear status at every point. No ambiguity about where the session stands.
Further queries from the exhausted session are blocked until the budget window resets. No ambiguity. Hard enforcement.
Query hashes and decision metadata. No raw SQL stored in production. No query results stored. Traceability without exposure.
Monitoring tells you what the agent did. ValkDB lets you decide when it must stop.
ValkDB does not store query results. In production hash-only mode, raw SQL is not stored by default; audit logs store query hashes and decision metadata.
ValkDB should be used alongside scoped DB credentials, RLS, read replicas, and least-privilege access.
Watch an agent consume its budget until blocked.
ValkDB blocked the session because the agent kept asking.
Audit log records: query_hash + decision + block_reason + budget state. No raw SQL.
Run ValkDB locally against synthetic Postgres data. No production database required. No external connection string required. No hosted ValkDB required.
What you run, in order:
curl -O https://valkdb.dev/downloads/valkdb-local-preview.tar.gz tar -xzf valkdb-local-preview.tar.gz cd valkdb-local-preview-* cp local.env.example .env.local docker compose -f docker-compose.local.yml up -d bash scripts/init_local_preview.sh SUPERSONIC_API_KEY=<printed-by-init> bash scripts/local_smoke.sh
What the local smoke prints when the breaker fires:
[SMOKE] query accepted [SMOKE] budget incremented [SMOKE] budget exhausted [SMOKE] session blocked [SMOKE] OK
The body of the blocked query:
{
"ok": false,
"error": {
"code": "BUDGET_EXHAUSTED",
"reason": "session_query_limit_exceeded",
"action": "session_blocked",
"agent_id": "demo-agent",
"session_id": "demo-session",
"queries": { "used": 10, "limit": 10, "remaining": 0 },
"rows": { "used": 50, "limit": 1000, "remaining": 950 },
"retryable": false
}
}