Cloud Parts

Cloudflare Secrets StoreBeta

Account-level secrets that are written once, can never be read back, and are bound by reference into any Worker or AI Gateway that needs them.

Type
Commercial product
License
Proprietary
Status
Beta. In open beta since 9 April 2025, with one store and up to 100 secrets per account.
Facts checked
12 October 2026

What it is

Ordinary Workers secrets belong to one Worker: set with wrangler secret put, they show up on that Worker’s env, so a key used by ten Workers is stored ten times and anyone who can edit a Worker can change its secrets. Secrets Store holds secrets for the whole account instead. You create a secret (any string up to 65,536 bytes) in the dashboard, the API or with wrangler secrets-store secret create, and give it scopes that say which products may use it: workers, ai-gateway or both. After that its value can’t be decrypted or read through the API or dashboard by anyone; only the bound service gets it at runtime.

A Worker gets a secrets_store_secrets binding with a store ID and secret name, and reads the value with an async await env.MY_KEY.get(). AI Gateway can reference a stored provider key instead of receiving it in every request header. Two checks guard each use: the person or API token binding the secret needs the Super Administrator or Secrets Store Deployer role (or an Edit token), and the secret’s scopes must include the consuming product. Values are encrypted with per-secret data keys wrapped by a key-encryption key, and copied to every Cloudflare server. Locally, wrangler dev uses secrets created without --remote; production values never reach your laptop.

Why teams pick it

  • One source of truth: rotate a key once and every Worker bound to it sees the new value
  • Separates duties: admins create secrets, deployers can only bind them, reporters see only metadata, and changes go to the audit log
  • Write-only by design: after creation nobody, including Cloudflare staff, can read the value back through the API or dashboard
  • Scopes stop a secret meant for AI Gateway from being bound into a Worker, and the reverse

Watch out for

  • Still in open beta: one store per account and at most 100 production secrets
  • Only two consumers so far, Workers and AI Gateway; other Cloudflare products still keep their own secrets
  • Reading a value is an async call per binding, unlike per-Worker secrets that sit directly on env
  • CI tokens that deploy Workers with these bindings need Secrets Store Edit permission, not Read, and the service is unavailable in the Cloudflare China Network

Alternatives

What all secrets management have in common →

How it fits with other technologies

Create an account secret, bind it to a Worker, read it in code · bash

npx wrangler secrets-store store list            # find the store ID
npx wrangler secrets-store secret create <STORE_ID> \
  --name OPENAI_API_KEY --scopes workers --remote   # prompts for the value

# wrangler.jsonc
#   "secrets_store_secrets": [
#     { "binding": "OPENAI_API_KEY", "store_id": "<STORE_ID>", "secret_name": "OPENAI_API_KEY" }
#   ]

# In the Worker:
#   const key = await env.OPENAI_API_KEY.get();

See it in a real stack

No architecture uses Cloudflare Secrets Store yet. Drop it into the playground and wire it up yourself.Open playground →
Where it came from2020–2025

Environment variables and secrets arrived in Workers in 2020, and by 2025 there were millions of them, many duplicated: the same API token copied into ten scripts had to be created and rotated ten times, and anyone with access to a script could edit its secrets. Other Cloudflare products, from Access service tokens to AI Gateway provider keys, kept secrets of their own.

On April 9, 2025, during Developer Week, Mia Malden, Mitali Rawat and James Vaughan launched Cloudflare Secrets Store in beta, starting with Workers. Secrets were encrypted with a two-level key hierarchy, guarded by role-based access control, and pushed to every server with Quicksilver, so a Worker finds its secrets wherever it runs. Every account could create up to twenty secrets for free while pricing was being finalized.

In May 2025 the limit rose to 100 secrets per account, and in August 2025 AI Gateway started using Secrets Store for bring-your-own provider keys, with a scope of its own. Cloudflare has said it plans per-store bindings, multiple stores per account and customer-specific data keys.

Why it’s built this way

Write-only secrets
Once created, a value is not readable by developers, admins or Cloudflare employees; only the permitted service uses it at runtime, so a leaked dashboard session does not leak keys.
Separate roles for managing and deploying
Per-Worker secrets follow Workers permissions, so whoever can edit the Worker can edit the secret. Account-level roles let security teams own the values while developers only bind them.
Envelope encryption with frequently refreshed data keys
Each secret is encrypted with a data key, and the data keys with a key-encryption key whose root never leaves a secure system, which keeps the impact of a single exposed key small.

Timeline

  1. 2020

    Workers gains per-script environment variables and secrets

  2. 2025

    Secrets Store launches in beta on April 9, starting with Workers

  3. 2025

    Limit raised to 100 secrets per account on May 27

  4. 2025

    AI Gateway reads provider keys from Secrets Store from August 25

Sources6 · facts checked 12 October 2026

Improve this page on GitHub