Operate

Configuration

All configuration is via environment variables. The common ones, grouped.

Core & capture

VariableDefaultPurpose
GMONK_DATABASE_URLlocal gmonkPostgres connection for gmonk's own store.
GMONK_TARGET_URLThe database to protect (target for protect-db).
GMONK_CONFIGPath to your gmonk.config.mjs (compensations + executors).
GMONK_TENANT_IDdefaultTenant id for the RLS seam.
GMONK_SQL_CAPTUREonKill-switch for SQL capture.
GMONK_WAL / GMONK_WAL_SLOToff / gmonk_slotEnable WAL capture; slot name.
GMONK_RECORD_READSoffAlso record read-only tool calls (fuller audit).

Object store

VariablePurpose
GMONK_S3_BUCKET (_REGION, _ENDPOINT, _FORCE_PATH_STYLE)Use S3/MinIO for before-images (recommended for production).
GMONK_OBJECT_STORELocal FS path for before-images when no bucket is set (mount a volume).
GMONK_OBJECT_ALLOW_BUCKETSFail-closed allowlist — comma/space list of bucket or bucket/prefix.

Gate, policy & shell

VariableDefaultPurpose
GMONK_GATEadviseadvise · block · guarantee · off.
GMONK_GATE_WARN_BELOWmanualBand floor to warn at-or-below.
GMONK_GATE_BLOCK_BELOWimpossibleBand floor to block (block mode).
GMONK_GATE_GUARANTEE_UNPROVABLEholdGuarantee mode when undo can't be proven: hold · block.
GMONK_POLICY_FILEJSON file of extra guard rules.
GMONK_GUARD_DEFAULTSonoff drops the built-in DROP/TRUNCATE/no-WHERE blocks.
GMONK_SHELL_GATEaskask · deny · off.
GMONK_SHELL_ALLOWComma-separated regexes that always run.

Backend TLS

VariableDefaultPurpose
GMONK_PG_BACKEND_TLS / GMONK_MYSQL_BACKEND_TLShost-awaredisable·prefer·require·verify. Remote → require, loopback → prefer. Per-URL ?sslmode= wins.
GMONK_PG_BACKEND_CA / GMONK_MYSQL_BACKEND_CAsystem CAsCA bundle (inline PEM or path) for verify.

Capture hook (Claude Code)

VariableDefaultPurpose
GMONK_HOOK_TOKENautoBearer token for the fast /hook-ingest endpoint. "" disables it.
GMONK_HOOK_TOKEN_FILE~/.gmonk/hook-tokenWhere the auto token is stored.
GMONK_HOOK_ENDPOINTonoff disables the fast HTTP hook (falls back to spawn).
GMONK_HOOK_WATCHDOG_MS8000Hard upper bound on hook work.

Alerts & approvals

VariableDefaultPurpose
GMONK_ALERT_WEBHOOKURL to POST alerts to (e.g. a Slack incoming webhook).
GMONK_ALERT_EVENTSrequire_approval, block, recoverability_degraded/lost, out_of_bandComma list of events that fire an alert.
GMONK_SLACK_SIGNING_SECRET / GMONK_SLACK_APP_TOKENInteractive Slack approve/deny (HTTP / Socket Mode).
GMONK_APPROVAL_TIMEOUT_MS300000How long a held action waits for a decision (5 min).

Review UI & auth

VariableDefaultPurpose
GMONK_WEB_TOKENIf set, the UI requires it on every API call.
GMONK_WEB_ALLOW_NONLOOPBACK0Allow binding off-loopback without a token (behind a trusted proxy only).
GMONK_OIDC_*SSO/OIDC login (_ISSUER, _CLIENT_ID, _REDIRECT_URI, …). Validate with gmonk sso-check.