{
  "title": "FourIA Secrets Registry",
  "description": "Canonical registry of all secrets used across FourIA projects. The x-registry section defines every expected secret (name, type, permissions, environments). SECRETS.yaml stores the actual values. The validation script reads both to check local config and connectivity.",
  "comment": "To add a new secret: add an entry to x-registry below, then fill the value in SECRETS.yaml",
  "x-registry": {
    "LERMA_API_TOKEN": {
      "type": "token",
      "description": "Lerma provisioning token. Full-scope: DNS, Workers, Access, R2, AI Gateway, Analytics, Containers (incl. registry credentials), and Email Sending (used as the SMTP password for invitation emails). Requires the Containers Write permission so the dashboard can list registry versions (ImageRegistry) and pull the worker bundle (RegistryBundle) at provisioning time.",
      "scope": [
        "Workers Scripts Write",
        "DNS Write",
        "Access: Apps and Policies Write",
        "Access: Service Tokens Write",
        "R2 Storage Write",
        "AI Gateway Write",
        "Analytics Read",
        "Workers Containers Write",
        "Email Sending Write"
      ],
      "environments": ["local", "staging", "production"],
      "connectivity_environments": ["staging", "production"],
      "used_by": ["lerma", "iac-lerma", "iac-fouria", "ci-cd"],
      "github_secret_name": "LERMA_API_TOKEN",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Cloudflare API token (Bearer)",
      "connectivity_test": {
        "type": "cf_permission_check",
        "expected_permissions": [
          "Workers Scripts Write",
          "DNS Write",
          "Access: Apps and Policies Write",
          "Workers Containers Write",
          "Email Sending Write"
        ]
      },
      "notes": "Mapped to transient CLOUDFLARE_API_TOKEN env var in CI steps that call OpenTofu, since Tofu's Cloudflare provider reads that name. Regenerate with Containers Write (and the CF registry default registry configured) for the registry-credentials flow to succeed (403 Authentication error otherwise).",
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"]
    },
    "TF_VAR_healthcheck_tunnel_api_token": {
      "type": "token",
      "description": "Least-privilege Cloudflare API token used only to create/update the staging Lerma healthcheck Tunnel and DNS record through OpenTofu.",
      "scope": ["Cloudflare Tunnel:Edit", "paso4.io Zone DNS:Edit"],
      "environments": ["staging"],
      "used_by": ["iac-lerma"],
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Cloudflare API token (Bearer)",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env.staging"],
      "notes": "Set as TF_VAR_healthcheck_tunnel_api_token for the staging OpenTofu workspace only. Keep this separate from the broader LERMA_API_TOKEN and do not pass it to the Lerma app or cloudflared sidecar."
    },
    "BILLING_INGEST_TOKEN": {
      "type": "secret",
      "description": "Bearer token guarding the internal Lerma billing API: L2 action ingest (POST /api/credits/v1/ingest) and the L5 reconcile/usage endpoints (POST /api/credits/v1/reconcile, GET /api/credits/v1/usage/:id). When unset the endpoints fail closed (401).",
      "environments": ["local", "staging", "production"],
      "used_by": ["lerma", "ci-cd"],
      "github_secret_name": "BILLING_INGEST_TOKEN",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Opaque shared bearer secret (generate with `openssl rand -hex 32`)",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"],
      "notes": "Requires NO Cloudflare API permissions \u2014 this is not a Cloudflare API token. It is an opaque shared bearer secret that authorizes only the bearer-guarded internal billing routes (L2 ingest + L5 reconcile/usage); those routes fail closed (401) when it is unset. Generate with `openssl rand -hex 32`. Rotate by updating the value in the caller (queue consumer / operator tooling / e2e) and in Lerma's environment; there is no scope to change."
    },
    "INTERNAL_DISPATCH_INVALIDATE_TOKEN": {
      "type": "secret",
      "description": "Bearer lerma sends on the dispatch worker's /_invalidate/:slug and internal action routes so freeze/unfreeze/upgrade invalidate the dispatch routing cache.",
      "environments": ["staging", "production"],
      "used_by": ["lerma", "dispatch", "ci-cd"],
      "github_secret_name": "INTERNAL_DISPATCH_INVALIDATE_TOKEN",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Opaque shared bearer secret",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"],
      "notes": "Must equal the dispatch worker's internal bearer (hardcoded `internal-fouria-dispatch-key` in workers/fouria-dispatch/src/index.ts). When empty, lerma's cache invalidation fails (logged) and routing changes may not take effect until the dispatch cache TTL expires."
    },
    "LERMA_STAGING_HEALTHCHECK_TUNNEL_TOKEN": {
      "type": "secret",
      "description": "Remote-managed Cloudflare Tunnel token used by the staging Lerma cloudflared sidecar for the health-only hostname.",
      "environments": ["staging"],
      "used_by": ["cloudflared", "lerma-deploy"],
      "github_secret_name": "LERMA_STAGING_HEALTHCHECK_TUNNEL_TOKEN",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Cloudflare Tunnel run token retrieved from the staging tunnel after creation",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env.staging"],
      "notes": "The Ansible deploy writes this value to the root-only Docker Compose env file for the cloudflared sidecar. It is not passed into the Lerma Phoenix application. The tunnel routes only lerma-health-dev.paso4.io/health to the app; all other paths return 404."
    },
    "PROVISIONING_API_KEY": {
      "type": "secret",
      "description": "Optional platform-wide bearer key for Lerma's provisioning and AI Gateway APIs. Per-application keys can authorize provisioning upgrade/status requests; all routes fail closed when no matching key is supplied.",
      "environments": ["staging", "production"],
      "used_by": ["lerma"],
      "github_secret_name": "PROVISIONING_API_KEY",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Opaque shared bearer secret (openssl rand -hex 32)",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"],
      "notes": "This is a platform-wide compatibility/admin key. When unset, the global-only AI Gateway APIs fail closed and provisioning APIs require a matching application key. Staging build promotion uses STAGING_PROVISIONING_API_KEY instead."
    },
    "STAGING_PROVISIONING_API_KEY": {
      "type": "secret",
      "description": "Staging-only GitHub Actions credential for the Fouria application's staging promotion workflow. Generate it from the Fouria application's ROOT-only provisioning-key controls in staging Lerma.",
      "environments": ["staging"],
      "used_by": ["ci-cd"],
      "github_secret_name": "STAGING_PROVISIONING_API_KEY",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Application-scoped key generated by Lerma (f4p_ prefix)",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": [],
      "notes": "Copy the one-time generated key from staging Lerma's Applications > Fouria page. The promote-staging workflow sends it only to the staging Lerma endpoint with X-FourIA-Application: fouria; never reuse a production key."
    },
    "OTEL_SHARED_SECRET": {
      "type": "secret",
      "description": "Shared secret authenticating the tenant worker OTLP receiver (POST /api/otel/v1/traces, /v1/metrics). Read from Lerma's environment and deployed as a secret_text binding on tenant workers; also forwarded to the container as OTEL_EXPORTER_OTLP_HEADERS. Without it the receiver rejects every export with 401 and no billable traces are produced.",
      "environments": ["local", "staging", "production"],
      "used_by": ["lerma", "fouria"],
      "github_secret_name": "OTEL_SHARED_SECRET",
      "wrangler_binding": "OTEL_SHARED_SECRET",
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"]
    },
    "OTEL_INGEST_TOKEN": {
      "type": "secret",
      "description": "Shared bearer secret configured as the Authorization header on the account-level Cloudflare Observability destinations (Workers Logs/Traces \u2192 Lerma OTLP ingest: POST /api/ingest/otel/v1/logs and /api/ingest/otel/v1/traces). Read from Lerma's environment; the ingest endpoints compare it in constant time and fail closed (401) when unset.",
      "environments": ["local", "staging", "production"],
      "used_by": ["lerma", "ci-cd"],
      "github_secret_name": "OTEL_INGEST_TOKEN",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Opaque shared bearer secret (generate with `openssl rand -hex 32`)",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"],
      "notes": "Requires NO Cloudflare API permissions. It is not the same value as OTEL_SHARED_SECRET: OTEL_SHARED_SECRET authenticates the container/User Worker OTLP receiver, while this one authenticates Cloudflare's destination delivery to Lerma. Configure it as a custom `Authorization: Bearer <token>` header on both Observability destinations."
    },
    "CF_OBSERVABILITY_TOKEN": {
      "type": "token",
      "description": "Optional Cloudflare API token with Workers Observability Write used by `mix lerma.observability.destinations` (dashboard CD) to create/update the account-level Cloudflare Observability destinations that push Workers Logs/Traces to Lerma. When unset, the task falls back to LERMA_API_TOKEN, which must then carry the same permission.",
      "scope": ["Workers Observability Write"],
      "environments": ["local", "staging", "production"],
      "used_by": ["lerma", "ci-cd"],
      "github_secret_name": "CF_OBSERVABILITY_TOKEN",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Cloudflare API token (Bearer)",
      "connectivity_test": {
        "type": "cf_permission_check",
        "expected_permissions": ["Workers Observability Write"]
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"],
      "notes": "Dedicated least-privilege token for destination reconciliation. The dashboard CD runs `mix lerma.observability.destinations --warn-only` before each deploy; without either this secret or Workers Observability Write on LERMA_API_TOKEN the step logs a warning and the account-level destinations must be created manually."
    },
    "ANALYTICS_ENGINE_API_TOKEN": {
      "type": "token",
      "description": "Dedicated Cloudflare API token with Account Analytics:Read. Read from Lerma's environment and deployed by the provisioner as a secret_text binding on tenant workers so GET /api/admin/costs/v2/summary (the dashboard 'Usage & Billing' widget) can read the tenant's emitted billable actions from the Analytics Engine SQL API. Without it the worker falls back to CLOUDFLARE_API_TOKEN (the AI Gateway alias, which lacks Analytics read), the SQL query returns HTTP 403, and the widget shows zeros.",
      "scope": ["Analytics Read"],
      "environments": ["staging", "production"],
      "connectivity_environments": ["staging", "production"],
      "used_by": ["lerma", "fouria"],
      "github_secret_name": "ANALYTICS_ENGINE_API_TOKEN",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Cloudflare API token (Bearer)",
      "connectivity_test": {
        "type": "cf_permission_check",
        "expected_permissions": ["Analytics Read"]
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"],
      "notes": "Optional \u2014 listed in tenant_provisioner.ex @platform_secrets and bound to tenant workers only when set. Must be a distinct, narrowly scoped token; never reuse LERMA_API_TOKEN (the provisioner refuses to distribute the administrative token as a tenant credential)."
    },
    "DEPLOY_WORKER_API_TOKEN": {
      "type": "token",
      "description": "Minimal-scope deploy token for wrangler commands (deploy, secret bulk, secret put). Used in CI/CD workflows only.",
      "scope": ["Workers Scripts Write"],
      "environments": ["staging", "production"],
      "connectivity_environments": ["staging", "production"],
      "used_by": ["ci-cd"],
      "github_secret_name": "DEPLOY_WORKER_API_TOKEN",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Cloudflare API token (Bearer)",
      "connectivity_test": {
        "type": "cf_permission_check",
        "expected_permissions": ["Workers Scripts Write"]
      },
      "notes": "Mapped to transient CLOUDFLARE_API_TOKEN env var in CI steps that call wrangler. Replaces former DEPLOY_CLOUDFLARE_API_TOKEN.",
      "dotenv_files": []
    },
    "CF_ACCESS_API_TOKEN": {
      "type": "token",
      "description": "Dispatch worker token for Cloudflare Access API lookups. Needs Access apps + groups read (user- or account-owned token).",
      "scope": ["Access: Apps and Policies Read", "Access: Groups Read"],
      "environments": ["staging", "production"],
      "connectivity_environments": ["staging", "production"],
      "used_by": ["dispatch", "ci-cd"],
      "github_secret_name": "CF_ACCESS_API_TOKEN",
      "wrangler_binding": "secrets",
      "container_pass": false,
      "format": "Cloudflare API token (Bearer)",
      "connectivity_test": {
        "type": "cf_permission_check",
        "expected_permissions": ["Access: Apps and Policies Read"]
      },
      "notes": "May be a user-owned (cfut_) or account-owned (cfat_) API token; the validator verifies the matching scope endpoint. Mapped to transient CLOUDFLARE_API_TOKEN env var in the CI step that uploads secrets to the dispatch worker. Replaces former CLOUDFLARE_API_TOKEN and CF_API_TOKEN.",
      "dotenv_files": [
        "workers/fouria-dispatch/.dev.vars",
        "workers/fouria-dispatch/.dev.vars.staging",
        "workers/fouria-dispatch/.dev.vars.production"
      ]
    },
    "CF_ACCESS_CLIENT_AUD": {
      "type": "aud",
      "description": "Per-tenant Access AUD for this User Worker. Optional \u2014 the platform AUD is always sufficient for authentication. Provisioned by lerma when a tenant has a dedicated Access application.",
      "environments": ["staging", "production"],
      "used_by": ["fouria"],
      "container_pass": false,
      "connectivity_test": {
        "type": "none"
      },
      "notes": "Optional per-tenant AUD. Set by lerma provisioner when provisioning per-tenant Access applications.",
      "dotenv_files": [
        "apps/fouria/.dev.vars",
        "apps/fouria/.dev.vars.staging",
        "apps/fouria/.dev.vars.production"
      ]
    },
    "CF_ACCESS_PLATFORM_AUD": {
      "type": "aud",
      "description": "Production platform-level Access AUD for JWT verification. Used by both the dispatch worker (as upstream) and tenant User Workers (as platformAud fallback).",
      "environments": ["production"],
      "used_by": ["dispatch", "fouria", "lerma"],
      "github_secret_name": "CF_ACCESS_PLATFORM_AUD",
      "wrangler_binding": "secrets",
      "container_pass": false,
      "connectivity_test": {
        "type": "none"
      },
      "notes": "From: tofu -chdir=apps/fouria/iac workspace select production && tofu output -raw platform_access_aud. Compiled to CF_ACCESS_PLATFORM_AUD on dispatch, user workers, and lerma dashboard.",
      "dotenv_files": [
        "workers/fouria-dispatch/.dev.vars",
        "workers/fouria-dispatch/.dev.vars.production",
        "apps/fouria/.dev.vars",
        "apps/fouria/.dev.vars.production",
        "apps/lerma/.env",
        "apps/lerma/.env.production"
      ]
    },
    "STAGING_CF_ACCESS_PLATFORM_AUD": {
      "type": "aud",
      "description": "Staging platform-level Access AUD for JWT verification. Used by both the staging dispatch worker and staging User Workers.",
      "environments": ["staging"],
      "used_by": ["dispatch", "fouria", "lerma"],
      "github_secret_name": "STAGING_CF_ACCESS_PLATFORM_AUD",
      "wrangler_binding": "secrets",
      "container_pass": false,
      "connectivity_test": {
        "type": "none"
      },
      "notes": "Same value as CF_ACCESS_PLATFORM_AUD (shared *.fouria.io wildcard). Compiles to CF_ACCESS_PLATFORM_AUD.",
      "dotenv_files": [
        {
          "file": "workers/fouria-dispatch/.dev.vars.staging",
          "as": "CF_ACCESS_PLATFORM_AUD"
        },
        {
          "file": "apps/fouria/.dev.vars.staging",
          "as": "CF_ACCESS_PLATFORM_AUD"
        },
        {
          "file": "apps/lerma/.env.staging",
          "as": "CF_ACCESS_PLATFORM_AUD"
        }
      ]
    },
    "HEALTH_MONITOR_ACCESS_CLIENT_ID": {
      "type": "secret",
      "description": "Client ID of the 'FourIA Health Monitor' Cloudflare Access service token that authenticates lerma's tenant /api/health probes.",
      "environments": ["staging", "production"],
      "used_by": ["lerma", "iac-lerma"],
      "github_secret_name": "HEALTH_MONITOR_ACCESS_CLIENT_ID",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Cloudflare Access service-token client id (suffix .access)",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"],
      "notes": "From: tofu -chdir=apps/fouria/iac workspace select production && tofu output -raw health_monitor_service_token_client_id. Required for HealthMonitor to probe Access-protected tenants; without it probes are challenged by Access and tenant status is left indeterminate."
    },
    "HEALTH_MONITOR_ACCESS_CLIENT_SECRET": {
      "type": "secret",
      "description": "Client secret of the 'FourIA Health Monitor' Cloudflare Access service token used by lerma's tenant health probes.",
      "environments": ["staging", "production"],
      "used_by": ["lerma", "iac-lerma"],
      "github_secret_name": "HEALTH_MONITOR_ACCESS_CLIENT_SECRET",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Cloudflare Access service-token client secret",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"],
      "notes": "From: tofu -chdir=apps/fouria/iac workspace select production && tofu output -raw health_monitor_service_token_client_secret. Cloudflare only exposes this value at creation / via the sensitive tofu output."
    },
    "CF_ACCESS_LERMA_AUD": {
      "type": "aud",
      "description": "Production Lerma dashboard Access audience tag for JWT verification.",
      "environments": ["production"],
      "used_by": ["lerma"],
      "github_secret_name": "CF_ACCESS_LERMA_AUD",
      "wrangler_binding": null,
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "notes": "From: tofu -chdir=apps/lerma/iac/tf workspace select default && tofu output -raw dashboard_access_aud. Compiles to CF_ACCESS_AUD in the production container.",
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.production"]
    },
    "STAGING_CF_ACCESS_LERMA_AUD": {
      "type": "aud",
      "description": "Staging Lerma dashboard Access audience tag for JWT verification.",
      "environments": ["staging"],
      "used_by": ["lerma"],
      "github_secret_name": "STAGING_CF_ACCESS_LERMA_AUD",
      "wrangler_binding": null,
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "notes": "From: tofu -chdir=apps/lerma/iac/tf workspace select staging && tofu output -raw dashboard_access_aud. Compiles to CF_ACCESS_AUD in the staging container.",
      "dotenv_files": [
        {
          "file": "apps/lerma/.env.staging",
          "as": "CF_ACCESS_LERMA_AUD"
        }
      ]
    },
    "E2E_CF_ACCESS_TEAM_DOMAIN": {
      "type": "url",
      "description": "Cloudflare Access team domain for JWT issuer construction. Value: paso4.cloudflareaccess.com",
      "environments": ["local", "staging", "production"],
      "used_by": ["lerma", "fouria", "dispatch"],
      "github_secret_name": "E2E_CF_ACCESS_TEAM_DOMAIN",
      "wrangler_binding": "vars",
      "container_pass": false,
      "connectivity_test": {
        "type": "dns_resolve",
        "endpoint": "{value}.cloudflareaccess.com"
      },
      "notes": "Hardcoded in wrangler.jsonc vars for staging and production.",
      "mapped_to": "CF_ACCESS_TEAM_DOMAIN",
      "dotenv_files": [
        "apps/fouria/.dev.vars",
        "apps/fouria/.dev.vars.staging",
        "apps/fouria/.dev.vars.production",
        "apps/fouria/.dev.vars.e2e",
        "apps/lerma/.env",
        "apps/lerma/.env.staging",
        "apps/lerma/.env.production"
      ]
    },
    "CF_ACCESS_SERVICE_TOKEN_ID": {
      "type": "id",
      "description": "CF Access service token Client ID for local CI/CD non-interactive authentication.",
      "environments": ["local"],
      "used_by": ["lerma"],
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": []
    },
    "CF_ACCESS_SERVICE_TOKEN_SECRET": {
      "type": "secret",
      "description": "CF Access service token Client Secret for local CI/CD non-interactive authentication.",
      "environments": ["local"],
      "used_by": ["lerma"],
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": []
    },
    "E2E_TELEGRAM_BOT_TOKEN": {
      "type": "secret",
      "description": "A real Telegram bot token (from @BotFather) used by the Telegram webhook-ingress E2E (`q_telegram_webhook.txt`). The suite registers a bot account via the admin API and exercises the public webhook route against it. Optional: the test self-skips when unset. Requires NO Cloudflare API permissions.",
      "environments": ["local", "staging", "production"],
      "used_by": ["ci-cd", "fouria"],
      "github_secret_name": "E2E_TELEGRAM_BOT_TOKEN",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Telegram bot token (`<digits>:<alphanumeric>`)",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/fouria/.dev.vars.e2e"],
      "notes": "Used only by the optional Telegram webhook ingress E2E test; it is never passed to the container or used by the Worker in production. The bot token is sent to the worker's /api/admin/telegram-ingress register endpoint (which F4E1-encrypts it at rest in the per-tenant registry)."
    },
    "CLOUDFLARE_AI_GATEWAY_API_KEY": {
      "type": "key",
      "description": "AI-scoped Cloudflare credential used by Lerma provisioning and FourIA's native and REST AI Gateway transports.",
      "environments": ["local", "staging", "production"],
      "used_by": ["lerma", "fouria", "plugin-ub"],
      "container_pass": true,
      "github_secret_name": "E2E_CLOUDFLARE_AI_GATEWAY_API_KEY",
      "connectivity_test": {
        "type": "ai_gateway_infer",
        "depends_on": ["CF_AI_GATEWAY_ACCOUNT_ID", "CF_AI_GATEWAY_GATEWAY_ID"]
      },
      "notes": "Read from Lerma's environment and copied to every tenant as a platform secret. Never generate this value randomly: it must be a real AI-scoped Cloudflare credential.",
      "dotenv_files": [
        "apps/lerma/.env",
        "apps/lerma/.env.staging",
        "apps/lerma/.env.production",
        "apps/fouria/.dev.vars",
        "apps/fouria/.dev.vars.staging",
        "apps/fouria/.dev.vars.production",
        "apps/fouria/.dev.vars.e2e"
      ]
    },
    "CF_AI_GATEWAY_ACCOUNT_ID": {
      "type": "id",
      "description": "Cloudflare account ID for AI Gateway URL construction. Value: 35afea16440634aa2350331d2a736eec",
      "environments": ["local", "staging", "production"],
      "used_by": ["fouria", "plugin-ub"],
      "container_pass": true,
      "wrangler_binding": "vars",
      "github_secret_name": "E2E_CF_AI_GATEWAY_ACCOUNT_ID",
      "connectivity_test": {
        "type": "none"
      },
      "notes": "Same as CLOUDFLARE_ACCOUNT_ID \u2014 passed separately for AI Gateway routing.",
      "dotenv_files": [
        "apps/fouria/.dev.vars",
        "apps/fouria/.dev.vars.staging",
        "apps/fouria/.dev.vars.production",
        "apps/fouria/.dev.vars.e2e"
      ]
    },
    "CF_AI_GATEWAY_GATEWAY_ID": {
      "type": "id",
      "description": "AI Gateway ID for URL construction. Value: moltworker",
      "environments": ["local", "staging", "production"],
      "used_by": ["fouria", "plugin-ub"],
      "container_pass": true,
      "wrangler_binding": "vars",
      "github_secret_name": "E2E_CF_AI_GATEWAY_GATEWAY_ID",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": [
        "apps/fouria/.dev.vars",
        "apps/fouria/.dev.vars.staging",
        "apps/fouria/.dev.vars.production",
        "apps/fouria/.dev.vars.e2e"
      ]
    },
    "CF_AI_GATEWAY_CUSTOM_DOMAIN": {
      "type": "id",
      "description": "Optional AI Gateway custom domain (e.g. ai.example.com). Routes unified billing through https://<domain>/compat and enables Cloudflare Access identity-aware controls for User Insights.",
      "environments": ["local", "staging", "production"],
      "used_by": ["fouria", "plugin-ub"],
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/fouria/.dev.vars"]
    },
    "CF_ACCESS_TOKEN": {
      "type": "token",
      "description": "Cloudflare Access user JWT (from `cloudflared access login`) forwarded as cf-access-token on an Access-protected AI Gateway custom domain. AI Gateway records cf.user_id for per-user User Insights attribution.",
      "environments": ["local", "staging", "production"],
      "used_by": ["fouria", "plugin-ub"],
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/fouria/.dev.vars"]
    },
    "CF_ACCESS_CLIENT_ID": {
      "type": "id",
      "description": "Cloudflare Access service-token client ID (headless alternative to CF_ACCESS_TOKEN; service tokens do not produce cf.user_id).",
      "environments": ["local", "staging", "production"],
      "used_by": ["fouria", "plugin-ub"],
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/fouria/.dev.vars"]
    },
    "CF_ACCESS_CLIENT_SECRET": {
      "type": "secret",
      "description": "Cloudflare Access service-token client secret (used with CF_ACCESS_CLIENT_ID).",
      "environments": ["local", "staging", "production"],
      "used_by": ["fouria", "plugin-ub"],
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/fouria/.dev.vars"]
    },
    "CLOUDFLARE_TUNNEL_TOKEN": {
      "type": "token",
      "description": "cloudflared tunnel token for exposing Obsidian sync (port 18790) via Cloudflare Tunnel.",
      "environments": ["staging", "production"],
      "used_by": ["fouria"],
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/fouria/.dev.vars", "apps/fouria/.dev.vars.e2e"]
    },
    "STRIPE_SECRET_KEY": {
      "type": "key",
      "description": "Stripe secret key (sk_live_...) deployed by the lerma provisioner as a secret_text binding on tenant workers for Checkout / Customer Portal sessions.",
      "environments": ["staging", "production"],
      "used_by": ["lerma", "fouria"],
      "github_secret_name": "STRIPE_SECRET_KEY",
      "wrangler_binding": null,
      "container_pass": false,
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"],
      "notes": "Optional \u2014 listed in tenant_provisioner.ex @platform_secrets and bound to tenant workers only when set."
    },
    "STRIPE_PUBLISHABLE_KEY": {
      "type": "key",
      "description": "Stripe publishable key (pk_live_...) deployed by the lerma provisioner as a secret_text binding on tenant workers and exposed to the frontend for Stripe.js.",
      "environments": ["staging", "production"],
      "used_by": ["lerma", "fouria"],
      "github_secret_name": "STRIPE_PUBLISHABLE_KEY",
      "wrangler_binding": null,
      "container_pass": false,
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"],
      "notes": "Optional \u2014 listed in tenant_provisioner.ex @platform_secrets and bound to tenant workers only when set."
    },
    "OPENCODE_API_KEY": {
      "type": "key",
      "description": "OpenCode (opencode-go) subscription API key. Deployed by the lerma provisioner as a secret_text binding to dev-environment instances only; authenticates the Fouria Builder/Q&A agents and the opencode-credits-check automation. Never used for pay-as-you-go API billing.",
      "environments": ["local", "staging", "production"],
      "used_by": ["lerma", "fouria", "ci-cd"],
      "github_secret_name": "OPENCODE_API_KEY",
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "notes": "Read from Lerma's environment and deployed only when the instance environment is \"dev\" (tenant_provisioner dev_environment_bindings/1). Optional \u2014 when unset the dev agents fall back to the primary model and the opencode-credits automation is skipped. Never deployed to production instances.",
      "dotenv_files": [
        "apps/lerma/.env",
        "apps/lerma/.env.staging",
        "apps/lerma/.env.production",
        "apps/fouria/.dev.vars"
      ]
    },
    "DEV_INSTANCE_SSH_PUBLIC_KEY": {
      "type": "secret",
      "description": "Optional ssh-ed25519 public key Lerma configures for Wrangler SSH into dev Cloudflare Container applications. The matching private key remains on the operator workstation.",
      "environments": ["local", "staging", "production"],
      "used_by": ["lerma", "ci-cd"],
      "github_secret_name": "DEV_INSTANCE_SSH_PUBLIC_KEY",
      "wrangler_binding": null,
      "container_pass": false,
      "format": "Single-line OpenSSH ssh-ed25519 public key (never a private key)",
      "connectivity_test": {
        "type": "none"
      },
      "notes": "Passed only to Lerma and applied as authorized_keys on dev Container applications. It is never deployed as a tenant Worker or container environment binding. Existing dev applications receive updates on their next Lerma redeploy.",
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"]
    },
    "PASO4_TELEGRAM_GROUP_ID": {
      "type": "id",
      "description": "Paso4 general Telegram group id used by the opencode-credits automation for announce delivery. Deployed by the lerma provisioner as a plain_text binding to dev-environment instances only.",
      "environments": ["local", "staging", "production"],
      "used_by": ["lerma", "fouria", "ci-cd"],
      "github_secret_name": "PASO4_TELEGRAM_GROUP_ID",
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "notes": "Default -5442477312 (tenant_provisioner @default_paso4_telegram_group_id). Optional; deployed only to dev-environment instances.",
      "dotenv_files": [
        "apps/lerma/.env",
        "apps/lerma/.env.staging",
        "apps/lerma/.env.production",
        "apps/fouria/.dev.vars"
      ]
    },
    "MOLTBOT_GATEWAY_TOKEN": {
      "type": "secret",
      "description": "Gateway token for authenticating CLI commands against the OpenClaw gateway inside the container. Mapped to OPENCLAW_GATEWAY_TOKEN by buildEnvVars(). Auto-generated per tenant by the lerma provisioner.",
      "environments": ["staging", "production"],
      "used_by": ["fouria"],
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "notes": "Auto-generated crypto token in tenant_provisioner. Maps to OPENCLAW_GATEWAY_TOKEN in container env. The start-openclaw.sh script unsets the original name in the container to prevent leakage.",
      "dotenv_files": [
        "apps/fouria/.dev.vars",
        "apps/fouria/.dev.vars.staging",
        "apps/fouria/.dev.vars.production"
      ]
    },
    "CDP_SECRET": {
      "type": "secret",
      "description": "Shared secret authenticating the CDP WebSocket shim (/cdp) between the container and the Worker. Required per-tenant secret, auto-generated by the lerma provisioner. (The legacy leads R2 proxy at /api/leads/ws also used this secret; the sandbox now reaches the leads bucket through the `leads.r2.internal` outbound bridge instead.)",
      "environments": ["staging", "production"],
      "used_by": ["fouria"],
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "notes": "Listed in tenant_provisioner.ex @per_tenant_secrets and generated by generate_secrets/0. The sandbox uses it to reach the Worker's leads proxy over WebSocket; the Worker runs the R2 operations with its LEADS_BUCKET binding (the sandbox holds no R2 credentials).",
      "dotenv_files": ["apps/fouria/.dev.vars"]
    },
    "CLOUDFLARED_TUNNEL_TOKEN": {
      "type": "token",
      "description": "Separate tunnel token for lerma dashboard local dev (routes to port 4001 via cloudflared).",
      "environments": ["local"],
      "used_by": ["lerma"],
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": []
    },
    "R2_ACCESS_KEY_ID": {
      "type": "key",
      "description": "R2 access key for Sandbox SDK backup/restore (R2 presigned URL signing on the User Worker) and for container-side s3fs mount. Deployed by the lerma provisioner as a platform secret_text binding.",
      "environments": ["staging", "production"],
      "used_by": ["fouria"],
      "container_pass": true,
      "mapped_to": "R2_ACCESS_KEY_ID",
      "github_secret_name": "E2E_R2_ACCESS_KEY_ID",
      "connectivity_test": {
        "type": "none"
      },
      "notes": "Required by the Sandbox SDK presigned-URL backup path together with R2_SECRET_ACCESS_KEY, CLOUDFLARE_ACCOUNT_ID and BACKUP_BUCKET_NAME. When missing, tenants cannot run backups (provisioner warns). One account-scoped token serves all tenants and E2E. Mint new credentials via `mix lerma.r2_token` (parent token needs User \u2192 API Tokens Write; see apps/lerma/README.md).",
      "dotenv_files": ["apps/fouria/.dev.vars", "apps/fouria/.dev.vars.e2e"]
    },
    "R2_SECRET_ACCESS_KEY": {
      "type": "secret",
      "description": "R2 secret key for Sandbox SDK backup/restore (R2 presigned URL signing on the User Worker) and for container-side s3fs mount. Deployed by the lerma provisioner as a platform secret_text binding.",
      "environments": ["staging", "production"],
      "used_by": ["fouria"],
      "container_pass": true,
      "mapped_to": "R2_SECRET_ACCESS_KEY",
      "github_secret_name": "E2E_R2_SECRET_ACCESS_KEY",
      "connectivity_test": {
        "type": "none"
      },
      "notes": "Required by the Sandbox SDK presigned-URL backup path together with R2_ACCESS_KEY_ID, CLOUDFLARE_ACCOUNT_ID and BACKUP_BUCKET_NAME. Equal to the SHA-256 hash of the minted token value.",
      "dotenv_files": ["apps/fouria/.dev.vars", "apps/fouria/.dev.vars.e2e"]
    },
    "BACKUP_BUCKET_NAME": {
      "type": "bucket",
      "description": "R2 backup bucket name (staging: fouria-data-staging, production: fouria-data). Required as a plain_text binding on the User Worker: the Sandbox SDK presigned-URL backup path signs URLs against this name in addition to the BACKUP_BUCKET binding. Mapped to R2_BUCKET_NAME for container-side reference.",
      "environments": ["local", "staging", "production"],
      "used_by": ["fouria"],
      "container_pass": true,
      "mapped_to": "R2_BUCKET_NAME",
      "wrangler_binding": "r2_buckets",
      "connectivity_test": {
        "type": "none"
      },
      "notes": "E2E fixture deploys set BACKUP_BUCKET_NAME to the per-run terraform bucket so backup/restore never touches the platform bucket.",
      "dotenv_files": []
    },
    "BACKUP_ENCRYPTION_KEY": {
      "type": "secret",
      "description": "Base64 32-byte AES-256 master key for client-side encryption of R2 backup snapshots and config versions (F4E1 format). Worker-side only, never passed to the container. Generate: openssl rand -base64 32. Backups created before the key is set remain plaintext and stay restorable.",
      "environments": ["local", "staging", "production"],
      "used_by": ["fouria"],
      "container_pass": false,
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/fouria/.dev.vars"]
    },
    "CLOUDFLARE_ACCOUNT_ID": {
      "type": "id",
      "description": "Paso4 Cloudflare account ID. Value: 35afea16440634aa2350331d2a736eec",
      "environments": ["local", "staging", "production"],
      "used_by": ["lerma", "fouria", "dispatch", "iac-lerma", "iac-fouria"],
      "wrangler_binding": "vars",
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "notes": "Canonical runtime name everywhere. Required on the fouria User Worker (plain_text binding or wrangler var): the Sandbox SDK reads it for R2 presigned URL signing (backup/restore). Legacy alias CF_ACCOUNT_ID is deprecated \u2014 fixture scripts still accept it as a fallback but emit no new uses.",
      "dotenv_files": [
        "apps/fouria/.dev.vars",
        "apps/fouria/.dev.vars.staging",
        "apps/fouria/.dev.vars.production",
        "apps/fouria/.dev.vars.e2e",
        "apps/lerma/.env",
        "apps/lerma/.env.staging",
        "apps/lerma/.env.production"
      ]
    },
    "PASO4_ZONE_ID": {
      "type": "zone",
      "description": "Cloudflare zone ID for paso4.io. Value: 6ce23f544f57a1909578032abcda18dd",
      "environments": ["local", "staging", "production"],
      "used_by": ["iac-lerma", "iac-fouria"],
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": []
    },
    "FOURIA_ZONE_ID": {
      "type": "zone",
      "description": "Cloudflare zone ID for fouria.io. Value: 0788c1abfe5b9d58bdf41052ccaaa765",
      "environments": ["staging", "production"],
      "used_by": ["iac-fouria", "dispatch"],
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": []
    },
    "WORKERS_SUBDOMAIN": {
      "type": "url",
      "description": "Cloudflare Workers subdomain for E2E test routing.",
      "environments": ["staging", "production"],
      "used_by": ["ci-cd"],
      "github_secret_name": "E2E_WORKERS_SUBDOMAIN",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": [
        "apps/fouria/.dev.vars.staging",
        "apps/fouria/.dev.vars.production",
        "apps/fouria/.dev.vars.e2e"
      ]
    },
    "SUPABASE_URL": {
      "type": "url",
      "description": "Supabase project URL for the shared PostgreSQL database. Different per environment.",
      "environments": ["staging", "production"],
      "used_by": ["dispatch", "lerma", "ci-cd"],
      "github_secret_name": "SUPABASE_URL",
      "connectivity_test": {
        "type": "supabase_query",
        "endpoint": "/rest/v1/"
      },
      "dotenv_files": [
        "apps/lerma/.env",
        "apps/lerma/.env.production",
        "workers/fouria-dispatch/.dev.vars",
        "workers/fouria-dispatch/.dev.vars.production"
      ]
    },
    "SUPABASE_SERVICE_ROLE_KEY": {
      "type": "key",
      "description": "Supabase service role key (bypasses RLS). Used by dispatch worker and CI.",
      "environments": ["staging", "production"],
      "used_by": ["dispatch", "ci-cd"],
      "github_secret_name": "SUPABASE_SERVICE_ROLE_KEY",
      "connectivity_test": {
        "type": "supabase_query",
        "endpoint": "/rest/v1/clients?limit=1"
      },
      "dotenv_files": [
        "apps/lerma/.env",
        "apps/lerma/.env.production",
        "workers/fouria-dispatch/.dev.vars",
        "workers/fouria-dispatch/.dev.vars.production"
      ]
    },
    "GITHUB_TOKEN": {
      "type": "token",
      "description": "GitHub token deployed by the lerma provisioner as a GITHUB_TOKEN secret_text binding on dev/Paso4 instances (used by the paso4-dev agent's `gh` CLI); also a fallback GHCR token for the lerma deploy mix task.",
      "environments": ["local", "staging", "production"],
      "used_by": ["lerma", "fouria", "ci-cd"],
      "github_secret_name": "GITHUB_TOKEN",
      "wrangler_binding": null,
      "container_pass": true,
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"],
      "notes": "Optional. Read from lerma's env in tenant_provisioner github_binding/1 (bound only to dev/Paso4 instances) and as a GHCR fallback in `mix lerma.deploy`. Distinct from GH_PAT (read:packages CI pull)."
    },
    "GH_PAT": {
      "type": "token",
      "description": "GitHub personal access token used by deploy-dashboard workflow for GHCR auth (docker login ghcr.io). Requires the read:packages scope to pull private container images like ghcr.io/0xcab0/lerma.",
      "environments": ["staging", "production"],
      "connectivity_environments": ["staging", "production"],
      "used_by": ["ci-cd"],
      "github_secret_name": "GH_PAT",
      "connectivity_test": [
        {
          "type": "ghcr_pull",
          "username": "0xCAB0",
          "repo": "0xcab0/lerma",
          "tag": "latest-pre"
        }
      ],
      "dotenv_files": ["apps/lerma/.env"]
    },
    "HCLOUD_TOKEN": {
      "type": "token",
      "description": "Hetzner Cloud API token for OpenTofu VM provisioning.",
      "environments": ["staging", "production"],
      "used_by": ["iac-lerma"],
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"]
    },
    "SUPABASE_ACCESS_TOKEN": {
      "type": "token",
      "description": "Supabase management API token for Tofu provisioning.",
      "environments": ["staging", "production"],
      "used_by": ["iac-lerma"],
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"]
    },
    "DATABASE_URL": {
      "type": "url",
      "description": "PostgreSQL database URL for production deployment (Ansible).",
      "environments": ["production"],
      "used_by": ["ci-cd"],
      "github_secret_name": "DATABASE_URL",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env.production"]
    },
    "STAGING_DATABASE_URL": {
      "type": "url",
      "description": "PostgreSQL database URL for staging deployment (Ansible).",
      "environments": ["staging"],
      "used_by": ["ci-cd"],
      "github_secret_name": "STAGING_DATABASE_URL",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": [
        {
          "file": "apps/lerma/.env.staging",
          "as": "DATABASE_URL"
        }
      ]
    },
    "SECRET_KEY_BASE": {
      "type": "secret",
      "description": "Phoenix secret key base for production.",
      "environments": ["production"],
      "used_by": ["lerma", "ci-cd"],
      "github_secret_name": "SECRET_KEY_BASE",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env.production"]
    },
    "STAGING_SECRET_KEY_BASE": {
      "type": "secret",
      "description": "Phoenix secret key base for staging.",
      "environments": ["staging"],
      "used_by": ["ci-cd"],
      "github_secret_name": "STAGING_SECRET_KEY_BASE",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": [
        {
          "file": "apps/lerma/.env.staging",
          "as": "SECRET_KEY_BASE"
        }
      ]
    },
    "SERVER_IP": {
      "type": "id",
      "description": "Production Hetzner VM IP address (Ansible).",
      "environments": ["production"],
      "used_by": ["ci-cd"],
      "github_secret_name": "SERVER_IP",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env.production"]
    },
    "STAGING_SERVER_IP": {
      "type": "id",
      "description": "Staging Hetzner VM IP address (Ansible).",
      "environments": ["staging"],
      "used_by": ["ci-cd"],
      "github_secret_name": "STAGING_SERVER_IP",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": [
        {
          "file": "apps/lerma/.env.staging",
          "as": "SERVER_IP"
        }
      ]
    },
    "SSH_PRIVATE_KEY": {
      "type": "secret",
      "description": "SSH private key for production server access.",
      "environments": ["production"],
      "used_by": ["ci-cd"],
      "github_secret_name": "SSH_PRIVATE_KEY",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env.production"]
    },
    "STAGING_SSH_PRIVATE_KEY": {
      "type": "secret",
      "description": "SSH private key for staging server access.",
      "environments": ["staging"],
      "used_by": ["ci-cd"],
      "github_secret_name": "STAGING_SSH_PRIVATE_KEY",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": [
        {
          "file": "apps/lerma/.env.staging",
          "as": "SSH_PRIVATE_KEY"
        }
      ]
    },
    "SECRETS_STORE_ID": {
      "type": "id",
      "description": "Shared Cloudflare Secrets Store ID for dynamic/user secrets. Managed by OpenTofu.",
      "environments": ["staging", "production"],
      "used_by": ["lerma"],
      "github_secret_name": "SECRETS_STORE_ID",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": ["apps/lerma/.env", "apps/lerma/.env.staging", "apps/lerma/.env.production"]
    },
    "SUPABASE_STAGING_URL": {
      "type": "url",
      "description": "Supabase project URL for staging environment.",
      "environments": ["staging"],
      "used_by": ["ci-cd"],
      "github_secret_name": "SUPABASE_STAGING_URL",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": [
        {
          "file": "apps/lerma/.env.staging",
          "as": "SUPABASE_URL"
        },
        {
          "file": "workers/fouria-dispatch/.dev.vars.staging",
          "as": "SUPABASE_URL"
        },
        {
          "file": "workers/fouria-dispatch/.dev.vars.production",
          "as": "STAGING_SUPABASE_URL"
        }
      ]
    },
    "SUPABASE_STAGING_KEY": {
      "type": "key",
      "description": "Supabase service role key for staging environment.",
      "environments": ["staging"],
      "used_by": ["ci-cd"],
      "github_secret_name": "SUPABASE_STAGING_KEY",
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": [
        {
          "file": "apps/lerma/.env.staging",
          "as": "SUPABASE_SERVICE_ROLE_KEY"
        },
        {
          "file": "workers/fouria-dispatch/.dev.vars.staging",
          "as": "SUPABASE_SERVICE_ROLE_KEY"
        },
        {
          "file": "workers/fouria-dispatch/.dev.vars.production",
          "as": "STAGING_SUPABASE_SERVICE_ROLE_KEY"
        }
      ]
    },
    "FOURIA_TAIL_SECRET": {
      "type": "secret",
      "description": "Shared Bearer token between fouria-tail worker and lerma ingestion endpoint. Set as a Worker secret on fouria-tail; also set as FOURIA_TAIL_SECRET env var on the lerma container.",
      "environments": ["staging", "production"],
      "used_by": ["fouria-tail", "lerma"],
      "github_secret_name": "FOURIA_TAIL_SECRET",
      "wrangler_binding": "secrets",
      "container_pass": false,
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": [
        {
          "file": "workers/fouria-tail/.dev.vars",
          "as": "FOURIA_TAIL_SECRET"
        },
        {
          "file": "workers/fouria-tail/.dev.vars.staging",
          "as": "FOURIA_TAIL_SECRET"
        },
        "apps/lerma/.env",
        "apps/lerma/.env.staging",
        "apps/lerma/.env.production"
      ]
    },
    "R2_LOGPUSH_ACCESS_KEY_ID": {
      "type": "key",
      "description": "R2 access key for Logpush destination (account-level). Passed as r2_logpush_access_key_id in iac-fouria tfvars.",
      "environments": ["staging", "production"],
      "used_by": ["iac-fouria"],
      "github_secret_name": "R2_LOGPUSH_ACCESS_KEY_ID",
      "wrangler_binding": null,
      "container_pass": false,
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": [],
      "notes": "Provisioned via R2 API token in Cloudflare dashboard. Used by the Logpush R2 destination_conf in observability.tf."
    },
    "R2_LOGPUSH_SECRET_ACCESS_KEY": {
      "type": "secret",
      "description": "R2 secret key for Logpush destination (account-level). Passed as r2_logpush_secret_access_key in iac-fouria tfvars.",
      "environments": ["staging", "production"],
      "used_by": ["iac-fouria"],
      "github_secret_name": "R2_LOGPUSH_SECRET_ACCESS_KEY",
      "wrangler_binding": null,
      "container_pass": false,
      "connectivity_test": {
        "type": "none"
      },
      "dotenv_files": [],
      "notes": "SECURITY: this value WILL be stored in the OpenTofu state file embedded in the Logpush destination_conf URL. Restrict access to terraform.tfstate.d/"
    }
  },
  "type": "object",
  "required": ["values"],
  "properties": {
    "values": {
      "type": "object",
      "description": "Secret name \u2192 value pairs. Copy the template above, fill in your real values.",
      "required": [],
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "additionalProperties": false,
  "x-env-templates": {
    "apps/fouria/.dev.vars": {
      "project": "fouria",
      "header": "# Generated by secrets-generate.ts \u2014 edit SECRETS.yaml instead\n# Copy the matching .env or .dev.vars file to your target.\n# Use the manual variables section (below) for env vars not tracked in SECRETS.yaml.\n"
    },
    "apps/fouria/.dev.vars.staging": {
      "project": "fouria",
      "header": "# Generated by secrets-generate.ts \u2014 staging vars\n# Copy to .dev.vars (or .dev.vars.staging) and run `CLOUDFLARE_ENV=staging bun run dev:worker`\n"
    },
    "apps/fouria/.dev.vars.production": {
      "project": "fouria",
      "header": "# Generated by secrets-generate.ts \u2014 production vars\n"
    },
    "apps/fouria/.dev.vars.e2e": {
      "project": "fouria",
      "header": "# Generated by secrets-generate.ts \u2014 cloud E2E vars\n# Sourced by the cloud E2E scripts and `bun run test:gateway:boot:ai`.\n# Required vars are enforced in apps/fouria/test/e2e/fixture/server/start.\n# Use the manual variables section (below) for env vars not tracked in SECRETS.yaml\n# (e.g. CLOUDFLARE_TEARDOWN_API_TOKEN, E2E_TEST_RUN_ID).\n"
    },
    "apps/lerma/.env": {
      "project": "lerma",
      "header": "# Generated by secrets-generate.ts \u2014 edit SECRETS.yaml instead\n# Source this file: set +a && source apps/lerma/.env && set +a\n\nTF_VAR_deploy_environment=production\n",
      "footer": "# ---\n# Add any missing secrets below:\n# DATABASE_URL=postgresql://...\n# SECRET_KEY_BASE=...\n# CF_ACCESS_SERVICE_TOKEN_ID=\n# CF_ACCESS_SERVICE_TOKEN_SECRET=\n# SKIP_AUTH=true\n"
    },
    "apps/lerma/.env.staging": {
      "project": "lerma",
      "header": "# Generated by secrets-generate.ts \u2014 staging env\n# Source: set +a && source apps/lerma/.env.staging && set +a\n\nTF_VAR_deploy_environment=staging\n"
    },
    "apps/lerma/.env.production": {
      "project": "lerma",
      "header": "# Generated by secrets-generate.ts \u2014 production env\n\nTF_VAR_deploy_environment=production\n"
    },
    "workers/fouria-dispatch/.dev.vars": {
      "project": "dispatch",
      "header": "# Generated by secrets-generate.ts \u2014 edit SECRETS.yaml instead\n# Use the manual variables section (below) for env vars not tracked in SECRETS.yaml.\n"
    },
    "workers/fouria-dispatch/.dev.vars.staging": {
      "project": "dispatch",
      "header": "# Generated by secrets-generate.ts \u2014 staging vars\n"
    },
    "workers/fouria-dispatch/.dev.vars.production": {
      "project": "dispatch",
      "header": "# Generated by secrets-generate.ts \u2014 production vars\n"
    },
    "workers/fouria-tail/.dev.vars": {
      "project": "fouria-tail",
      "header": "# Generated by secrets-generate.ts \u2014 edit SECRETS.yaml instead\n"
    },
    "workers/fouria-tail/.dev.vars.staging": {
      "project": "fouria-tail",
      "header": "# Generated by secrets-generate.ts \u2014 staging vars\n"
    }
  }
}
