> ## Documentation Index
> Fetch the complete documentation index at: https://docs.envzero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Control who can destroy environments

> A new Destroy Environment permission and organization policy let you choose which roles can destroy environments and approve a destroy.

> [!WARNING]
>
> **Terraform users:** add `DESTROY_ENVIRONMENT` to the `permissions` of each `env0_custom_role` resource that keeps destroy. When your organization first opts in, env zero adds it to your custom roles that have `RUN_PLAN` or `RUN_APPLY`, so otherwise your next `terraform apply` removes it and those users can no longer destroy.

## Destroy Environment permission

Custom roles have a new permission, **Destroy Environment** (`DESTROY_ENVIRONMENT`). When your organization opts in, a user needs it to destroy an environment, approve a destroy or destroy a workflow sub-environment, from the UI, the API or the CLI. The default roles that can plan or apply include it.

## Opt in to the permission

A new organization policy, **Destroy Environment Permission** in **Organization Settings > Policies**, lets your organization opt in to the permission. The first time your organization opts in, env zero adds the permission to every custom role with **Run Plans** or **Run Applies**, so no user loses access. Remove it from the roles that should not destroy.

New organizations are opted in from the start, and so are existing organizations where no custom role can run plans or applies without the permission. In an opted-in organization, a custom role you create through the API or Terraform can destroy only if it lists `DESTROY_ENVIRONMENT`. To set the policy with Terraform, use `require_destroy_environment_permission` in `env0_organization_policy`.

Learn more: [Destroy Environment permission](https://docs.envzero.com/guides/admin-guide/user-role-and-team-management/custom-roles.md#destroy-environment-permission)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.