# atmos secret delete

Remove a declared secret's value from its configured backend. Atmos prompts for confirmation before deleting unless you pass `--force`. The secret declaration in your stack configuration is not modified — only the stored value is removed. Pass `--all` to clear every declared secret for the scope (a clean, in-process reset of a SOPS file). This command is also available under the `rm` alias.

## Usage

```shell
atmos secret delete NAME [flags]
atmos secret delete --all [flags]
```

## Examples

```shell
# Delete a secret value, prompting for confirmation
atmos secret delete DATADOG_API_KEY --stack=prod --component=api

# Delete without a confirmation prompt
atmos secret delete DATADOG_API_KEY --stack=prod --component=api --force

# Clear ALL declared secrets for the scope (resets a SOPS file to a clean state)
atmos secret delete --all --force --stack=prod --component=api

# Use the `rm` alias
atmos secret rm DATADOG_API_KEY --stack=prod --component=api

# Delete using a specific identity for the backend
atmos secret delete DATADOG_API_KEY --stack=prod --component=api --identity=aws/prod-secrets
```

## Arguments

- **`NAME`**

  The name of the declared secret whose value is removed.

## Flags

- **`--stack` (alias `-s`)**

  The Atmos stack to operate on. **Required.**

  **Environment variable:** `ATMOS_STACK`
- **`--component` (alias `-c`)**

  The Atmos component that declares the secret. **Required.**

  **Environment variable:** `ATMOS_COMPONENT`
- **`--type`**

  The component type (`terraform`, `helmfile`, `packer`, or `ansible`). Used to disambiguate when a component name exists in more than one type.
- **`--identity` (alias `-i`)**

  The identity to use when accessing the secret backend.

  **Environment variable:** `ATMOS_IDENTITY`
- **`--force` (alias `-f`)**

  Delete the value without prompting for confirmation.
- **`--all`**

  Delete every declared secret's value for the scope instead of a single `NAME`. For a SOPS file this resets it to a clean state in-process. The `NAME` argument is omitted when `--all` is used.

## See Also

- [atmos secret](/cli/commands/secret/usage) — Overview of the secret command group
- [`!secret` YAML function](/functions/yaml/secret) — Resolve declared secrets at runtime
