Skip to main content
Every connection to Airhouse authenticates as a user, and every user has one role. Airhouse checks the role on every statement before the statement reaches the query engine.

Authentication

Airhouse uses SCRAM-SHA-256 password authentication, the same mechanism as modern PostgreSQL. Standard drivers support it out of the box. Credentials come from one of three places: Passwords for database users and minted credentials are stored as SCRAM verifiers, never in plain text.

Roles

A statement your role doesn’t allow is rejected with SQLSTATE 42501 before it runs:
A reader may run only queries: SELECT (including WITH, FROM-first and PIVOT with an IN list), SHOW, DESCRIBE, SUMMARIZE and plain EXPLAIN of one, over the tenant’s tables and views, using built-in functions and types that only compute. It may also send what Postgres drivers send while connecting (the client session settings such as SET extra_float_digits = 3) and transaction control (BEGIN, COMMIT, ROLLBACK). Everything else is refused, however it is dressed: each query is parsed by the engine itself and checked against allowlists, so a comment in front of a write, a batch that starts with a SELECT, WITH … INSERT, EXPLAIN ANALYZE, a PRAGMA, CALL, SET of anything else, USE, ATTACH, INSTALL/LOAD, a function that reads files or runs SQL (read_csv, query, postgres_execute), DuckLake’s maintenance functions, a table name the engine would read as a file or URL, and a type that would load an extension are all refused. Writers can’t create, alter, or drop tables, and that holds however the statement is dressed: a comment in front of the DDL (which some tools, dbt among them, add to every query) or a read before it in the same batch doesn’t change what it is. Nor can a writer change tables or the catalog through a function or a copy: DuckLake’s maintenance functions (ducklake_expire_snapshots, ducklake_set_option and the like, however they’re called), postgres_execute and postgres_query, dbgen and dsdgen, IMPORT DATABASE and COPY FROM DATABASE need an admin. Have an admin create the tables your pipelines write to, or mint a schema-scoped writer, which may run DDL inside its own schemas.
Follow least privilege: give dashboards and analysts reader, give ingestion pipelines writer, and keep admin for the people who manage table structure.

When a role can’t be determined

If Airhouse can’t determine the role for a session (for example, because the credential expired or was revoked before the session’s first query), it closes the connection rather than running with reduced privileges. Reconnect with a valid credential. Your driver’s normal reconnect logic handles this.

TLS

When the server has a certificate and key configured (see [tls] in the configuration reference), clients can connect over TLS:
Use sslmode=require or stricter in every client that connects over a network you don’t control.

Static users for self-hosted setups

When you run Airhouse without the Admin API, you can define users in the configuration file:
airhouse.toml
Or with the AIRHOUSE_USERS environment variable, as comma-separated name:password:role entries:
If you manage users with the Admin API, don’t also define static users. Static users are checked first and aren’t tied to a single database.
Name every user you intend to admit. With static users configured, a username that isn’t in the list can’t run queries. If no users are configured at all and the Admin API isn’t enabled, any username that presents the server’s default password ([auth] password, or AIRHOUSE_PASSWORD) connects with full admin rights. Only run that way on your own machine.