How to Configure DuckDB Service Account
You set up a duckdb service account by pairing a host identity with storage keys. Because the engine runs in your app, it has no built-in user table. Data teams often assign one shared cloud role to run automated jobs. When that role has broad permissions, any query can read or change sensitive files. A mistake in a script can expose private records or delete whole buckets. How a duckdb service account works in practice This database engine runs inside your host process as an embedded library
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You set up a duckdb service account by pairing a host identity with storage keys. Because the engine runs in your app, it has no built-in user table. Data teams often assign one shared cloud role to run automated jobs. When that role has broad permissions, any query can read or change sensitive files. A mistake in a script can expose private records or delete whole buckets.
How a duckdb service account works in practice
This database engine runs inside your host process as an embedded library. It does not run a separate background server that checks user names and passwords. Instead, your operating system or cloud platform controls who can run the process. To set up a machine identity, you first create a dedicated Linux user. You can also create an identity role in your cloud provider.
Next, you grant that identity permission to read specific local folders or object buckets. The engine uses storage extensions to read parquet or CSV files over the network. You load cloud keys into the session using the secret manager feature. The secret manager reads environment variables or fetches temporary tokens from local host metadata. Once the session has valid keys, the engine pulls data blocks into local memory. Every query inside that process shares the exact same storage permissions.
What native storage roles solve and what they miss
Cloud roles and file permissions decide which buckets or folders a machine can open. They stop outside servers from reading your raw parquet files or local database files. They also let cloud admins rotate keys on a set schedule. This setup works well when one single script needs full access to one bucket.
Still, storage permissions cannot inspect individual SQL statements once the session starts. If a role can read a file, it can read every column inside it by default. Storage rules cannot block a sudden table drop or a massive data export. They also cannot rewrite sensitive fields like emails, phone numbers, or card numbers. When ten analysts or bots share one machine role, cloud logs show one identity. You cannot tell which person or job ran a specific query. You also cannot require a quick team approval before a risky statement runs.
Service-to-Service Authentication + Service Account Governance: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Managing shared analytics sessions at scale
Data teams often run shared worker nodes for scheduled reports and AI agents. Each worker loads the same storage secrets to query large cloud buckets. Over time, teams add more bucket paths to that single machine role. Soon, one worker identity holds read and write keys for all company data.
Splitting the workload into dozens of tiny roles creates heavy upkeep for platform engineers. Teams have to update job configs every time a new bucket appears. Yet keeping one giant role leaves raw customer fields exposed to every query. Masking rules that rewrite national IDs or card numbers in results help reduce exposure. Statement-level checks and clear user logs also help teams keep tight control over data.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev sits inline in the protocol beside each supported service as an open-source proxy, a sidecar for your database or API. For every query or command an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human approval.
First, hoop.dev guardrails block banned queries before they run or hold risky ones for review, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Does this database engine have native user accounts?
No, the open-source engine runs in-process and lacks a built-in user and role system. You manage access through operating system permissions or cloud storage roles.
How should automated jobs store cloud storage keys?
Avoid hardcoding keys in SQL scripts or plain text files on disk. Use attached cloud machine roles or inject short-lived environment variables at runtime.
Can I restrict a worker to read-only queries?
Yes, you can open local database files in read-only mode when starting the session. For cloud files, assign a storage role that only permits downloading objects.
Related guides
In this post