Skip to content

Configuration reference ​

Every setting can be given as a flag, an env var, or a key in the YAML file (--config); precedence is flag > env > file. Secret values never travel as flags: *-env flags hold the name of the env var that contains the secret, *-file flags point to a file (private keys must be 0600).

FlagEnvDefaultDescription
--access-log-flush-intervalKARHUTLASQL_ACCESS_LOG_FLUSH_INTERVAL30saccess-history flush interval to the archive
--allowed-directoriesKARHUTLASQL_ALLOWED_DIRECTORIES—paths/URL prefixes DuckDB may access (COPY/read_*/ATTACH), e.g. /data/export/,s3://lake/; anything else is rejected
--archive-dirKARHUTLASQL_ARCHIVE_DIR—access-history & report archive in a local directory (dev; not WORM)
--archive-retentionKARHUTLASQL_ARCHIVE_RETENTION87600h0m0sCOMPLIANCE object-lock retention for archive objects (default 10 years)
--archive-s3-access-key-envKARHUTLASQL_ARCHIVE_S3_ACCESS_KEY_ENVKARHUTLASQL_ARCHIVE_ACCESS_KEYname of the env var holding the archive S3 access key
--archive-s3-bucketKARHUTLASQL_ARCHIVE_S3_BUCKET—archive bucket (object-lock enabled)
--archive-s3-endpointKARHUTLASQL_ARCHIVE_S3_ENDPOINT—archive S3/MinIO endpoint (host:port); bucket must have object-lock
--archive-s3-insecureKARHUTLASQL_ARCHIVE_S3_INSECUREfalsearchive S3 over plain http (dev)
--archive-s3-regionKARHUTLASQL_ARCHIVE_S3_REGIONus-east-1archive bucket region
--archive-s3-secret-key-envKARHUTLASQL_ARCHIVE_S3_SECRET_KEY_ENVKARHUTLASQL_ARCHIVE_SECRET_KEYname of the env var holding the archive S3 secret key
--audit-log-dirKARHUTLASQL_AUDIT_LOG_DIR—daily audit log directory (0600); empty = stdout
--audit-log-sqlKARHUTLASQL_AUDIT_LOG_SQLfalseinclude SQL text in the audit log (default SHA-256 only; beware of PII)
--backup-intervalKARHUTLASQL_BACKUP_INTERVAL0sscheduled backup interval to the archive (EXPORT DATABASE of DuckDB catalogs + DuckLake snapshots); 0 = only the backup DoAction
--backup-retention-dailyKARHUTLASQL_BACKUP_RETENTION_DAILY168h0m0sobject-lock retention of daily backups
--backup-retention-monthlyKARHUTLASQL_BACKUP_RETENTION_MONTHLY9600h0m0sobject-lock retention of monthly backups (1st of the month UTC)
--backup-retention-weeklyKARHUTLASQL_BACKUP_RETENTION_WEEKLY840h0m0sobject-lock retention of weekly backups (Sunday UTC)
--backup-staging-dirKARHUTLASQL_BACKUP_STAGING_DIR—temporary local directory for EXPORT (added to allowed-directories automatically); default <state-dir>/backup-staging
--classification-fileKARHUTLASQL_CLASSIFICATION_FILE—classification YAML (column tags + masks, G-03); empty = no masking. Reload: SIGHUP
--configKARHUTLASQL_CONFIG—YAML config file (precedence: flag > env > file)
--database-filenameKARHUTLASQL_DATABASE_FILENAME—.duckdb file; empty = in-memory
--dq-max-ageKARHUTLASQL_DQ_MAX_AGE26h0m0sreport DQ gate: the GX validation of each source table must be younger than this; 0 = gate disabled
--duckdb-secrets-fileKARHUTLASQL_DUCKDB_SECRETS_FILE—YAML of DuckDB TEMPORARY SECRETs injected by the server (secret values from env; scope must be inside allowed-directories)
--four-eyesKARHUTLASQL_FOUR_EYEStruepolicy/classification changes take effect after 2 approvals by different admins (G-11)
--health-check-queryKARHUTLASQL_HEALTH_CHECK_QUERYSELECT 1query for gRPC health and /healthz
--hostKARHUTLASQL_HOST0.0.0.0listen address
--http-allowed-originsKARHUTLASQL_HTTP_ALLOWED_ORIGINS—browser origins allowed to call the HTTP query endpoint (CORS), e.g. https://dash.bank.local; empty = no CORS
--http-portKARHUTLASQL_HTTP_PORT0HTTP Arrow IPC query endpoint port (POST /api/v1/query, Bearer or Basic; TLS follows gRPC) for web apps and notebooks; 0 = disabled
--http-uiKARHUTLASQL_HTTP_UItrueserve the web UI (SQL editor, tables, sessions, history, jobs) at / on --http-port
--init-sql-fileKARHUTLASQL_INIT_SQL_FILE—SQL file executed at startup (INSTALL/LOAD/ATTACH)
--jobs-fileKARHUTLASQL_JOBS_FILE—YAML of scheduled jobs (cron): signed report runs and materialized table refreshes, each run as identity job:<name> granted via policy subjects; needs --policy-file
--jwt-private-key-fileKARHUTLASQL_JWT_PRIVATE_KEY_FILE—RSA PEM key (0600) for RS256; replaces HS256
--jwt-secret-envKARHUTLASQL_JWT_SECRET_ENVKARHUTLASQL_JWT_SECRETname of the env var holding the HS256 secret (≥ 32 bytes); empty = random per process
--jwt-ttlKARHUTLASQL_JWT_TTL8h0m0stoken lifetime (max 24h)
--log-levelKARHUTLASQL_LOG_LEVELinfodebug|info|warn|error
--mask-hmac-key-envKARHUTLASQL_MASK_HMAC_KEY_ENVKARHUTLASQL_MASK_KEYname of the env var holding the HMAC key for the hash_hmac mask (≥ 32 bytes)
--max-concurrentKARHUTLASQL_MAX_CONCURRENT8concurrently running statements in the default resource group; 0 = unlimited
--mcp-max-rowsKARHUTLASQL_MCP_MAX_ROWS500row limit per MCP tool result (on top of the ai_sandbox profile limits)
--mcp-portKARHUTLASQL_MCP_PORT0MCP Streamable HTTP server port (/mcp, Bearer token; TLS follows gRPC) for AI agents; 0 = disabled
--mcp-resource-urlKARHUTLASQL_MCP_RESOURCE_URL—public URL of the MCP endpoint (e.g. https://kq.bank.local:8443/mcp) for RFC 9728 OAuth metadata; empty = no metadata
--metrics-portKARHUTLASQL_METRICS_PORT9090admin HTTP port (/healthz); 0 = disabled
--migrations-catalogKARHUTLASQL_MIGRATIONS_CATALOG—catalog of the karhutla_schema_migrations tracking table; empty = default catalog
--migrations-dirKARHUTLASQL_MIGRATIONS_DIR—directory of <version>_<name>.sql schema migrations applied at startup (once, in order, one transaction per file)
--mtls-caKARHUTLASQL_MTLS_CA—CA PEM to verify client certificates (mTLS required when set)
--oidc-audienceKARHUTLASQL_OIDC_AUDIENCEkarhutlasqlvalue required in the aud claim of OIDC tokens
--oidc-groups-claimKARHUTLASQL_OIDC_GROUPS_CLAIMgroupsOIDC groups claim
--oidc-issuerKARHUTLASQL_OIDC_ISSUER—OIDC issuer (Keycloak/Entra/Okta); empty = OIDC disabled
--oidc-username-claimKARHUTLASQL_OIDC_USERNAME_CLAIMpreferred_usernameOIDC user name claim (falls back to sub)
--otel-endpointKARHUTLASQL_OTEL_ENDPOINT—OTLP gRPC collector (host:port) for OpenTelemetry tracing; auth headers via env OTEL_EXPORTER_OTLP_HEADERS; empty = disabled
--otel-insecureKARHUTLASQL_OTEL_INSECUREfalseOTLP without TLS (dev)
--otel-sample-ratioKARHUTLASQL_OTEL_SAMPLE_RATIO1sampling ratio for new traces (0..1); traces from clients follow the parent decision
--password-envKARHUTLASQL_PASSWORD_ENVKARHUTLASQL_PASSWORDname of the env var holding the password (plaintext or bcrypt hash)
--pg-portKARHUTLASQL_PG_PORT0PostgreSQL wire-protocol port for Postgres-only tools (psql, Power BI/Npgsql, ODBC, JDBC pg); same auth, governance and audit as Flight SQL; TLS follows gRPC; 0 = disabled
--policy-fileKARHUTLASQL_POLICY_FILE—policy YAML (spec §5.3); empty = only the local user, as admin (dev). Reload: SIGHUP
--portKARHUTLASQL_PORT31337Flight SQL gRPC port
--print-queriesKARHUTLASQL_PRINT_QUERIESfalselog SQL text
--query-profilingKARHUTLASQL_QUERY_PROFILINGfalseper-statement DuckDB profiling for peak memory & plan hash in karhutla_query_history() (costly: +~13% TPC-H SF10 time, ADR 33)
--query-timeoutKARHUTLASQL_QUERY_TIMEOUT0statement execution limit in seconds; 0 = unlimited
--queue-sizeKARHUTLASQL_QUEUE_SIZE64statements allowed to queue in the default resource group; full → RESOURCE_EXHAUSTED
--queue-timeoutKARHUTLASQL_QUEUE_TIMEOUT1m0smax wait for a slot in the default resource group; 0 = unlimited
--rate-burstKARHUTLASQL_RATE_BURST20rate limit token bucket burst
--rate-limitKARHUTLASQL_RATE_LIMIT0RPC requests per second per user (token bucket); 0 = disabled
--report-signing-key-fileKARHUTLASQL_REPORT_SIGNING_KEY_FILE—Ed25519 PKCS#8 PEM private key (0600) that signs report manifests
--report-signing-vault-keyKARHUTLASQL_REPORT_SIGNING_VAULT_KEY—Ed25519 key in Vault Transit <mount>/<name> (replaces --report-signing-key-file; env VAULT_ADDR, VAULT_TOKEN, VAULT_NAMESPACE, VAULT_CACERT)
--reports-fileKARHUTLASQL_REPORTS_FILE—report definitions (reports.yaml) for karhutla_report_run()
--result-cache-max-bytesKARHUTLASQL_RESULT_CACHE_MAX_BYTES268435456total byte limit of the result cache (LRU)
--result-cache-max-entry-bytesKARHUTLASQL_RESULT_CACHE_MAX_ENTRY_BYTES20971520results larger than this are not cached
--result-cache-ttlKARHUTLASQL_RESULT_CACHE_TTL0slifetime of SELECT results in the result cache (per identity, invalidated when data changes); 0 = disabled
--revocation-sync-intervalKARHUTLASQL_REVOCATION_SYNC_INTERVAL5sinterval for syncing session kills across instances via the archive (revocations/); applies when an archive is configured
--session-idle-timeoutKARHUTLASQL_SESSION_IDLE_TIMEOUT1h0m0sidle sessions are dropped from the registry (their statement/prepared handles go with them)
--sharing-dirKARHUTLASQL_SHARING_DIR—directory for exported Parquet files (0700); default <state-dir>/sharing
--sharing-endpointKARHUTLASQL_SHARING_ENDPOINT—public base URL of the sharing endpoint for file URLs, e.g. https://kq.bank.local:8444/delta-sharing; empty = from the request Host
--sharing-fileKARHUTLASQL_SHARING_FILE—YAML of Delta Sharing recipients (token sha256) and shares; exports run as identity share:<recipient> granted via policy subjects; served under /delta-sharing on --http-port; needs --policy-file
--sharing-file-ttlKARHUTLASQL_SHARING_FILE_TTL15m0slifetime of signed file URLs and exported files
--slow-query-thresholdKARHUTLASQL_SLOW_QUERY_THRESHOLD10sexecutions (excluding queueing) at least this long are logged as slow_query; 0 = disabled
--state-dirKARHUTLASQL_STATE_DIR—server state directory (policy approvals, 0700); default <database dir>/karhutlasql-state
--streaming-buffer-sizeKARHUTLASQL_STREAMING_BUFFER_SIZE64MBDuckDB streaming result buffer per statement (memory bound for results not yet read by the client); 0 = fully materialize (ADR 34)
--tls-certKARHUTLASQL_TLS_CERT—server certificate PEM
--tls-keyKARHUTLASQL_TLS_KEY—server key PEM (0600)
--tls-self-signedKARHUTLASQL_TLS_SELF_SIGNEDfalseTLS with an in-memory self-signed certificate (dev/container; client --tls-skip-verify)
--uc-advertised-endpointKARHUTLASQL_UC_ADVERTISED_ENDPOINT—Flight SQL endpoint for the karhutla.endpoint property; empty = grpc[+tls]😕/host:port
--uc-endpointKARHUTLASQL_UC_ENDPOINT—Unity Catalog OSS URL (e.g. http://uc:8080) for one-way metadata sync; empty = disabled
--uc-sync-intervalKARHUTLASQL_UC_SYNC_INTERVAL15m0sfull sync interval to Unity Catalog
--uc-token-envKARHUTLASQL_UC_TOKEN_ENVKARHUTLASQL_UC_TOKENname of the env var holding the Unity Catalog bearer token (optional)
--usernameKARHUTLASQL_USERNAME—local user (required)
--vault-token-fileKARHUTLASQL_VAULT_TOKEN_FILE—Vault token file (e.g. a Vault Agent sink, 0600; re-read on every signature); empty = env VAULT_TOKEN
--verified-queries-fileKARHUTLASQL_VERIFIED_QUERIES_FILE—YAML of verified queries + semantic model (karhutla_verified_queries(), MCP resources)

Released under the Apache 2.0 License.