Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
436 lines (375 loc) · 28.2 KB
/
Copy path.env.example
File metadata and controls
436 lines (375 loc) · 28.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# DashClaw Environment Variables
# Copy this file to .env.local and fill in your values
# ─── REQUIRED ──────────────────────────────────────────────────────────────────
# These must be set for DashClaw to start.
# PostgreSQL connection string
# Local: docker compose up -d db → postgresql://dashclaw:dashclaw@localhost:5432/dashclaw
# Hosted: Neon free tier → https://neon.tech
DATABASE_URL=<YOUR_DATABASE_URL>
# API key that protects /api/* endpoints (maps to org_default)
DASHCLAW_API_KEY=<YOUR_SECRET_API_KEY>
# 32-character string used to encrypt sensitive settings
ENCRYPTION_KEY=<random-32-char-string-here>
# NextAuth base URL and signing secret
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=<random-32-char-secret>
# ─── RECOMMENDED ───────────────────────────────────────────────────────────────
# Password for the local admin account (skip OAuth for solo/self-hosted use)
# DASHCLAW_LOCAL_ADMIN_PASSWORD=<your-strong-password>
# One-time browser sign-in token, machine-managed by `npx dashclaw up`
# (format: <token>.<expiryEpochMs>, consumed on first use). Never set by hand.
# DASHCLAW_LOGIN_OTT=
# Cron endpoint secret (generate: openssl rand -hex 32)
# CRON_SECRET=<random-64-char-hex>
# ─── OPTIONAL: Deployment ──────────────────────────────────────────────────────
# self_host (default) | demo (read-only sandbox for dashclaw.io)
# DASHCLAW_MODE=self_host
# NEXT_PUBLIC_DASHCLAW_MODE=self_host
# Force DB driver: "postgres" (TCP) or "neon" (serverless). Auto-detected by default.
# DASHCLAW_DB_DRIVER=postgres
# Override which org DASHCLAW_API_KEY maps to (default: org_default)
# DASHCLAW_API_KEY_ORG=org_default
# Restrict CORS to your deployment domain
# ALLOWED_ORIGIN=https://your-app.vercel.app
# Self-host on TCP Postgres only: where the middleware reaches its own internal
# key-resolution route. Defaults to loopback on PORT; set explicitly when the
# server binds a nonstandard address. Never a third-party host.
# DASHCLAW_INTERNAL_BASE_URL=http://127.0.0.1:3000
# Trust x-forwarded-for from a reverse proxy for rate limiting
# TRUST_PROXY=false
# Change the HTTP port (default: 3000)
# PORT=3000
# ─── OPTIONAL: Rate Limiting ───────────────────────────────────────────────────
# Distributed rate limiting via Upstash Redis (recommended for multi-instance)
# UPSTASH_REDIS_REST_URL=https://...
# UPSTASH_REDIS_REST_TOKEN=...
# Hard bound on that round trip (one atomic EVAL per request); past it the
# request falls back to the in-memory limiter instead of stalling.
# DASHCLAW_RATE_LIMIT_UPSTASH_TIMEOUT_MS=500
# Per-IP rate limit tuning (in-memory, single-instance)
# DASHCLAW_DISABLE_RATE_LIMIT=true
# DASHCLAW_RATE_LIMIT_WINDOW_MS=60000
# DASHCLAW_RATE_LIMIT_MAX=1000
# Org-keyed rate limit on the guard and record paths (POST /api/guard,
# POST /api/actions). Redis-backed via REDIS_URL when set (counts survive
# serverless cold starts); per-instance memory fallback otherwise.
# DASHCLAW_ORG_RATE_LIMIT_MAX=600
# DASHCLAW_ORG_RATE_LIMIT_WINDOW_MS=60000
# SSRF protection — comma-separated trusted webhook domains
# WEBHOOK_ALLOWED_DOMAINS=slack.com,discord.com
# ─── OPTIONAL: Phase 2 JWT identity verification (JWKS) ─────────────────────────
# When an agent attaches `Authorization: Bearer <JWT>`, DashClaw verifies it
# against the issuer's JWKS ({iss}/.well-known/jwks.json) and a verified token's
# `sub` overrides the self-asserted body agent_id across /api/guard, /api/actions,
# and /api/x402/purchases. No token → identity stays self-asserted (unverified).
#
# REQUIRED to enable verification (v3.7, fail-closed): with no issuer configured,
# bearer tokens never reach `verified` — there is no trust anchor, and the old
# behavior (any issuer with a reachable JWKS accepted) let any API-key holder
# forge "verified" identity. Set it to your IdP to enable verified identity;
# tokens from other issuers → unknown_issuer.
# DASHCLAW_ALLOWED_ISSUER=https://your-idp.example.com
#
# Require this value in the JWT `aud` claim (tokens missing it → failed).
# DASHCLAW_JWT_AUDIENCE=dashclaw
# ─── OPTIONAL: Phase 2b JWT replay protection ──────────────────────────────────
# Closes the capture-and-replay gap left by Phase 2 (signature-only verification).
# Design by @piiiico in issue #120. Only effective when the JWT carries a `jti`
# claim AND verifyJwt returned `verified` (signature OK + not expired + not nbf).
#
# off — skip the replay check entirely (or you run replay protection upstream)
# best_effort — block confirmed replays; allow if jti is missing
# or the store is unreachable (pre-v3.6 fail-soft posture)
# required — default — also block when the store is unreachable or jti is
# missing. Verified-JWT traffic ONLY: API-key callers resolve
# not_applicable and are never touched. Rollback: best_effort.
# DASHCLAW_JTI_REPLAY_PROTECTION=required
#
# Reject JWTs whose exp is more than this many seconds in the future. Tokens
# with very long lifetimes defeat the replay seen-set (it grows unbounded).
# Default 86400 (24h). Allow ±60s skew on the cap.
# DASHCLAW_JTI_MAX_TTL_SECONDS=86400
# ─── OPTIONAL: Phase 2c action binding (issue #121) ────────────────────────────
# Binds a verified token to ONE intended (action, target, goal) tuple via a
# `urn:dashclaw:act-binding` claim, so a token minted to `read` one record can't
# be repurposed to `delete` a different one. Blocking on a MISSING claim needs
# issuer cooperation (the IdP must mint it), so `required` is opt-in. act_status
# is recorded in EVERY mode — even `off` — so operators can see when their
# issuer starts minting bindings (look for act_status='match' in
# guard_decisions) and safely flip to required.
#
# off — record act_status, never block on it
# best_effort — default — block a positive `mismatch` (token bound to a
# different call); issuers that don't mint the claim see zero
# behavior change. Rollback: off.
# required — also block not_present / unsupported_typ / ctx_incomplete on
# verified tokens (opt in only once your issuer mints the claim)
# DASHCLAW_ACT_BINDING=best_effort
#
# Comma-separated list of accepted binding `typ` values. Bump the version
# suffix (action-binding/v2) to invalidate old tokens cleanly.
# DASHCLAW_ACT_BINDING_TYP=action-binding/v1
# ─── OPTIONAL: v3.7 hardening knobs (2026-07-04) ───────────────────────────────
# x402 purchase currencies accepted by /api/x402/purchases (comma-separated,
# case-insensitive). Spend aggregation sums amounts 1:1 against USD budget
# ceilings, so an unknown currency would corrupt budget bookkeeping — unknown
# values are rejected with 400. Default: USDC.
# DASHCLAW_X402_CURRENCIES=USDC
#
# In production, API error responses redact exception detail (`detail`/`code`)
# unless this is set — governed agents are semi-trusted callers and raw driver
# messages leak schema internals. Development keeps full detail either way.
# DASHCLAW_EXPOSE_ERROR_DETAIL=true
# ─── OPTIONAL: Integrity signing key (non_fabrication receipts + signed export) ─
# Ed25519 private JWK used to sign proof receipts and signed compliance bundles.
# LEAVE UNSET for zero-config: the instance auto-generates a key on first use and
# stores it in the server_signing_keys table. Set this only if you want external
# key custody (the value is a JSON Ed25519 private JWK with x and d). The public
# key is published at /.well-known/jwks.json either way.
# DASHCLAW_SIGNING_KEY_JWK={"kty":"OKP","crv":"Ed25519","x":"<base64url>","d":"<base64url>"}
# ─── OPTIONAL: Realtime ────────────────────────────────────────────────────────
# memory (default, single-instance) | redis (cross-instance pub/sub)
# REALTIME_BACKEND=memory
# REDIS_URL=redis://localhost:6379 # fallback alias: REALTIME_REDIS_URL
# REALTIME_REPLAY_WINDOW_SECONDS=600
# REALTIME_REPLAY_MAX_EVENTS=1000
# REALTIME_ENFORCE_REDIS=false
# Max concurrent in-memory SSE subscriber listeners (fallback alias: REALTIME_MAX_LISTENERS)
# REALTIME_MEMORY_MAX_LISTENERS=1000
# ─── OPTIONAL: OAuth Providers ─────────────────────────────────────────────────
# GitHub OAuth — https://github.com/settings/developers
# GITHUB_ID=<your-github-oauth-app-client-id>
# GITHUB_SECRET=<your-github-oauth-app-client-secret>
# Google OAuth — https://console.cloud.google.com/apis/credentials
# GOOGLE_ID=<your-google-oauth-client-id>
# GOOGLE_SECRET=<your-google-oauth-client-secret>
# OIDC Provider (e.g. Authentik, Keycloak)
# OIDC_ISSUER_URL=<your-oidc-issuer-url>
# OIDC_CLIENT_ID=<your-oidc-client-id>
# OIDC_CLIENT_SECRET=<your-oidc-client-secret>
# OIDC_DISPLAY_NAME=Authentik
# Explicit endpoint overrides — required for Authentik; set all three together:
# OIDC_AUTHORIZATION_URL=<your-oidc-authorization-endpoint>
# OIDC_TOKEN_URL=<your-oidc-token-endpoint>
# OIDC_USERINFO_URL=<your-oidc-userinfo-endpoint>
# ─── OPTIONAL: Billing ─────────────────────────────────────────────────────────
# Stripe — https://dashboard.stripe.com/apikeys
# STRIPE_SECRET_KEY=<your-stripe-secret-key>
# NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=<your-stripe-publishable-key>
# STRIPE_WEBHOOK_SECRET=<your-stripe-webhook-signing-secret>
# STRIPE_PRICE_INDIE=<price_xxx> # v5.14 hosted paid tier: $49/mo Indie price id
# STRIPE_PRICE_TEAM=<price_xxx> # v5.14 hosted paid tier: $199/mo Team price id
# Public base URL for Stripe checkout/portal redirects (defaults to http://localhost:3000 if unset)
# NEXT_PUBLIC_APP_URL=https://your-app.vercel.app
# ─── OPTIONAL: Alerts ──────────────────────────────────────────────────────────
# Resend email alerts — https://resend.com
# RESEND_API_KEY=<your-resend-api-key>
# ALERT_FROM_EMAIL=alerts@example.com
# ─── OPTIONAL: Analytics ───────────────────────────────────────────────────────
# Vercel Web Analytics (auto-enabled on Vercel; opt-in elsewhere)
# NEXT_PUBLIC_ENABLE_VERCEL_ANALYTICS=true
# ─── OPTIONAL: Agent Security ──────────────────────────────────────────────────
# Require signed agent actions (true by default in production)
# ENFORCE_AGENT_SIGNATURES=true
# Require agents to be pre-registered before submitting actions
# DASHCLAW_CLOSED_ENROLLMENT=false
# Minutes before an agent pairing request expires (default 15). Raise this for
# admin enrollment flows where the approver isn't standing by to approve.
# DASHCLAW_PAIRING_TTL_MINUTES=15
# Prompt-injection scanning runs on every guard evaluation by default.
# Set to true to disable it (security-relevant — leave unset to keep scanning on).
# DISABLE_PROMPT_INJECTION_SCAN=true
# ─── OPTIONAL: Claude Code Hook + SDK clients ─────────────────────────────────
# Used by hooks/dashclaw_pretool.py, hooks/dashclaw_posttool.py,
# hooks/dashclaw_stop.py, hooks/enforcement_liveness_probe.py,
# scripts/install-hooks.mjs, examples/, and the SDK
# starter snippets. DASHCLAW_BASE_URL points at YOUR DashClaw instance —
# typically https://my-dashclaw.vercel.app or http://localhost:3000.
# DASHCLAW_BASE_URL=http://localhost:3000
# DASHCLAW_URL=http://localhost:3000 # Legacy alias — MCP server + older docs
# DASHCLAW_AGENT_ID=claude-code
# DASHCLAW_HOOK_MODE=enforce # enforce | observe — observe logs verdicts but stops NOTHING, machine-wide for every session using this hook install (hooks walk up from the hook file's directory to find .env). /approvals + /decisions show a red banner while it's set.
# DASHCLAW_REQUIRE_EXECUTION_CLAIMS=0 # Set to 1 only after the server supports claim_protocol: 1. Legacy servers retain ordinary guard/approval enforcement; advertised claims always require a valid acknowledgement.
# DASHCLAW_ENV_FILE_DISABLE=1 # Isolated scripts/CI only: use explicit process configuration without loading repository env files.
# DASHCLAW_LIVENESS_PROBE_DISABLED=1 # set to disable the SessionStart enforcement-liveness probe
# DASHCLAW_PERMISSION_MODE=danger # danger | safer (controls bash classification strictness)
# DASHCLAW_GUARD_TIMEOUT=2.5 # seconds — guard call timeout
# DASHCLAW_GUARD_RETRIES=0 # extra guard attempts after the first (default 0 = one attempt; set 2 for flaky networks)
# DASHCLAW_GUARD_CONNECT_TIMEOUT=2 # seconds — TCP preflight bound when the instance recently probed unreachable
# DASHCLAW_APPROVAL_TIMEOUT=30 # seconds — Stop hook approval poll timeout
# DASHCLAW_SCRIPT_EXEC_TTL_MINUTES=60 # minutes a session-written file stays "recent" for script-then-execute content grading (written-paths ledger TTL)
# Controls hook behavior when /api/guard is unreachable (network failure, instance down).
# Values: block (default, fail closed — destructive actions blocked during outage),
# warn (proceed with a loud stderr warning — actions logged for backfill),
# allow (proceed silently — not recommended, defeats the audit promise).
# All outages write to ~/.dashclaw/orphan-actions.jsonl for backfill on recovery.
# DASHCLAW_GUARD_UNAVAILABLE_POLICY=block
# Narrowing this below the default raises a red "Governance scope narrowed"
# signal naming the categories that stopped being watched — an excluded category
# never reaches the server, so without that signal its absence is invisible.
# DASHCLAW_GOVERNED_CATEGORIES=execution,orchestration,file_io,interactive,mcp
# DASHCLAW_WORKSPACE=/path/to/your/project # Optional override; defaults to cwd
# Containment Verdicts (allow_contained) — stages an eligible file/shell mutation
# into a per-session git worktree instead of the working tree, for later operator
# promote/discard. See hooks/README.md and docs/architecture/runtime-api.md.
# DASHCLAW_CONTAINMENT=1 # 0 = full kill switch; treats allow_contained as require_approval
# DASHCLAW_CONTAINMENT_REWRITE=1 # 0 = always fall back to an instructive deny instead of rewriting the tool call in place
# DASHCLAW_CONTAINMENT_DIFF_CAP_BYTES=1500000 # cap on the staged-diff artifact size, in bytes
# Database containment (basis db_branch) — the same shape for a Postgres mutation:
# the command runs against an ephemeral Neon branch of the target database, and
# Promote replays the original command on production. Off unless NEON_API_KEY is
# set. See docs/rfcs/2026-09-04-database-containment.md and hooks/README.md.
# NEON_API_KEY=<YOUR_NEON_API_KEY> # Neon personal/org API key; no key = the hook never advertises allow_contained:db (today's behavior)
# NEON_PROJECT_ID=<YOUR_NEON_PROJECT_ID> # optional: skips the project lookup that resolves your endpoint
# DASHCLAW_DB_CONTAINMENT=1 # 0 = DB-only kill switch (DASHCLAW_CONTAINMENT=0 still disables both media)
# DASHCLAW_DB_CONTAINMENT_TTL_HOURS=72 # branch expiry; Neon deletes the contained branch itself when it lapses
# ─── OPTIONAL: Claude Code Code Sessions (transcript capture) ───────────────────
# ON BY DEFAULT, metadata-only. The Stop hook ships each turn's session METADATA
# (token counts, models, timestamps, tool names/ids, safe path fields — prompt
# and file text is stripped before it leaves your machine) to
# /api/code-sessions/ingest-jsonl for cost/token/cache analytics and the
# end-of-turn recap line. View captured sessions at /code-sessions.
# Opt out entirely:
# DASHCLAW_CODE_SESSIONS_ENABLED=0
# Explicitly opt IN to shipping full transcript content (previous behavior):
# DASHCLAW_CODE_SESSIONS_CONTENT=full
#
# Capture EVERY project on your machine (not just this repo) without writing your
# API key into global config: run `node scripts/install-hooks.mjs --global`. It
# installs a capture-only Stop hook into ~/.claude/settings.json that points back
# at this repo's hooks/dashclaw_stop.py, which reads these vars from this file.
# ─── OPTIONAL: Behavior Learning / Policy Coach (passive local recorder) ────────
# Opt-in. When set, the Pre/PostToolUse hooks write REDACTED, LOCAL-ONLY behavior
# samples to .dashclaw/behavior-samples/<date>.jsonl. The Policy Coach (/policy-coach)
# analyzes them into evidence-backed policy suggestions. Observe-only — nothing is
# enforced, nothing is uploaded. Secrets/keys/env values are scrubbed before write.
# In Claude Code settings.json, set this in the "env" block as a STRING ("1");
# in this .env file, the bare KEY=1 form below is correct. Accepts 1|true|yes.
# DASHCLAW_BEHAVIOR_SAMPLES_ENABLED=1
# DASHCLAW_BEHAVIOR_SAMPLES_DIR=/path/to/.dashclaw/behavior-samples # default: <workspace>/.dashclaw/behavior-samples
# To capture OTHER projects and view them in this instance's Policy Coach, set the
# SAME absolute DASHCLAW_BEHAVIOR_SAMPLES_DIR in BOTH the hook env (settings.json)
# and this server .env.local — otherwise samples land in each project's local
# .dashclaw/ and the UI (which reads this app's cwd) won't see them. .dashclaw/ is gitignored.
#
# "Learning in the background" on a HOSTED dashboard: a serverless instance can't
# read your local samples, so when the recorder is on, the Stop hook pushes a
# SAFE AGGREGATE snapshot (counts/tallies/signals/timestamps — never command
# shapes, paths, or goals) to /api/behavior/insights so the hosted Policy Coach
# can show DashClaw is alive and learning. Raw behavior still never leaves the
# machine. On by default when the recorder is on; opt out with the line below.
# DASHCLAW_BEHAVIOR_INSIGHTS=0
#
# OPT-IN anonymized sample upload (default OFF — absent means off): when set on
# the agent machine, the Stop hook uploads ANONYMIZED samples (goals/projects/
# agent names dropped; session + paths replaced with salted hashes; command
# operands masked) to /api/behavior/samples/ingest so a HOSTED Policy Coach can
# run the full suggestions → simulate → adopt flow. The salt derives from your
# API key and never leaves the machine.
# DASHCLAW_BEHAVIOR_UPLOAD=1
# ─── OPTIONAL: Semantic Guard (required for semantic_check policies) ────────────
# Without a key, semantic_check policies fall back to require_approval (safe middle path).
# Set GUARD_LLM_KEY to a dedicated key (preferred), or OPENAI_API_KEY / ANTHROPIC_API_KEY as fallbacks.
# GUARD_LLM_KEY=sk-...
# OPENAI_API_KEY=sk-...
# ANTHROPIC_API_KEY=sk-ant-...
# GOOGLE_AI_API_KEY=... # also enables Google as an LLM-as-judge provider for eval scorers
# GUARD_LLM_BASE_URL=https://api.openai.com/v1
# GUARD_LLM_MODEL=gpt-4o-mini
# ─── OPTIONAL: Guard degradation contract ───────────────────────────────────────
# What the guard returns when it cannot complete an evaluation (webhook
# timeout/failure, semantic LLM failure, evaluation deadline exceeded).
# Default: require_approval (fail closed). Per-policy rules (on_timeout,
# fallback) override this global. "allow" restores the old fail-open behavior
# (self-hoster escape hatch); "block" is the strictest posture.
# DASHCLAW_GUARD_FALLBACK=require_approval
# Policy-evaluation deadline in ms (default 3500). The hooks give the whole
# guard HTTP call 5s with zero retries — keep this safely under that budget.
# DASHCLAW_GUARD_DEADLINE_MS=3500
# Client-side (hooks + MCP server, not this server): what governed clients do
# when this instance is UNREACHABLE. Default block (fail closed); allow = the
# self-hoster escape hatch. Full contract: docs/guard-enforcement-contract.md
# DASHCLAW_GUARD_UNAVAILABLE_POLICY=block
# ─── OPTIONAL: Tuning knobs ────────────────────────────────────────────────────
# DASHCLAW_DB_POOL_MAX=10 # Postgres pool max connections (default 10)
# AGENT_ONLINE_WINDOW_MS=120000 # ms an agent counts as "online" since last heartbeat (default 120000)
# GUARD_WEBHOOK_SECRET=<random> # HMAC secret for outbound guard webhook signing
# DASHCLAW_INTERRUPT_BUDGET=10 # org setting (settings table) — approval interrupts per policy per window before flood collapse
# DASHCLAW_INTERRUPT_WINDOW_MIN=15 # flood window in minutes
# DASHCLAW_INTERRUPT_BUDGET_FLEET=30 # fleet-wide interrupt budget per window
# DASHCLAW_DIGEST_INTERVAL_HOURS=24 # fleet digest cadence (0 disables); needs notification adapter creds
# DASHCLAW_WITNESS_WINDOW_MINUTES=60 # silent-lane witness window in minutes (clamped to a sane range)
# ─── OPTIONAL: Startup smoke (npm run startup:smoke; CI runs it on every push) ──
# STARTUP_SMOKE_BASE_URL=http://127.0.0.1:3100 # base URL of the instance under test
# STARTUP_SMOKE_TIMEOUT_MS=45000 # how long to wait for a healthy server
# STARTUP_SMOKE_INTERVAL_MS=1000 # health poll interval
# STARTUP_SMOKE_SKIP_POLICY=1 # skip the policy smoke section
# STARTUP_SMOKE_SKIP_CROSS_ORG=1 # skip the cross-org isolation smoke
# STARTUP_SMOKE_SKIP_CANARY=1 # skip the write-canary gate
# ─── OPTIONAL: Telegram approval bridge ────────────────────────────────────────
# Feature is off when TELEGRAM_BOT_TOKEN is unset. Run `dashclaw install telegram`
# (or `npm run telegram:setup` from a repo clone) to populate.
# TELEGRAM_BOT_TOKEN= # from @BotFather
# TELEGRAM_ADMIN_CHAT_ID= # numeric chat ID allowed to approve
# TELEGRAM_WEBHOOK_SECRET= # 32+ random chars; verifies inbound callbacks (openssl rand -hex 32)
# TELEGRAM_APPROVER_ORG_ID= # org id — auto-discovered via DASHCLAW_API_KEY by the setup wizard
# DASHCLAW_ALERTS_TELEGRAM=false # explicit kill-switch when token is present
# ─── OPTIONAL: Discord approval bridge ─────────────────────────────────────────
# Feature is off when DISCORD_BOT_TOKEN is unset. Registration is a Developer Portal UI step.
# DISCORD_BOT_TOKEN= # from Discord Developer Portal -> Bot -> Reset Token
# DISCORD_PUBLIC_KEY= # 64-char hex from Developer Portal -> General Information
# DISCORD_APPROVER_USER_ID= # numeric Discord user ID allowed to approve
# DISCORD_APPROVER_ORG_ID= # org id — same value as TELEGRAM_APPROVER_ORG_ID in single-admin setups
# DASHCLAW_ALERTS_DISCORD=false # explicit kill-switch when token is present
# Optional: Discord webhook URL for launch-window new-connect alerts (DOG-04 telemetry).
# Fires once per org on its first /connect completion. Payload is masked
# org_id + agent_id + timestamp — no secrets, no PII. Distinct from
# DASHCLAW_ALERTS_DISCORD (which is the bridge kill-switch, not a URL).
# DASHCLAW_NEW_CONNECT_WEBHOOK=
# ─── OPTIONAL: Hosted provisioning (operator-only, self-host deploys leave OFF) ──
# When DASHCLAW_HOSTED=true the deployment exposes /api/hosted/* routes that
# mint trial workspaces on demand. Self-host users should leave this unset —
# they create orgs via /api/orgs with their own admin API key.
# DASHCLAW_HOSTED=false
# TURNSTILE_SECRET_KEY= # Cloudflare Turnstile secret; unset = dev bypass
# NEXT_PUBLIC_TURNSTILE_SITE_KEY= # Client-side Turnstile widget site key (pairs with TURNSTILE_SECRET_KEY)
# HOSTED_TRIAL_DAYS=30 # Trial duration in days
# HOSTED_TRIAL_ACTION_CAP=10000 # Max governed actions per trial
# HOSTED_MAX_ACTIVE_TRIALS=500 # Global cap on concurrent active trials (cost circuit breaker); default 500 (0/blank -> 500)
# HOSTED_PROVISION_MAX_PER_IP_PER_DAY=5 # Per-IP provisioning rate limit (rolling day)
# HOSTED_CLEANUP_SECRET= # Shared secret for cron-invoked /api/hosted/cleanup (X-Cleanup-Secret header)
# HOSTED_DRILL_TOKEN= # v8.3 stranger drill: >=24-char random value; x-hosted-drill-token header substitutes for Turnstile on mint (force-labeled source=drill, still rate-limited). Unset = no bypass exists.
# CLAIM_DRILL_BASE_URL= # v5.13 claim drill (npm run drill:claim): target instance base URL (default http://localhost:3000); also needs HOSTED_DRILL_TOKEN, NEXTAUTH_SECRET, and DATABASE_URL of that instance.
# HOSTED_ADMIN_API_KEY= # v8.3 stranger drill (npm run drill:hosted): admin key for immediate drill-trial teardown; unset = drill trials auto-expire (drill-labeled)
# CRON_SECRET= # Vercel cron auth (Authorization: Bearer); pairs with /api/hosted/cleanup
# DASHCLAW_SYNTHETIC_RETENTION_DAYS=7 # /api/cron/synthetic-sweep: delete synthetic-agent action_records older than N days (default 7)
# DASHCLAW_SYNTHETIC_SWEEP_ORG=org_default # /api/cron/synthetic-sweep: org to sweep (single-org by design; test/test-% could be a real tenant agent elsewhere)
# HOSTED_SMOKE_BASE_URL= # Default URL for `npm run hosted:smoke`
# NEXT_PUBLIC_HOSTED_TRIAL_URL= # Marketing-site CTA target for the hosted trial (e.g. https://hosted.dashclaw.io); unset = same-origin CTA
# ─── OPTIONAL: Self-governance proof surface (v7.3) ─────────────────────────
# Two sides of the /proof marketing page; both default OFF.
# Source instance (the one that governs this repo's maintenance): opt in to
# expose GET /api/self-governance — aggregate-only counts, no org identifiers,
# no free-text columns (spec: docs/superpowers/specs/2026-07-05-self-governance-proof-v73.md).
# Instance-wide aggregates: multi-tenant instances should leave this unset.
# DASHCLAW_SELF_GOVERNANCE_PUBLIC=false
# Marketing deployment (www): absolute URL of the source instance's endpoint;
# unset = /proof renders its honest "live evidence unavailable" state.
# SELF_GOVERNANCE_SOURCE_URL=
# ─── OPTIONAL: Live host canary (v3.4) ──────────────────────────────────────
# Which org's canary runs the PUBLIC /setup page renders. The hourly
# live-canary GitHub Actions cron files verdicts via POST /api/live-canary;
# only runs filed under this org appear on /setup#live-canary (check text is
# free-form, so the public page never renders other tenants' writes).
# DASHCLAW_CANARY_ORG_ID=org_default
# Origins the canary script (scripts/live-canary.mjs) probes:
# LIVE_CANARY_MARKETING_ORIGIN=https://www.dashclaw.io
# LIVE_CANARY_HOSTED_ORIGIN=https://hosted.dashclaw.io
# The reporting pair (LIVE_CANARY_REPORT_URL / LIVE_CANARY_REPORT_KEY) are GitHub
# Actions repository secrets read by .github/workflows/live-canary.yml — not .env vars.
# ─── OPTIONAL: Desktop Presence tile on /widget (DashClaw Pulse) ────────────
# Directory of the machine-local OpenClaw desktop-presence store (state.json +
# latest.jpg). Same env var the presence CLI honors. Unset = ~/.openclaw/
# desktop-presence. Missing or unreadable store renders as "unknown" — the
# widget never fakes a live verdict. Hosted deployments leave this unset.
# OPENCLAW_DESKTOP_PRESENCE_DIR=