drift Docs
Start
What is Drift?
The tour, if you are new here.
Use cases
Whether Drift does your thing.
Getting started
Nothing to deployed, in one command.
Architecture
How a slice is put together.
What it costs
The free grant, four unit prices, two rules.
Build
Canvas
Static sites, same origin as your API.
Tools
Operate
Auth
Accounts, tokens and scopes.
Security
Boundaries, sandboxing and hardening.
Troubleshooting
Error codes
What went wrong, and what to do about it.
Legal
Acceptable use
What a slice may not be used for.
Data processing
The DPA, and every sub-processor.

Secrets

drift.Backbone.Secret: encrypted configuration, read at invocation time.

Signatures

Go
Get(name string) (string, error)   ·   Set(name, value string) error   ·   Delete(name string) error

A function reads; it does not write

The subprocess starts with a cleared environment and never holds the slice's internal token, so Set and Delete answer 401 from inside a function. Secrets are provisioned out of band, with drift backbone secret set, or the Driftfile.

Read secrets through the SDK, not the environment.

Secret.Get resolves the value whichever way the runtime delivered it. Reading os.environ directly works only on the per-invocation subprocess path. Python and Node functions served by the slice's persistent language server get their secrets in the request envelope instead, and the env var is absent.

A function only receives the secrets it names on its own Driftfile entry (secrets: [STRIPE_KEY]). The runner fetches each on every call, so changing a value takes effect on the next request with no redeploy. Adding a name to the list is the part that needs one.