Skip to main content

secretcarousel

Python SDK for SecretCarousel — the secret vault your coding agents run themselves. Store, rotate, and hand off credentials from any Python agent, so they stop passing keys in plain text.

Install

pip install secretcarousel

Quick Start

from secretcarousel import SecretCarouselClient

sc = SecretCarouselClient(api_key="sc_...")

# Store a secret — AES-256-GCM encrypted at rest; returns an id, never echoes the value
secret = sc.create_secret(
    "DATABASE_URL",
    "postgres://user:pass@host/db",
    secret_type="database-credentials",
)

# Retrieve by id — decrypted on demand, access-logged
result = sc.get_secret(secret["secretId"])
print(result["value"])

# List / search — ids + names, never values
sc.list_secrets()
sc.search_secrets("stripe")

# Rotate now
sc.rotate_secret(secret["secretId"])

Self-provision — no key, no human

An agent can bootstrap its own vault mid-session:

sc = SecretCarouselClient.signup("my-project")
print(sc.api_key)  # save this — shown once

Claim tokens — hand a secret to another agent

Mint a one-time, scoped, expiring token; another agent — different project, even different company — redeems it exactly once, and the token burns. The plain-text value never crosses the boundary as a copy-pasteable string, and every mint/redeem lands in the audit trail.

# Agent A: hand a secret to another tenant/agent
token = sc.create_claim(
    "<the-secret-value>",
    target_tenant_id="partner-tenant",
    contract_id="CTR-ID",
)

# Agent B: redeem the token you were handed (once, audited)
sc.redeem_claim(token["token"])

# List the tokens you've minted + their status
sc.list_claims()

Sharing — time- and view-limited links for humans

share = sc.create_share(secret["secretId"], expiration_hours=1, max_uses=1)
sc.list_shares()

Environments — .env in, .env out

sc.export_env(env="production")
sc.promote_secrets(from_env="staging", to_env="production")

Features

  • Zero dependencies — stdlib urllib only
  • Full type hints — mypy compatible, ships py.typed
  • Secrets — store, retrieve, update, delete; AES-256-GCM at rest; typed
  • Claim tokens — one-time, scoped, expiring, audited cross-tenant handoff
  • Sharing — time- and view-limited links
  • Rotation — rotate now or check schedule/status
  • Environments — export as .env, promote between environments
  • Audit trail — immutable event log, exportable as CSV
  • Agent self-signup — provision a vault with no key and no human

API

Method Description
SecretCarouselClient.signup(tenant_id) Self-provision a vault, returns an authenticated client
list_secrets(**query) List secrets (metadata only)
search_secrets(q, **query) Search by name/tag/description
get_secret(id) Get a secret with decrypted value
create_secret(name, value, secret_type=None, **extra) Create a secret
update_secret(id, **data) Update (creates a new version)
delete_secret(id) Delete a secret
rotate_secret(id, **options) Rotate now
get_rotation_status(id) Rotation schedule + status
create_share(secret_id, expiration_hours=None, max_uses=None) Create a share link
list_shares(**query) / get_share(id) List / get shares
revoke_share(id) / extend_share(id, **data) Revoke / extend a share
access_share(token) Redeem a share link (consumes a view)
create_claim(secret_value, target_tenant_id, contract_id, ...) Mint a claim token
redeem_claim(token) Redeem a claim token (once, audited)
list_claims(**query) / get_claim(id) / revoke_claim(id) Manage claim tokens
export_env(**query) / promote_secrets(**data) Environment import/export
get_audit_logs(**query) / export_audit_csv(**query) Audit trail
create_backup(**data) / list_backups(**query) Backups

All list/query methods accept keyword filters (e.g. sc.list_secrets(limit=50)). Non-2xx responses raise a typed SecretCarouselError subclass (AuthenticationError, ForbiddenError, NotFoundError, ValidationError).

Links

License

Proprietary — Tyga.Cloud Ltd. See LICENSE file.

Download files

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

Source Distribution

secretcarousel-2.0.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

secretcarousel-2.0.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file secretcarousel-2.0.0.tar.gz.

File metadata

  • Download URL: secretcarousel-2.0.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for secretcarousel-2.0.0.tar.gz
Algorithm Hash digest
SHA256 3926ad521f8d56310504dc2c57b25735ec470449df5593fbe019574402f8b034
MD5 e4fe88229f26a3d3f0afb9542ff8d02c
BLAKE2b-256 6a130f084370cd2368cfb88924164170dd86c5daa7fdaaf84196a1775dad5123

See more details on using hashes here.

File details

Details for the file secretcarousel-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: secretcarousel-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for secretcarousel-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e6eac5f97e44b5f7680184ad55c405514e97d0e1c13711e91cd10d7ca0845ff
MD5 eeae54e31cce0aab9e0afa4b98128e2d
BLAKE2b-256 9dbac0b6c60bd200c55e8c467895b7dcec238cd40926be3b5dbba3b60421763c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page