Version
alchemy@2.0.0-beta.66
Problem
Cloudflare.Worker can declare binding values through env, but it cannot preserve a named binding from an exact prior Worker version without supplying that binding value again.
That is a problem for least-privilege deployment workflows where:
- the deployment identity may upload Worker code but cannot read separately custodied secret values;
- the caller knows the expected binding names and the exact prior version ID;
- a code-only deploy must preserve those bindings without copying their values through the deployment process; and
- any missing source version or binding must fail closed rather than silently omit the binding.
Cloudflare already exposes the necessary upload contract:
- multipart binding metadata supports
{ type: "inherit", name, version_id };
- the upload query parameter
bindings_inherit=strict fails when an inherited binding cannot be resolved; and
- Wrangler uses strict inheritance during deploy/version upload.
Alchemy beta.66 has Worker versions and gradual deployments, but I could not find a public Worker prop or binding constructor that emits inherited binding metadata or opts the upload into strict inheritance.
Expected behavior
A Worker deployment should be able to inherit an explicit set of named bindings from an exact prior version without reading their values.
One possible shape:
yield* Cloudflare.Worker("Api", {
main: "./src/api.ts",
bindingInheritance: {
mode: "strict",
versionId: priorVersionId,
bindingNames: ["API_TOKEN", "SIGNING_KEY"],
},
});
A first-class inherited-binding value in env could also work if it stays value-free and supports exact version IDs.
Safety requirements
- Send
bindings_inherit=strict for both regular Worker and dispatch-namespace uploads.
- Emit
type: "inherit" metadata with the exact version_id for every requested name.
- Include the inheritance contract in the Worker metadata hash/diff surface.
- Reject an empty version ID, an empty name set, duplicate names, and ambiguous conflicts with explicitly declared bindings.
- Do not read, log, or persist inherited binding values.
- Prefer exact version IDs over implicit
latest for reproducible plans.
Suggested coverage
- An omitted secret binding is inherited from the specified version while its value remains unavailable to Alchemy.
- A missing version or binding fails the upload in strict mode.
- Changing the version ID or name set produces a Worker update.
- Explicitly declared and inherited names cannot conflict silently.
- Regular and dispatch-namespace Worker uploads behave consistently.
Cloudflare API references:
Version
alchemy@2.0.0-beta.66Problem
Cloudflare.Workercan declare binding values throughenv, but it cannot preserve a named binding from an exact prior Worker version without supplying that binding value again.That is a problem for least-privilege deployment workflows where:
Cloudflare already exposes the necessary upload contract:
{ type: "inherit", name, version_id };bindings_inherit=strictfails when an inherited binding cannot be resolved; andAlchemy beta.66 has Worker versions and gradual deployments, but I could not find a public Worker prop or binding constructor that emits inherited binding metadata or opts the upload into strict inheritance.
Expected behavior
A Worker deployment should be able to inherit an explicit set of named bindings from an exact prior version without reading their values.
One possible shape:
A first-class inherited-binding value in
envcould also work if it stays value-free and supports exact version IDs.Safety requirements
bindings_inherit=strictfor both regular Worker and dispatch-namespace uploads.type: "inherit"metadata with the exactversion_idfor every requested name.latestfor reproducible plans.Suggested coverage
Cloudflare API references:
WorkersBindingKindInherit)