Launch policies override the [VM metadata variables](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#metadata-variables)
set by workload operators to restrict malicious actions. A workload author can
set policies with a [label](https://docs.docker.com/engine/reference/builder/#label)
as part of building their container image.

For example, in a `Dockerfile`:

    LABEL "tee.launch_policy.allow_cmd_override"="true"

In a [Bazel](https://bazel.build/) BUILD file:

    container_image(
        ...
        labels={"tee.launch_policy.allow_cmd_override":"true"}
        ...
    )

The available launch policies are in the following table:

| Policy | Type | Description |
|---|---|---|
| `tee.launch_policy.allow_capabilities` **Interacts with:** - **Workload operator** : The [`tee-added-capabilities`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-added-capabilities) metadata variable. | Boolean (default is `false`) | Determines if the workload operator can add additional [Linux capabilities](https://man7.org/linux/man-pages/man7/capabilities.7.html) to the workload container. |
| `tee.launch_policy.allow_cgroups` **Interacts with:** - **Workload operator** : The [`tee-cgroup-ns`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-cgroup-ns) metadata variable. | Boolean (default is `false`) | Determines if workload container is allowed to include a namespaced [cgroup](https://docs.kernel.org/admin-guide/cgroup-v1/cgroups.html) mount at `/sys/fs/cgroup`. |
| `tee.launch_policy.allow_cmd_override` **Interacts with:** - **Workload operator** : The [`tee-cmd`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-cmd) metadata variable. - **Data collaborators** : The [`container.cmd_override`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/attestation-assertions?tab=container-assertions#cmd-override) assertion. | Boolean (default is `false`) | Determines if the [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd) specified in the workload container's `Dockerfile` can be overridden by a workload operator with the [`tee-cmd`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-cmd) metadata value. |
| `tee.launch_policy.allow_env_override` **Interacts with:** - **Workload operator** : The [`tee-env-ENVIRONMENT_VARIABLE_NAME`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-env) metadata variable. - **Data collaborators** : The [`container.env`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/attestation-assertions?tab=container-assertions#env) and [`container.env_override`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/attestation-assertions?tab=container-assertions#env-override) assertions. | Comma-separated string | A comma-separated string of permitted environment variable names that are allowed to be set by a workload operator with [`tee-env-ENVIRONMENT_VARIABLE_NAME`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-env) metadata values. |
| `tee.launch_policy.allow_mount_destinations` **Interacts with:** - **Workload operator** : The [`tee-mount`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-mount) metadata variable. | Colon-separated string | A colon-separated string of permitted mount directories the workload operator is allowed to mount to using `tee-mount`. For example: `/run/tmp:/var/tmp:/tmp` |
| `tee.launch_policy.log_redirect` **Interacts with:** - **Workload operator** : The [`tee-container-log-redirect`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-container-log-redirect) metadata variable. | Defined string | Determines how logging works if [`tee-container-log-redirect`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-container-log-redirect) is set to `true` by a workload operator. The valid values are the following: - `debugonly` (default): Only allow `stdout` and `stderr` redirects when using a debug image. - `always`: Always allow `stdout` and `stderr` redirects. - `never`: Never allow `stdout` and `stderr` redirects. |
| `tee.launch_policy.monitoring_memory_allow` **Interacts with:** - **Data collaborators** : The [`monitoring_enabled.memory`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/attestation-assertions?tab=vm-assertions#instance_memory_monitoring_enabled) assertion. - **Workload operator** : The [`tee-monitoring-memory-enable`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-monitoring-memory-enable) metadata variable. | Defined string | Determines how workload memory usage monitoring works if [`tee-monitoring-memory-enable`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-monitoring-memory-enable) is set to `true` by a workload operator. The valid values are the following: - `debugonly` (default): Only allow memory usage monitoring when using a debug image. - `always`: Always allow memory usage monitoring. - `never`: Never allow memory usage monitoring. > [!CAUTION] > **Caution** : If you allow memory usage monitoring, the workload operator can see workload memory usage metrics in [Cloud Logging](https://docs.cloud.google.com/logging) and [Metrics Explorer](https://docs.cloud.google.com/monitoring/charts/metrics-explorer). If your workload isn't written in a way that prevents total memory usage from leaking sensitive information, block this feature on production workloads. |
| `tee.launch_policy.nonroot_container` **Interacts with:** - **Workload operator** : The [`tee-nonroot-container`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-nonroot-container) metadata variable. | Defined string | Determines whether to restrict the container's execution privileges. The valid values are the following: - `unrestricted` (default): The workload author allows the container to run as root or non-root. The workload operator chooses using [`tee-nonroot-container`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-nonroot-container). - `nonrootonly`: The workload author requires the container to run as a non-root user. The workload operator must set [`tee-nonroot-container`](https://docs.cloud.google.com/confidential-computing/confidential-space/docs/reference/metadata-variables#tee-nonroot-container) to `true`, or the VM fails to launch the workload. > [!NOTE] > **Note** : Supported in Confidential Space image `confidential-space-261001` and later. If used on earlier images, this policy is ignored and the container runs as root. |