runcloud credentials reads the logins already on your machine (gcloud, AWS,
GitHub, Claude Code, or any file or command you name) and keeps them pushed to
secret groups. A sandbox that takes one of those groups
holds the current credentials, and keeps holding them as they rotate.
It works on macOS and Linux. It uses no server feature beyond secret groups, so
a sandbox takes the groups the way it always does:
The config file
Everything the sync does is listed in~/.run-cloud/credentials.yaml (mode
0600). It is the whole contract: what is in this file is exactly what leaves
your machine, and nothing else is ever uploaded. Edit it by hand or with
runcloud credentials add.
Presets
Adding a preset checks that the tool is installed and signed in, and tells you
the login command to run if it is not.
Your own entries
A custom entry has one source and one target.
The usual secret limits apply, and the CLI checks
them before it sends anything.
SBX_ names are refused. A single item over
32 KiB is refused, and status warns when a group passes 48 KiB, because 64 KiB
is the limit for everything a sandbox takes.
Commands
add edits the YAML and keeps your comments and order. It prints what each
entry resolves to, asks Push these to group <group>? [y/N] (or pass --yes),
and then pushes that group right away.
push pushes only what changed since the last successful push, and prints one
line per group: pushed, unchanged, or the warning. --force pushes everything
again, which also repairs a secret someone deleted by hand. A group name that is
not in credentials.yaml is an error. A push with no group names also deletes
the secrets of groups you took out of the file.
remove deletes the secrets the sync pushed for that group or entry, and takes
them out of every running sandbox that takes the group. It deletes first: if a
delete fails, remove says which names failed, leaves credentials.yaml as it
was, and exits 1. Names it did delete are pushed again by the next push.
--keep-remote leaves the secrets in your org and only stops managing them.
status shows each group’s last push, size and warnings, and how often each
command reruns (refreshes every 30m). A group that is still recorded but no
longer in the file shows as no longer in credentials.yaml until the next push
deletes its secrets.
Warnings, status and the agent log name an entry by its group, index and kind
(group "stripe" entry 1 (command)), never by the command text, which can hold
a credential.
Before each sandbox
runcloud sandbox create and runcloud sandbox shell push first when the config
file exists. The push has a 10 second budget, and a failure is a one-line
warning: the command carries on. Set RUNCLOUD_CREDENTIALS_PUSH=0 to turn it
off.
The background agent
refresh timer, and rereads the YAML every minute. After you edit the YAML it
pushes every group, so an entry or group you take out has its secrets deleted. A
failed push retries within 5 minutes. It logs group and entry names and
outcomes, never values or command text, to ~/.run-cloud/logs/credentials.log.
It needs no sudo. The unit runs the same binary that installed it, with your
PATH recorded, so gcloud, aws and gh are found. Only one agent runs per
machine. While it runs, sandbox create and sandbox shell skip their own push.
The unit records the path of the Node binary that installed it. After you
upgrade or switch Node (for example with nvm), run
runcloud credentials sync --install again.
--install needs a stored login that does not expire, because the agent cannot
see your shell’s environment and a browser login expires. Create a token and log
in with it:
read -rs takes the token without echoing it and keeps it out of your shell
history. While login runs, the token is briefly visible to other processes on
your machine.
--install refuses, and says so, when the login comes only from environment
variables or has an expiry. status shows the same warning.
Groups the sync did not create
A group you list is managed by the sync, so it takes care not to touch anything it did not write:- The first push into a group that already holds secrets the sync did not write
is refused. Run
runcloud credentials push --adopt <group>once to take it over. - The sync deletes only names it wrote itself, never names it finds in the org.
- A failed read (a missing file, a command that errors or times out, empty
output) pushes nothing for that entry and never deletes the names that entry
owns. When the failed entry is a
dotenvcommand, whose names come from its output, nothing in the group is deleted that run. The other entries are still pushed, and the group shows as failed. A credential in a group is never blanked by a local hiccup. - A generated file name, with its
-2suffix, depends only on the order of the entries in the YAML, never on which entries read. - A failed push deletes nothing.
What you should know
Writing a secret needs the admin or owner role. The CLI cannot check your role up front, so a refused write saysadmin or owner role required to write secrets in this org. When you set org:, it says refused (403): needs admin or owner role in this org, or org "<org>" is not one you belong to: check that
org: is an org id you belong to. Ask an admin to push, or to change your role.
Groups belong to the org, not to you. Any admin can see a group’s names, and
any sandbox in the org can take it. Name groups accordingly, and do not put a
personal credential in a group a colleague’s sandboxes take.
A pushed credential acts as you wherever a sandbox uses it.
Logging out locally does not revoke a pushed credential. Remove it with
runcloud credentials remove, or rely on the provider’s expiry. AWS role
credentials expire within hours. Google refresh tokens last until the account’s
reauth interval.
Removing an entry or a group takes the credential out of every running
sandbox that takes the group, because secret groups stay current.
Sync a group from one machine only. Two machines syncing the same group
overwrite each other in turn, and nothing on the server can tell them apart.
Nothing secret is kept locally besides your own files. The state file
(~/.run-cloud/credentials-state.json) holds hashes, times, outcomes and the
names written. It never holds a value.