What does a launch token protect against?
Your compose is public. Anyone can read it, and it holds only the token’s hash, not the token. Someone who has your compose but not the token cannot start a CVM that boots it, because the boot check fails. The token does not change your app’s keys, app ID or instance ID. It only decides whether the CVM may start.What does it not protect against?
The token does not hide anything from the host. Phala Cloud passes the token to the CVM through its user config, which Phala Cloud and the node operator can read. Do not treat it as a secret the host cannot see.How do I create a CVM with a launch token?
Add one of these fields to the create request (POST /cvms):
"launch_token": "<your token>"to use your own token. It must be at least 32 bytes long."generate_launch_token": trueto have Phala Cloud make one.
compose_file.requirements.launch_token_hash for you. When the create stores a new token on the app, the response that creates the CVM returns it once, in launch_token. Save it.
With the CLI, use phala deploy --launch-token <your token> or phala deploy --generate-launch-token.
The token belongs to the app, not to one CVM. If the app already has a token, a create uses it. Sending a different token fails with ERR-03-044.
Do replicas need their own token?
No. Every CVM of an app shares the app’s token, and Phala Cloud gives it to each replica. A replica of a CVM whose compose requires a token fails if the app has no token.How do I see the token later?
CallGET /cvms/{cvm_id}/user_config. When the CVM’s compose requires a token, the response includes launch_token. Any workspace member who can read the CVM can see it. CVM lists never show it.
How do I add a token to an app that already runs?
-
Set the app’s token with
POST /apps/{app_id}/launch-token. Send{"launch_token": "<your token>"}, or an empty body to have Phala Cloud make one. The response returnslaunch_tokenandlaunch_token_hashonce. With the CLI:phala apps launch-token set <app-id>. -
Update each CVM of the app to require it, with
PATCH /cvms/{cvm_id}:With the CLI:phala deploy --cvm-id <cvm-id> --launch-token-hash <launch_token_hash>.
ERR-03-043.
How do I rotate the token?
Rotation works the same way: set a new token on the app withPOST /apps/{app_id}/launch-token, then update each CVM’s launch_token_hash to the new hash.
Between those two steps, a CVM that restarts fails to boot. It gets the new token, but its compose still has the old hash. Update every CVM right after you set the new token, and avoid restarting CVMs until you are done.
How do I remove the token?
Remove it in two steps, in this order:-
Update each CVM to drop the hash:
With the CLI:
phala deploy --cvm-id <cvm-id> --launch-token-hash "". -
Clear the app’s token with
DELETE /apps/{app_id}/launch-token, orphala apps launch-token clear <app-id>.

