cloudlease deploys two Workers from one workspace, and they share no secrets.
cloudlease-machines(apps/machines) is trusted. It holds the DigitalOcean, phoenixNAP, Latitude.sh and AWS keys and boots machines withTrustedBootdata: files and commands that may carry secrets, read only by the cloud account and the machine. Only client apps holding one of its client tokens can create runs.cloudlease-queue(apps/queue) is untrusted. It holds only the Vast.ai key, the Modal adapter token, its own admin and operator tokens, the bootstrap signing key and pull-only registry logins. It rents hosts that must be treated as hostile, so it never holds a trusted provider's key. A leaked worker credential, a malicious Vast.ai host or a compromised queue Worker cannot create, read or delete anything the machines Worker owns.
Keep the two deployments' secrets apart: never set a trusted provider key, a machines client token or another app's credential on the queue Worker, and never reuse its admin, operator or bootstrap signing secrets elsewhere. The admin and operator tokens must differ from each other and from every queue's worker token; the queue refuses a worker token equal to either.
The type system enforces the boot split. Vast.ai's CloudProvider is in the Untrusted zone
and takes only an UntrustedBoot: a digest-pinned image, its command, an optional pull-only
registry login and the four CLOUDECK_* bootstrap variables. It has no field for any other
secret, and a Vast.ai worker profile that names allowed_secrets is refused.
Treat every rented GPU host and provider creation path as untrusted. The provider or machine operator can inspect instance arguments, environment, storage, processes and memory. A verified or datacenter label can reduce some risk, but it is not a secret-protection boundary.
Never give a rented Vast.ai worker:
- a GitHub PAT, OAuth token, GitHub App key or GitHub CLI credential
- an SSH or GPG private key
- a registry push, delete or administration credential
- a cloud, package-publisher, cloudlease admin, cloudlease operator or machines client credential
- a wallet mnemonic, passphrase, private key, recovery state or other secret workload input
Put private Vast.ai worker images in a dedicated registry account, group or project that holds only images meant for Vast.ai workloads. That registry must have no source-control authority and no unrelated images.
Give Vast.ai a dedicated, short-lived, pull-only credential for one image repository or
worker class, set on the queue Worker as CLOUDLEASE_SECRET_<NAME> and named by the profile's
registry_auth_secret. It must not push, replace, delete or administer images. Assume it is
exposed as soon as it is sent to the provider. Publish signed images with a separate
trusted-builder identity and deploy them by digest; never send the builder identity to
Vast.ai. Do not use GHCR with a GitHub token for a Vast.ai launch.
A public digest-pinned image is also acceptable when disclosure is safe, and needs no registry credential. A private registry limits a credential's blast radius, but it cannot stop the provider from copying an image it is allowed to pull.
Each managed worker boots with a launch-specific, one-time bootstrap token. It expires after ten minutes, works once, and grants access only to its assigned queue; the worker credential it is exchanged for is revoked once the worker's instance is proven gone. It is not permission to send reusable service credentials to the worker.
Encryption in transit does not protect a secret after the worker decrypts it in provider-controlled memory. Use rented Vast.ai workers only for workloads whose inputs, intermediate values and results are safe under this trust model.
Modal profiles may name Modal-side secrets in allowed_secrets and registry_auth_secret.
The queue Worker passes those names to the adapter in providers/modal, which resolves them
inside Modal; their values never pass through cloudlease. Keep the adapter's bearer token
(CLOUDLEASE_MODAL_PROVIDER_TOKEN) for the queue Worker alone.
Do not put a reusable R2 access key and secret key in a worker profile. Keep the parent R2 credential outside agent, cloudlease and worker environments.
For work that needs several R2 operations, mint one temporary credential for the exact bucket and run prefix, with only the object operations it needs. Its remaining lifetime must be more than zero and no more than 24 hours. Bind the access key, secret key, session token and absolute Unix expiry as four separate values.
For one exact upload or download, use an object-specific presigned URL that expires within 24 hours. Treat temporary credentials and presigned URLs as bearer capabilities: keep them out of logs, command arguments, persisted requests and tool output.
A Vast.ai profile must not receive R2 credentials. It may receive a presigned URL only for an object whose content is safe for the provider to copy and inspect.
The queue Worker counts every Vast.ai worker at its profile's max_hourly_price_cents from
before the rent until the instance is proven gone. HOURLY_SPEND_CAP_CENTS bounds what all
of them together may cost per hour, and each pool stops at its spend_cap_cents, else
QUEUE_RUN_SPEND_CAP_CENTS. Unset, they default to 100 cents an hour and 1,000 cents a
pool. Both alert to ntfy.
A pool stops before its cap: it reserves ten minutes of every live worker's rate for teardown, and a stopping pool ends every worker's lease at once so their deletes run together. Vast.ai keeps billing each instance until its delete is confirmed, so a provider outage that holds deletes up for longer can still run past the cap.
The queue Worker meters only Vast.ai. Modal workers are not counted against either cap, and
a Modal pool that sets spend_cap_cents is refused; bound Modal spend with each profile's
timeout_seconds and Modal's own workspace limits.
Every managed worker needs public egress to reach its bootstrap URL, so egress is the only
network policy a worker profile may name.
Use the repository host's private security-advisory channel. Do not put a credential, worker token, bootstrap token, provider request, private image login or sensitive workload value in a public issue.