exec, and as files under the sandbox’s home directory.
A sandbox holds only what it asks for, and nothing by default. An agent that
just needs to run npm install is not also carrying your Stripe key.
Groups
A secret belongs to a group, and a group is what a sandbox attaches —aws,
database, github. Create one from a .env file you already have:
ps output, and in CI logs, so there is no KEY=value form —
--from-dotenv, --from-json, --stdin, and the hidden prompt cover every case
without that.
.env file: paste it, and it confirms the names it
is about to store.
Attaching them
--secret-group and --secret are repeatable, and the order matters: on a
name collision, the later one wins. --env is applied last of all.
--env passed to a single exec still wins over the sandbox’s standing
secrets, so a one-off override behaves the way you would expect.
File secrets
Some credentials are files — a service-account JSON, a PEM key, a.netrc:
Changing what a running sandbox holds
runcloud sandbox secrets sbx_abc123
with no flags takes everything back. Restate any --env values you still need;
the platform never stored them, so it cannot put them back.