Secret

Secret resource class for asynchronous operations.

class runloop_api_client.sdk.async_secret.AsyncSecret(client, name, id=None)[source]

Asynchronous wrapper around a secret resource.

Secrets are encrypted key-value pairs that can be securely stored and injected into Devboxes as environment variables. This wrapper always operates by its account-scoped name, even if it contains an ID from an earlier response. Reads and updates select the greatest ID at lookup; deletion removes all selected matches, nonatomically. Use sdk.secret.from_id(id) for exact row operations.

Example

>>> runloop = AsyncRunloopSDK()
>>> secret = await runloop.secret.create(
...     name="MY_API_KEY",
...     value="secret-value",
... )
>>> info = await secret.get_info()
>>> print(f"Secret: {info.name}, ID: {info.id}")
property id: str | None

Return the secret ID.

Returns:

Captured response ID, or None. Fetching metadata does not refresh this property.

Return type:

str | None

property name: str

Return the secret name.

Returns:

Literal account-scoped secret name

Return type:

str

async get_info(**options)[source]

Retrieve the latest secret details from the API.

Note: The secret value is never returned for security reasons.

Example

>>> info = await secret.get_info()
>>> print(f"Secret: {info.name}, ID: {info.id}, Created: {info.create_time_ms}")
Parameters:

options (Unpack[BaseRequestOptions]) – Optional request configuration

Returns:

API response describing the secret (value not included)

Return type:

SecretView

async update(value, **options)[source]

Update the greatest-ID row matching this name at lookup.

This wrapper remains name-bound and its captured ID is unchanged.

Example

>>> updated = await secret.update("new-secret-value")
>>> print(f"Updated at: {updated.update_time_ms}")
Parameters:
  • value (str) – The new secret value (will be encrypted at rest)

  • options (Unpack[LongRequestOptions]) – Optional request configuration

Returns:

Updated secret view

Return type:

SecretView

async delete(**options)[source]

Delete every selected row matching this name, nonatomically.

A concurrent create can survive. This action is irreversible.

Example

>>> await secret.delete()
Parameters:

options (Unpack[LongRequestOptions]) – Optional long-running request configuration

Returns:

API response acknowledging deletion

Return type:

SecretView

Exact-ID Secret operations, separate from legacy name selectors.

class runloop_api_client.sdk.async_secret_by_id.AsyncSecretById(client, id)[source]

An exact Secret row, obtained with sdk.secret.from_id(id).

Construction makes no request. The ID never changes, but another writer can change the value. Requests retain the generated client’s retry policy and are not exactly-once operations. Use get_info() for the name and metadata; values are never returned.

property id: str

The exact row ID, not a name or an immutable value-version identifier.

async get_info(**options)[source]

Retrieve this row’s metadata. Missing IDs never fall back to names.

Return type:

SecretView

async update(value, **options)[source]

Replace this row’s value, without changing running devbox environments or issued tokens.

Return type:

SecretView

async delete(**options)[source]

Delete only this row. Name readers may then see an older same-name row.

Return type:

SecretView