N6k – Let users and agents run untrusted SQL on production databases
GitHub has released n6kd, a new tool that enables people and AI agents to query multiple databases using SQL through a single interface with customizable access controls.
The open-source tool, available on GitHub, allows users to run n6kd locally on datasets like NYC data while controlling which rows clients can see and modify. No account is needed for basic use, and it can be quickly installed on Linux or macOS arm64 systems using a simple curl command.
One of the key features is the ability to let AI agents query the databases. Users can point an MCP (Model Context Protocol) agent such as Claude Code at the quickstart server, which will operate under the same access limits as any other client.
Data Integration
N6KD enables combining data from multiple sources in one process. Users can serve a BigQuery dataset alongside local tables and join across them, with cloud credentials remaining securely on the server. This requires a Google Cloud project setup.
For organizations needing row-level security, the tool supports OIDC authentication to sign clients in, ensuring each user sees and edits only their own data rows. This requires an OIDC issuer configuration.
Protocol Options
The tool operates primarily over the n6k protocol via WebSocket, but also offers a quack protocol option. Quack provides a different model where one database is shared by all clients using a single token, with no user management or JWT claims. However, quack's ATTACH cannot run UPDATE or DELETE operations, which must be sent through quack_query functions.
N6KD can be built using Go and requires specific DuckDB extensions like vcatbridge from duckdb-virtual-catalog and n6k_client/n6k_server from duckdb-n6k-protocol. The tool includes commands for installation, self-testing, and serving over different protocols.