phala gpu-policy command requires Phala Cloud CLI 1.3.0-beta.1 or newer.
How it works
A GPU policy is stored underrequirements.gpu_policy in your app compose:
gpu_policy, full GPU attestation runs by default.
Configurations
{"attest_gpu": false} works on all GPU instance types (including H200). Only DevTools changes the GPU mode, and only on B200 and B300 GPUs. On other GPUs, the DevTools policy keeps the normal confidential mode and works like attestation off.
By default, GPUs run with confidential computing enabled (or protected PCIe mode on 8-GPU H200 machines); disabling confidential computing altogether is not supported. Use DevTools only for development and profiling, never with private data.
Other supported keys have no CLI presets and must be passed as raw JSON via the API, phala deploy --gpu-policy-file, or phala gpu-policy set --file / --stdin:
allow_debug(boolean): Not recommended; currently has no effect with the GPU attestation tool.allow_insecure_boot(boolean): Not recommended; currently has no effect with the GPU attestation tool.rego(string): A Rego v0 policy inpackage policythat defines the boolean ruledata.policy.nv_match. Its input is the GPU attestation claims array. It also runs whenattest_gpuisfalse, with an empty array as input, so a rule that requires GPU claims stops the CVM from booting. See the dstack GPU security model.
Eligibility
Only CVMs on a GPU instance type running dstack OS 0.6.0 or newer support a GPU policy:- CPU-only CVMs: Sending a policy object fails with
ERR-03-075. Sendingnullis always accepted so you can clear a mistakenly stored policy. - dstack OS 0.5.x: Rejected unless you upgrade to dstack OS 0.6.0 or newer in the same request.
Set a policy on create
CLI
Pass--gpu-policy (attestation-off or devtools) to phala deploy:
--gpu-policy-file:
--gpu-policy and --gpu-policy-file are mutually exclusive, and neither can be combined with --app-compose (define requirements.gpu_policy directly in your app compose file instead).
API
Includerequirements.gpu_policy inside compose_file in POST /cvms:
rego strings fail with HTTP 422.
Update an existing CVM
Set or replace the policy withphala gpu-policy or PATCH /cvms/{cvm_id}:
phala deploy --cvm-id <cvm-name-or-id> -c docker-compose.yml --gpu-policy-file gpu-policy.json. To remove a policy, use phala gpu-policy reset (phala deploy has no reset flag).
Replacement rules
Unlike other objects incompose, which merge key by key, requirements.gpu_policy is replaced as a whole on PATCH /cvms/{cvm_id}:
For example, if the stored policy is
{"allow_devtools": true, "attest_gpu": false} and you patch with {"attest_gpu": false}, allow_devtools is dropped. Sending "requirements": null clears every key under requirements, including gpu_policy.
Passing {} or setting a field to null (such as {"rego": null}) fails with 422. Send "gpu_policy": null to reset, or omit keys you do not want. Empty or whitespace-only rego strings are rejected on both create and update.
Restarts, no-ops, and Onchain KMS
Updating the policy restarts a running CVM (stopping it, writing the new compose, and starting it again, which takes a few minutes). A stopped CVM stays stopped and picks up the new policy on its next start. If the policy you send matches the stored policy’s exact keys and values, nothing changes and the CVM does not restart. Because the comparison is literal rather than semantic,{"attest_gpu": false} and {"attest_gpu": false, "allow_devtools": false} produce different compose hashes and trigger a restart.
On Onchain KMS, register the new compose hash on your app contract before applying the update, just like any other compose change. See What changes for a CVM on Onchain KMS?.
Staging with other changes
To combine a policy change with other updates in a single restart, stage it first and apply the draft together:null overrides an earlier staged policy so the policy is removed on apply. See How do I stage several changes and restart once?.
Inspect the current policy and GPU mode
Observed GPU mode) for each GPU.
Check Observed GPU mode in phala gpu-policy show to see whether DevTools mode is active. Inside the CVM, nvidia-smi conf-compute shows the CC state as ON in both modes.
Via the API, read compose_file.requirements.gpu_policy from GET /cvms/{cvm_id}. Starting in API version 2026-11-11, pass include_compose=true to include compose_file in the response.
Recover from GPU boot failures
If GPU attestation fails at boot, the CVM does not finish booting. The node retries the boot a few times, then the CVM stays stopped. Because a stopped CVM still accepts policy updates, you can temporarily disable GPU attestation and start it again:- If a start is still in progress, stop the CVM first with
phala cvms stop, then run the two commands above. - On Onchain KMS, register the new compose hash on your app contract before starting (the update will report it if missing).
- Once the underlying issue is resolved, run
phala gpu-policy resetto restore full GPU attestation.
Errors
Requests targeting a CVM on dstack OS 0.5.x are also rejected. Upgrade to dstack OS 0.6.0 or newer first.

