Skip to main content
Delete a secret with Secret.destroy. It returns true when the secret was deleted and false when it didn’t exist.
After deletion succeeds, new secrets lookups cannot resolve the secret. Matching HTTPS requests omit headers referencing it, following the fail-open behavior 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.