Read-path SDK for seekrit — resolve and decrypt secrets client-side with a service token.
Project description
seekrit — Python SDK
Read-path SDK for seekrit. Authenticate with a service token, resolve your environment, and get decrypted secrets — the API only ever returns ciphertext; decryption happens in your process.
This repo is a read-only mirror published from seekrit's monorepo so the code that holds your token and decrypts plaintext is auditable. Don't commit here — it's overwritten on each sync. Issues and PRs welcome.
Install
pip install seekrit
Requires Python 3.9+. The only dependency is cryptography.
Usage
import seekrit
client = seekrit.Client() # token from $SEEKRIT_TOKEN
secrets = client.resolve() # {"DATABASE_URL": "postgres://…", …}
db_url = client.get("DATABASE_URL")
api_key = client.get("API_KEY", default="")
Load everything into the process environment:
import os, seekrit
seekrit.Client().into_env() # existing os.environ vars win by default
print(os.environ["DATABASE_URL"])
Configuration
| Argument | Env var | Default |
|---|---|---|
token |
SEEKRIT_TOKEN |
— (required) |
api_url |
SEEKRIT_API_URL |
https://api.seekrit.dev |
overrides |
— | {} |
timeout |
— | 30.0 (seconds) |
A service token binds to a single app environment (plus its composed group
slices). To pull a different environment slice of a composed group, pass
overrides (the ?with= override):
seekrit.Client(overrides={"shared": "dev"}).resolve()
Errors
SeekritApiError— non-2xx from the API; has.statusand.code("unauthorized","forbidden","not_found", …).SeekritCryptoError— a token or ciphertext could not be parsed/decrypted.SeekritError— base class (also covers network failures).
The client is fail-closed: any resolve or decrypt failure raises rather than returning partial results.
Zero-knowledge
GET /v1/resolve returns ciphertext plus a data-encryption key wrapped to your
token's public key. This SDK recovers the token's private key, unwraps the DEK
(ECDH P-256 → HKDF-SHA256 → AES-256-GCM), and decrypts each secret
(AES-256-GCM, AAD-bound to environmentId/NAME) — the exact scheme used by the
CLI, seekrit run, and every other seekrit client. See
seekrit.dev/docs.
License
MIT
Project details
Release history Release notifications | RSS feed
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 seekrit-0.2.0.tar.gz.
File metadata
- Download URL: seekrit-0.2.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f115abbcde4e9cfcb1d946448f0d7e75082c0c922ec7eec53c6673e7acb5a581
|
|
| MD5 |
b04426f4bb4d805a759568c4cba0c562
|
|
| BLAKE2b-256 |
559d1d6fab901a2fc90f6464737b4f2dfec235ce2ac74da123c9a2492c667a1b
|
Provenance
The following attestation bundles were made for seekrit-0.2.0.tar.gz:
Publisher:
publish.yml on seekritdev/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seekrit-0.2.0.tar.gz -
Subject digest:
f115abbcde4e9cfcb1d946448f0d7e75082c0c922ec7eec53c6673e7acb5a581 - Sigstore transparency entry: 2198506568
- Sigstore integration time:
-
Permalink:
seekritdev/python-sdk@eb0c788e4fab95f94f90f148977e87388709b031 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/seekritdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eb0c788e4fab95f94f90f148977e87388709b031 -
Trigger Event:
push
-
Statement type:
File details
Details for the file seekrit-0.2.0-py3-none-any.whl.
File metadata
- Download URL: seekrit-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8239286739ae86cb4189706cd1df2a7863bd950c85022e7fda401d443f97e782
|
|
| MD5 |
c12b0679126022ba78d0927f426cffaa
|
|
| BLAKE2b-256 |
4be0a18fc25c3153c72c5d6882f8acae3ed6deeedb4e07ba1ab4e1c9cdcd5d57
|
Provenance
The following attestation bundles were made for seekrit-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on seekritdev/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seekrit-0.2.0-py3-none-any.whl -
Subject digest:
8239286739ae86cb4189706cd1df2a7863bd950c85022e7fda401d443f97e782 - Sigstore transparency entry: 2198506950
- Sigstore integration time:
-
Permalink:
seekritdev/python-sdk@eb0c788e4fab95f94f90f148977e87388709b031 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/seekritdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eb0c788e4fab95f94f90f148977e87388709b031 -
Trigger Event:
push
-
Statement type: