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

# 删除 Secret

`ppio.secret.delete()` 按名称删除一个活跃的 Secret。被删除的 Secret 不能再被新的沙箱创建、恢复或克隆操作引用；已在运行的沙箱不会被改写。它返回被删除 Secret 的名称。

## 示例

该示例创建一个 Secret，启动一个引用它的沙箱，在沙箱内使用占位符，销毁沙箱，最后在不再需要时删除该 Secret。

<CodeGroup>
  ```python Python theme={null}
  from ppio_sandbox import PPIO

  ppio = PPIO()

  secret_name = "<your-secret-name>"

  deleted_name = ppio.secret.delete(secret_name)
  print("deleted:", deleted_name)
  ```

  ```javascript JavaScript & TypeScript theme={null}
  import { PPIO } from 'ppio-sandbox'

  const ppio = new PPIO()

  const secretName = '<your-secret-name>'

  const deletedName = await ppio.secret.delete(secretName)
  console.log('Deleted:', deletedName)
  ```

  ```bash CLI theme={null}
  ppio secret delete <secret_name>
  ```
</CodeGroup>

<Note>
  删除 Secret 不会改写已在运行的沙箱；它只会阻止新的创建、恢复和克隆操作引用它。当没有任何活跃的执行授权引用底层已退役的值时，该值会被异步清理。你可以复用同一名称创建新的 Secret，它会获得新的版本和占位符。
</Note>
