Skip to main content

SecretPaginator

Paginator for listing secrets. Example:

next_items

Returns the next page of secrets. Call this method only if has_next is True, otherwise it will raise an exception. Arguments:
  • opts: Per-call connection options (e.g. api_key, domain, headers, request_timeout). When provided, this call uses these options instead of the ones the paginator was constructed with.
Returns: List of secret metadata.

Secret

Module for managing E2B secrets and workload identity helpers. Secret values are write-only: they are accepted by create and update but never returned by any read surface.

create

Create a new secret and its first value. Arguments:
  • name: Name of the secret, unique within the project.
  • value: Secret value. Write-only — never returned by the API.
  • metadata: Customer metadata to store with the secret.
Returns: The secret’s ID, name, current version (1 for a new secret), metadata, and creation and update times.

update

Update a secret’s value by storing it as the secret’s new version. Arguments:
  • secret: Secret ID or name.
  • value: New secret value. Write-only — never returned by the API.
  • metadata: Customer metadata to store with the secret. When provided, replaces the stored metadata.
Returns: The secret’s ID, name, new current version, metadata, and creation and update times.

get_info

Get a secret’s metadata. Arguments:
  • secret: Secret ID or name.
Returns: The secret’s ID, name, current version, metadata, and creation and update times.

list

List the project’s secrets. Arguments:
  • limit: Number of secrets to return per page.
  • next_token: Token to the next page.
Returns: Paginator over the project’s secrets. Drain it page by page:

exists

Check whether a secret exists. Arguments:
  • secret: Secret ID or name.
Returns: True if the secret exists, False otherwise.

destroy

Destroy a secret, making all its versions inaccessible. Arguments:
  • secret: Secret ID or name.
Returns: True if the secret was destroyed, False if it was not found.

SecretBase

Module for managing E2B secrets and workload identity helpers. Secret values are write-only: they are accepted by create and update but never returned by any read surface.

fill

Format a placeholder that the runtime resolves to the secret’s current value. This is a local formatting helper and makes no network call — it does not check whether the named secret exists. An unknown reference fails server-side when the placeholder is resolved. Arguments:
  • secret: Secret name.
Returns: Placeholder string resolving to the secret’s value. Example:

iam_token

Define a workload identity token to pass to iam.tokens when creating a sandbox. Arguments:
  • audience: Audience of the workload token, stored exactly as provided.
  • token_type: Workload token type.
Returns: A token definition passable to iam.tokens. Example:

SecretInfo

Metadata of a secret. Secret values are write-only and never returned.

secret_id

Secret ID.

name

Secret name, unique within the project.

version

Version served to readers that do not name one.

metadata

Customer metadata of the secret.

created_at

Time when the secret was created.

updated_at

Time when the secret was last updated.

AsyncSecretPaginator

Paginator for listing secrets. Example:

next_items

Returns the next page of secrets. Call this method only if has_next is True, otherwise it will raise an exception. Arguments:
  • opts: Per-call connection options (e.g. api_key, domain, headers, request_timeout). When provided, this call uses these options instead of the ones the paginator was constructed with.
Returns: List of secret metadata.

AsyncSecret

Module for managing E2B secrets and workload identity helpers. Secret values are write-only: they are accepted by create and update but never returned by any read surface.

create

Create a new secret and its first value. Arguments:
  • name: Name of the secret, unique within the project.
  • value: Secret value. Write-only — never returned by the API.
  • metadata: Customer metadata to store with the secret.
Returns: The secret’s ID, name, current version (1 for a new secret), metadata, and creation and update times.

update

Update a secret’s value by storing it as the secret’s new version. Arguments:
  • secret: Secret ID or name.
  • value: New secret value. Write-only — never returned by the API.
  • metadata: Customer metadata to store with the secret. When provided, replaces the stored metadata.
Returns: The secret’s ID, name, new current version, metadata, and creation and update times.

get_info

Get a secret’s metadata. Arguments:
  • secret: Secret ID or name.
Returns: The secret’s ID, name, current version, metadata, and creation and update times.

list

List the project’s secrets. Arguments:
  • limit: Number of secrets to return per page.
  • next_token: Token to the next page.
Returns: Paginator over the project’s secrets. Drain it page by page:

exists

Check whether a secret exists. Arguments:
  • secret: Secret ID or name.
Returns: True if the secret exists, False otherwise.

destroy

Destroy a secret, making all its versions inaccessible. Arguments:
  • secret: Secret ID or name.
Returns: True if the secret was destroyed, False if it was not found.