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

# Deleting secrets

> Revoke a stored secret and understand what happens to sandboxes that reference it.

Delete a secret with `Secret.destroy`. It returns `true` when the secret was deleted and `false` when it didn't exist.

<CodeGroup>
  ```js JavaScript & TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  import { Secret } from 'e2b'

  await Secret.destroy('stripe_api_key') // true
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  from e2b import Secret

  Secret.destroy("stripe_api_key")  # True
  ```
</CodeGroup>

After deletion succeeds, new secrets lookups cannot resolve the secret. Matching HTTPS requests omit headers referencing it, following the [fail-open behavior](/secrets/inject#resolution-failures-are-silent-for-traffic) of unresolved references. Requests that already resolved its value can still use it. Stored versions are cleaned up asynchronously.

Deleting a secret from E2B does not revoke the credential at its provider. Revoke the API key or token there as well when you need to invalidate it.

Markers reference secrets by name, so deleting and recreating a name makes matching requests resolve the new secret's value. The recreated secret receives a new `sec_...` identifier and starts again at version 1.
