Skip to main content

A typed-return secret broker: clients USE secrets over a unix socket, they never SEE the plaintext.

Project description

sandbroker

OpenSSF Best Practices PyPI CI License: MIT

A typed-return secret executor. Claude Code causes secrets to be used without ever learning what they are.

Full design, threat model, and hardening guide live in docs/: start with docs/SECURITY.md, docs/THREAT-MODEL.md, and DEPLOY.md. This README is the short version.

The claim

No plaintext secret resolved by sandbroker appears in Claude's context, in the Anthropic API request body, in the local session transcript, or in any prompt cache, because no channel exists through which it could travel.

It does not claim anything about secrets arriving through doors sandbroker doesn't mediate. "100% secure" is not on offer; see the known limits in docs/SECURITY.md.

Why not a redaction hook

A PostToolUse redaction hook is a filter, and filters fail open: unmatched pattern, unexpected encoding, or an unanticipated error string, and the raw value proceeds to the wire. sandbroker is not a filter. The response schema has no field a secret can occupy.

How it holds

Four structural properties, all asserted in tests/test_guarantee.py (30 tests):

  1. The child cannot talk to us. Targets spawn with stdout/stderr bound to /dev/null at the fd level, so no output on any path reaches the caller.
  2. Secrets never enter argv. Rejected at registry load, because /proc/PID/cmdline exposes argv to the same uid.
  3. There is no shell. Argv vectors only, so arguments can never become code.
  4. Egress is allowlisted. Response keys outside {ok, error, verb} are dropped and unknown error tokens collapsed.

Install

Two commands on Linux/WSL2 or macOS:

pipx install sandbroker        # puts sandbroker, sandbrokerd, and the bin/ helpers on PATH
sandbroker setup               # guided wizard: base + daemon, secret store, approver, Claude Code

sandbroker setup runs unprivileged (user mode) by default; add --hardened for the dedicated-uid /opt/sandbroker system install. See docs/integration-notes/setup-wizard.md.

Quick start from a checkout (Linux/WSL, systemd)

python3 tests/test_guarantee.py                 # expect OK
sudo ./install.sh                               # creates sandbroker uid + claude-broker
install -m 0755 bin/sandbroker ~/.local/bin/sandbroker
install -m 0755 hooks/deny_secret_reads.py ~/.claude/hooks/

# new login session for group membership, then:
sudo ./canary/canary_provision.sh
sandbroker canary.probe --ref file://canary      # expect {"ok": true}
sudo ./canary/canary_sweep.sh                   # expect clean

Then register the PreToolUse hook in your Claude Code settings.json (see docs/ for the snippet).

Ref schemes

Scheme Backend
file://canary local 0400 file, verification only
akv://<vault>/<name> Azure Key Vault via az
op://<vault>/<item>/<field> 1Password via the op CLI

Layout

sandbroker/sandbrokerd.py   the daemon: exec core, registry validator, egress filter
sandbroker/verbs.json    capability grants; installed root:root 0444
bin/sandbroker          the only interface Claude uses
hooks/                 PreToolUse deny for doors sandbroker doesn't mediate
canary/                provision + sweep: the leak test that must keep passing
tests/                 the guarantee, as executable assertions
install.sh             every sudo step (Linux/systemd)

Verification note

A sweep only means something when Claude runs the probe. Running it yourself proves nothing, because the canary was never near the model's context. Have Claude exercise the verbs and attempt extraction, then sweep.

Project details


Download files

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

Source Distribution

sandbroker-0.1.1.tar.gz (100.3 kB view details)

Uploaded Source

Built Distribution

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

sandbroker-0.1.1-py3-none-any.whl (97.6 kB view details)

Uploaded Python 3

File details

Details for the file sandbroker-0.1.1.tar.gz.

File metadata

  • Download URL: sandbroker-0.1.1.tar.gz
  • Upload date:
  • Size: 100.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sandbroker-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a098217b402c4b7d3f2292f1042a8430a6d2f4dcdef229a54dec165f0219843b
MD5 8cf5063b4a95e2fd4e3b7f3468c49620
BLAKE2b-256 fed9c1f083c65d0c561ad883420c6d02e9444130a277657e8506f8d903d61171

See more details on using hashes here.

Provenance

The following attestation bundles were made for sandbroker-0.1.1.tar.gz:

Publisher: release.yml on 312-dev/sandbroker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sandbroker-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sandbroker-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 97.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sandbroker-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 63895d8558e46f50409c083c9add62fbf2c29969af31f39ef60a293858afe3d4
MD5 d0d6b65792eaaf0244243c8798726624
BLAKE2b-256 dbbf93403d51c9c09d1c79571c0c3817517a6ef27e2b60d5ce0aa9b1e599b18c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sandbroker-0.1.1-py3-none-any.whl:

Publisher: release.yml on 312-dev/sandbroker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page