Skip to main content

Secret broker

CI

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.

Metadata

Release files for secret-broker 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for secret-broker 0.1.0
File Size Uploaded Provenance Actions
secret_broker-0.1.0.tar.gz 43.1 kB With provenance Details for secret_broker-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for secret-broker 0.1.0
File Interpreter ABI Platform Actions
secret_broker-0.1.0-py3-none-any.whl Python 3 none any Details for secret_broker-0.1.0-py3-none-any.whl

Total release size: 93.0 kB

Release files / secret_broker-0.1.0.tar.gz

Download URL secret_broker-0.1.0.tar.gz
Size 43.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6de91eb4b1e67fbf3a8144ae3d7806133c3c3fd5c6feba94c65478c5646baf13
BLAKE2b-256 checksum
How to use checksums
8688c91927632e17b6870b674c2aaf33399ed30af2360f5b0c137ccbd5eaa0c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log

Release files / secret_broker-0.1.0-py3-none-any.whl

Download URL secret_broker-0.1.0-py3-none-any.whl
Size 49.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0d4f669cf82b4ceae3475db53b0283185f99fdaeff439031cbcecb91e904343
BLAKE2b-256 checksum
How to use checksums
f3320391af1bc2f7348d7ec7c8cab832ec05372a8b3f066327bbc4d48a71aa0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log

Security for secret-broker 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for secret_broker-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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