Skip to main content

Zeno secrets adapter: 1Password CLI-backed `SecretsStore` for agent runtime secrets.

Project description

zeno-secrets-1password

1Password-backed SecretsStore for Zeno.

Ships OpCliSecretsStore, a SecretsStore adapter that reads secrets through the 1Password CLI (op read). Intended for agents that run in environments where a 1Password service-account token is available but mounting the raw secret material into the process env is undesirable.

Install

uv add 'zeno-framework[secrets-1password]'

Install the 1Password CLI on the host:

brew install 1password-cli       # macOS
# or follow https://developer.1password.com/docs/cli/get-started/

Export a service-account token:

export OP_SERVICE_ACCOUNT_TOKEN="ops_..."

Usage

from zeno.ai import ZenoApp
from zeno.secrets_1password import OpCliSecretsStore

app = ZenoApp(
    ...,
    secrets=OpCliSecretsStore(
        references={
            "OPENAI_API_KEY": "op://Engineering/openai/credential",
            "STRIPE_KEY":     "op://Engineering/stripe/api_key",
        },
        cache_ttl=60.0,
    ),
)

Inside a tool:

@tool
async def call_stripe(ctx: Ctx) -> str:
    api_key = await ctx.secrets.get("STRIPE_KEY")
    ...

What it does

  • get(name) — if name begins with op://, invokes op read name directly; otherwise looks up the reference in the references map and shells op read <ref>.
  • Results are cached in-process for cache_ttl seconds (default 60). Pass cache_ttl=None to disable caching.
  • Invocations time out at timeout seconds (default 5). The subprocess is killed and reaped on timeout; no ResourceWarning leaks.
  • OP_SERVICE_ACCOUNT_TOKEN is passed to the subprocess via an explicit env dict that inherits only PATH — unrelated parent env vars are not leaked into the op process. Pass token="ops_..." to the constructor to override the env var.
  • Missing op binary → ConfigurationError with an install pointer.
  • Missing token → ConfigurationError raised before the subprocess runs.
  • op read exit codes are inspected: "item not found" / "no such" / "isn't an item" map to SecretNotFoundError; everything else (auth failures, network errors) maps to SecretsBackendError with the stderr text preserved in the message.

Why op CLI, not the Connect HTTP API?

The CLI path works both locally (via 1Password desktop auth) and in CI (via a service-account token) with no Connect server to self-host. Connect-based and SDK-based stores can ship later as sibling classes inside the same package without breaking existing callers.

Part of the Zeno framework.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zeno_secrets_1password-1.0.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zeno_secrets_1password-1.0.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file zeno_secrets_1password-1.0.0.tar.gz.

File metadata

  • Download URL: zeno_secrets_1password-1.0.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zeno_secrets_1password-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bb318b0584186c4f6bf0a8903a854d52b67f3dfdf75748c25e86dc0dc2c5fff7
MD5 e6d35410c3d665c6e368a0e768895945
BLAKE2b-256 1ce542424788e15f02b961b3c52ce4df993e1def9f7ff30a1112df4a04fa1ea4

See more details on using hashes here.

Provenance

The following attestation bundles were made for zeno_secrets_1password-1.0.0.tar.gz:

Publisher: publish.yml on nkootstra/zeno

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zeno_secrets_1password-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for zeno_secrets_1password-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f82f7310ab2ca8be9ef013b7a7f989da3b1f319da431fa2dc2da3cc716e4f0ef
MD5 c894cd3b135ada7072fe1cfcb16e840b
BLAKE2b-256 bebf4277609b7fedc141678e74d2d9472cc4c66c95402af7a5bea0e0ba341057

See more details on using hashes here.

Provenance

The following attestation bundles were made for zeno_secrets_1password-1.0.0-py3-none-any.whl:

Publisher: publish.yml on nkootstra/zeno

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page