Secret broker
Federated facade (not a vault) so AI agents can use secrets from AWS Secrets Manager, 1Password, HashiCorp Vault, and env — without ever reading plaintext.
Agents get secret://… references. A trusted broker process resolves the value and injects it into an HTTP call or child process. Values never appear in MCP results, chat, audit logs, or error strings.
Why this exists
A 2026 spike (SPIKE.md) checked ClauLock, AgentSecrets, asm-exec, and op run.
- Those tools correctly implement references in / values never out.
- Most are a new store, not a front-end to stores you already trust.
- AgentSecrets docs claim AWS-as-source-of-truth delivery; source code only reads the OS keychain (copy-in via
secrets set/pull). - No existing tool live-reads AWS + 1Password + Vault behind one allowlisted inject API.
So this repo is the thin federated adapter layer.
Security invariant
Secret bytes exist only inside the broker/wrapper process. HTTP inject without a destination allowlist is a confused deputy and is denied by default.
There is no get / cat / show / reveal command or MCP tool.
Install
pip install -e '.[dev]'
# optional adapters
pip install -e '.[aws,vault]'
Copy examples/config.example.toml to ~/.config/secret-broker/config.toml and enable the stores you use.
CLI
secret-broker stores
secret-broker list
secret-broker describe secret://aws/my-app/db
secret-broker policy show
secret-broker policy allow-host api.github.com
secret-broker policy allow-bin curl
# HTTP inject (prints redacted downstream body only)
secret-broker call --url https://api.github.com/user \
--ref secret://env/GITHUB_TOKEN --inject bearer
# Env inject into a child process
secret-broker run --ref TOKEN=secret://memory/TOKEN -- python3 -c 'import os; print("ok")'
secret-broker audit
secret-broker doctor
secret-broker mcp # stdio MCP for any harness
# Install into agent harnesses (Cursor, Claude Code, Codex, OpenCode, Continue)
secret-broker harness list
secret-broker harness install cursor
secret-broker harness install claude-code --hooks
secret-broker harness install --all --scope project --hooks
Shell completions: secret-broker --install-completion
Harness details: docs/HARNESSES.md.
Reference forms
| Backend | Example |
|---|---|
| Env | secret://env/MY_TOKEN |
| Memory (tests) | secret://memory/NAME |
| AWS SM | secret://aws/<secret-id>#<json-key> |
| 1Password | secret://op/<vault>/<item>/<field> |
| Vault KV | secret://vault/<mount>/<path>#<field> |
MCP + harness plugins
Publishable harness artifacts live in plugins/. Installers:
secret-broker harness install cursor
# or: claude-code | codex | opencode | continue
secret-broker harness install --all --scope project --hooks
Packaging: monorepo plugins/ today; break out via package registries later (not git submodules). See plugins/README.md.
Manual Cursor example (.cursor/mcp.json / ~/.cursor/mcp.json):
{
"mcpServers": {
"secret-broker": {
"command": "secret-broker",
"args": ["mcp"]
}
}
}
Tools: list_secrets, describe_secret, api_call, run_command, list_stores, policy_show, audit_tail.
Not provided: anything that returns secret bytes.
Claude Code / Codex can also install a PreToolUse hook (--hooks) that blocks aws get-secret-value, op read, vault kv get, etc., and steers the agent back to secret-broker.
Architecture
Cursor / Claude Code / Codex / OpenCode / Continue / CLI
│ refs only (+ optional PreToolUse hooks)
▼
secret-broker (Typer CLI ≡ MCP ≡ harness plugins)
│ shared Broker library
├─ policy (host/bin allowlists)
├─ audit JSONL (no value field)
└─ adapters: aws | op | vault | env | memory
│ live-read at use time
▼
your existing stores
CLI, MCP, and harness installers share the same broker so a policy hole cannot exist on only one surface.
Development (TDD)
pip install -e '.[dev]'
pytest -q -m "not e2e_live" # unit + local E2E (CI default)
pytest -q -m e2e # local end-to-end only
# Live backends (opt-in): see TESTING.md
Full testing guide for humans and agents: TESTING.md.
CI runs on every PR (lint + pytest 3.11–3.13 + wheel smoke). Releases publish to PyPI via Trusted Publishing — see docs/CI.md.
License
MIT — see LICENSE.
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 secret_broker-0.1.0.tar.gz.
File metadata
- Download URL: secret_broker-0.1.0.tar.gz
- Upload date:
- Size: 43.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6de91eb4b1e67fbf3a8144ae3d7806133c3c3fd5c6feba94c65478c5646baf13
|
|
| MD5 |
ef98a270b29c9770641df4b7ccd4c728
|
|
| BLAKE2b-256 |
8688c91927632e17b6870b674c2aaf33399ed30af2360f5b0c137ccbd5eaa0c4
|
Provenance
The following attestation bundles were made for secret_broker-0.1.0.tar.gz:
Publisher:
publish.yml on sroomberg/secret-broker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
secret_broker-0.1.0.tar.gz -
Subject digest:
6de91eb4b1e67fbf3a8144ae3d7806133c3c3fd5c6feba94c65478c5646baf13 - Sigstore transparency entry: 2810875339
- Sigstore integration time:
-
Permalink:
sroomberg/secret-broker@b465cfb029bd860ae6e080319ce56043f8047918 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sroomberg
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b465cfb029bd860ae6e080319ce56043f8047918 -
Trigger Event:
push
-
Statement type:
File details
Details for the file secret_broker-0.1.0-py3-none-any.whl.
File metadata
- Download URL: secret_broker-0.1.0-py3-none-any.whl
- Upload date:
- Size: 49.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0d4f669cf82b4ceae3475db53b0283185f99fdaeff439031cbcecb91e904343
|
|
| MD5 |
3361262e5cc442cdc39aae3f90d41ce3
|
|
| BLAKE2b-256 |
f3320391af1bc2f7348d7ec7c8cab832ec05372a8b3f066327bbc4d48a71aa0f
|
Provenance
The following attestation bundles were made for secret_broker-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on sroomberg/secret-broker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
secret_broker-0.1.0-py3-none-any.whl -
Subject digest:
b0d4f669cf82b4ceae3475db53b0283185f99fdaeff439031cbcecb91e904343 - Sigstore transparency entry: 2810875369
- Sigstore integration time:
-
Permalink:
sroomberg/secret-broker@b465cfb029bd860ae6e080319ce56043f8047918 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sroomberg
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b465cfb029bd860ae6e080319ce56043f8047918 -
Trigger Event:
push
-
Statement type: