Security model
Guarantees that do not depend on the policy
Section titled “Guarantees that do not depend on the policy”- Locked configuration: after startup, clients cannot change DuckDB settings.
- No external access by default:
read_*,COPY ... TOand newATTACHes are blocked, except for--allowed-pathprefixes. - No extension loading: autoinstall, autoload and community extensions are off.
- Always denied:
ATTACH,DETACH,LOAD,INSTALLandUPDATE EXTENSIONS. - Fail-closed inspection: the verb found by the tokenizer must match the
type DuckDB prepared; anything unmodelled is
resolved: false. - One statement per request, rejected before anything executes otherwise.
- A new connection per request: TEMP tables, variables and
USEnever leak between users. - One transaction per request: inspection, authorization and execution see the same snapshot.
- Clean environment: variables referenced in the catalog are removed from the process after startup.
- Documents stay local unless
--jev-keyis set: then search sends the question and candidate semantic documents to TypeSafe, never table data or query results. - No metadata in errors: binder hints that could name hidden objects are stripped from responses.
- One pipeline for both transports: Flight SQL calls go through the same authentication, lockouts, policy, protections, limits and audit as HTTP. Statement handles and tickets carry the request itself and grant nothing: every redemption is authorized again for the caller. The Flight database tree lists only what the user could query, and catalog views stay blocked.
- Flight SQL is off by default: without
--flight-listennothing listens on a second port. - Delegation never borrows the key’s roles: a
delegating key must name an identity on every
data request, gets only the roles
identities:maps to it, and is read-only for SQL whatever the policy says. Semantic document writes needdocs_write: trueand the effective identity’sdocs_allowpermission. A missing or refused identity is a 403, never a fallback to the key. - Filters and SQL masks are single expressions: a row filter or
{"sql": ...}mask that could escape its parentheses, or holds;, comments or dollar quotes, is refused.
Agent discovery and document scope
Section titled “Agent discovery and document scope”By default, --serve-skill docs exposes discovery and skill documentation
without authentication. Scripts come from GitHub pinned to the server version.
--serve-skill all also serves executable scripts, over TLS or to loopback
only; off disables both routes. See AI agents.
Semantic documents default to --docs-scope all: every authenticated user
can read every document. schema limits visibility using query permissions,
but a document matching one readable table may also mention unreadable ones;
its text is not redacted. Access annotations describe that split. Name
validation reads the full catalog, so writers may learn whether a name exists.
See Scope and access.
How inspection is verified
Section titled “How inspection is verified”Authorization is only as good as the inspection that feeds it. A differential fuzzer checks it against DuckDB’s real behavior:
- execute each generated statement;
- snapshot every catalog (rows, columns, tables, views, schemas, sequences, macros) before and after;
- fail if a changed object is missing from the
targetsof an inspection markedresolved.
CI runs the seed corpus and an exhaustive sweep; a weekly job fuzzes for 10
minutes. Findings so far, all fixed with regression tests: a bypass with
$$...$$, ALTER ... RENAME TO missing the new name, memory.t resolved
in the wrong catalog, and invalid UTF-8 names breaking DuckDB’s metadata.
Row filters and masks have their own differential test.
Known limitations
Section titled “Known limitations”- Materialized results: the whole result is materialized inside DuckDB
before the first row is sent. Use
--memory-limit,--temp-dirand--max-rows. - Bind before authorization: binding happens before the policy runs.
With remote sources such as
iceberg_scan('s3://...')inside--allowed-path, an error message can reveal whether a table exists. - Iceberg latency without
cache_ttl: 0.3–1 s per request on R2. - Audit on crash: a crash between a write’s commit and its audit event can lose that event.
- Delegating services are a trust boundary: whoever holds a delegating
key can assert any identity its policy rules accept. Scope the rules to
input.actor; see Trust model.
Reporting a vulnerability
Section titled “Reporting a vulnerability”Please report privately as described in SECURITY.md.
Multi-tenant isolation in v0.9.0
Section titled “Multi-tenant isolation in v0.9.0”Database listings in /v1/databases, /v1/schema and Flight SQL hide
inaccessible catalogs; Flight catalog selection enforces the same boundary.
Per-user concurrency is enforced before a request joins the global queue.
Dynamic SQL through postgres_query and postgres_execute is blocked.
Native MCP uses the existing HTTP authorization and protection pipeline. Local DuckDB views over protected local tables can now be rewritten recursively; unverifiable indirect reads still fail closed.