vars object in wrangler.json instead. See Vars and Secrets.
Naming and size rules
Every Secret belongs to one App and must follow these rules:- Name:
1to128characters matching^[A-Z_][A-Z0-9_]{0,127}$. Use uppercase ASCII letters (A-Z), digits (0-9), and underscores (_). A name cannot start with a digit. - Value: Non-empty UTF-8 string up to
64 KiB(65,536bytes).
vars object of wrangler.json, the Secret’s value overrides the vars key at runtime.
How Secrets reach your App
In your Worker code, read a Secret from theenv argument passed to your handler (env.SECRET_NAME):
index.js
Manage Secrets with the API
Only organizationowner and admin roles can create, update, or delete Secrets. Organization member roles can list Secret names and metadata.
Create or update a Secret
CallPUT /api/apps/{id}/secrets/{name} to create a Secret or replace its value:
List or inspect Secrets
CallGET /api/apps/{id}/secrets to list all Secrets on an App, or GET /api/apps/{id}/secrets/{name} (using the Secret name, such as STRIPE_SECRET_KEY) to check whether a specific Secret exists.
Delete a Secret
CallDELETE /api/apps/{id}/secrets/{name}:
POST /api/apps/{id}/deployments).
Provide Secrets to a waiting agent turn
When the in-product agent needs one or more Secrets to finish a task, its turn pauses withstatus: "waiting" and an input_request of kind: "secrets":
expires_at, the turn fails with input_expired.
As soon as you set every requested Secret (in the dashboard chat card or via PUT /api/apps/{id}/secrets/{name}), Judt automatically marks the request resolved and resumes the agent turn. If you do not want to provide the Secret, call POST /api/apps/{id}/sessions/{session_id}/turns/{turn_id}/decline so the agent continues without it.
Next steps
- Learn how
envbindings work in Worker code in Vars and Secrets. - Learn how the in-product agent requests Secrets in Build a workflow around the Judt agent.