{
  "slug": "wrangler-types-generates-bindings-from-required-secrets-d6021edaf7f7",
  "title": "wrangler types generates bindings from required secrets",
  "tools": [
    "wrangler"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-03-03T21:50:34.000Z",
  "announced_at": "2026-03-03T21:50:34.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When Wrangler configuration declares `secrets`, generate bindings from `secrets.required`. Add the required secret names, then run `wrangler types` (or `npx wrangler types`); named environments get separate interfaces, and the aggregate `Env` makes environment-specific secrets optional.",
    "examples": [
      "{\n  \"secrets\": {\n    \"required\": [\"API_KEY\", \"DB_PASSWORD\"]\n  }\n}",
      "npx wrangler types"
    ],
    "gotchas": [
      "Version: 4.70.0",
      "Availability: Experimental configuration property.",
      "secrets.required (required): Array of required secret names; when `secrets` is defined, these names are the source for generated secret bindings.",
      "PATH: Optional output path for generated types; defaults to `./worker-configuration.d.ts` and must end in `.d.ts`.",
      "Prerequisite: Define the `secrets` property in Wrangler configuration for this type-generation behavior.",
      "Prerequisite: Install or otherwise make Wrangler available to run the command; Cloudflare documents `npx wrangler types` as an invocation.",
      "The `secrets` property must be defined for this behavior.",
      "Per-environment secrets are supported."
    ]
  },
  "why_it_matters": "Generate typed Worker bindings for a project whose required secrets are declared in Wrangler configuration.",
  "before": "The release note says that without `secrets`, the existing behavior is unchanged; with it, Wrangler previously inferred secret names from `.dev.vars` or `.env`.",
  "sources": [
    "https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.70.0",
    "https://developers.cloudflare.com/workers/wrangler/configuration/",
    "https://developers.cloudflare.com/workers/wrangler/commands/#types"
  ],
  "rank": 0.91039,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "backfill-20261007",
    "verdict_id": "backfill-20261007:backfill-20261007-1563e00f63b688f3-3:gate",
    "evidence_hash": "466d88208f30055fac260a830134b81c67385aa8695f145eead52bc09f8c3478"
  },
  "review": {
    "draft_hash": "9879458220b93f87a4550da3d05f4f06f973eb0eacaa6bd0cf46ab1786605719",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "backfill-20261007:gate",
    "reason": "2 of 3 judge runs approved with p_yes >= 0.9 (mean 0.91 >= 0.9; 2 needed) and Jev gave 0.76 (>= 0.6 needed)."
  }
}
