drift Docs
Start
What is Drift?
The tour, if you are new here.
Why Drift?
The case for a smaller cloud.
Getting started
Nothing to deployed, in one command.
Architecture
How a slice is put together.
What it costs
The free grant, five 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.

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 in its own directive (@atomic … 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.