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
urllibonly - 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
- Quick Start: https://secretcarousel.com/docs/quickstart.html
- API Reference: https://secretcarousel.com/api
- CLI: https://www.npmjs.com/package/secretcarousel
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3926ad521f8d56310504dc2c57b25735ec470449df5593fbe019574402f8b034
|
|
| MD5 |
e4fe88229f26a3d3f0afb9542ff8d02c
|
|
| BLAKE2b-256 |
6a130f084370cd2368cfb88924164170dd86c5daa7fdaaf84196a1775dad5123
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e6eac5f97e44b5f7680184ad55c405514e97d0e1c13711e91cd10d7ca0845ff
|
|
| MD5 |
eeae54e31cce0aab9e0afa4b98128e2d
|
|
| BLAKE2b-256 |
9dbac0b6c60bd200c55e8c467895b7dcec238cd40926be3b5dbba3b60421763c
|