Split-key reverse proxy that makes leaked API keys worthless
Project description
Worthless
Make leaked API keys worthless.
Your API key is split into two pieces. Neither piece is useful on its own. Every request goes through a proxy that enforces a hard spend cap before the key ever reconstructs. Budget blown = key never forms = request never reaches the provider.
Every secrets tool protects the key until your app uses it. Worthless protects you after it leaks.
Quickstart
pipx install worthless
cd your-project
worthless
That's it. Worthless detects API keys in your .env, splits them, starts a local proxy, and you're protected.
$ worthless
Found 2 API keys:
OPENAI_API_KEY openai
ANTHROPIC_API_KEY anthropic
Lock these keys? [y/N] y
Protecting OPENAI_API_KEY... done
Protecting ANTHROPIC_API_KEY... done
Starting proxy on 127.0.0.1:8787... healthy
Proxy healthy on 127.0.0.1:8787
Your code doesn't change. The proxy handles everything.
Alternative install
pip install worthless # in a virtualenv
How it works
worthless locksplits each API key into two shards using XOR- Shard A stays on your machine (encrypted). Shard B goes to the proxy database.
- Your
.envis rewritten with shard-A (format-preserving — looks like a real key but is cryptographically useless alone) - The proxy reconstructs the key only when the rules engine approves the request
- Spend cap blown? The key never forms. The request never reaches the provider.
Commands
worthless # Auto-detect, lock, start proxy (the magic)
worthless lock # Lock keys in .env
worthless unlock # Restore original keys
worthless scan # Detect exposed keys without locking
worthless status # Show proxy and key status
worthless up # Start proxy (foreground)
worthless up -d # Start proxy (background daemon)
worthless down # Stop the proxy
worthless wrap <cmd> # Run a command through the proxy
worthless revoke # Revoke enrolled keys
Undo everything
$ worthless unlock
1 key(s) restored.
Original key is back. No trace.
Pre-commit hook
repos:
- repo: https://github.com/shacharm2/worthless
rev: main
hooks:
- id: worthless-scan
For AI coding agents
Worthless ships a SKILL.md that tells Claude Code, Cursor, and Windsurf what commands are available. Agents use --json for structured output:
worthless status --json
Development
git clone https://github.com/shacharm2/worthless && cd worthless
uv sync --extra dev --extra test
uv run pytest
Learn more
- Security model -- how the split-key proxy works
- Security rules -- invariants all contributions must preserve
- SKILL.md -- agent discovery file
Contributing
PRs welcome. Read SECURITY_RULES.md first.
License
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 worthless-0.3.0.tar.gz.
File metadata
- Download URL: worthless-0.3.0.tar.gz
- Upload date:
- Size: 254.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9999f341f52fb57646cc3546ddfb3f81c4663efb4493e8a5788112ff8d63cb1
|
|
| MD5 |
535beb32b2e243ad8f2a42178f4c3c1f
|
|
| BLAKE2b-256 |
27860497d2a6f284368aa06a789de397bea661d8deea6bbfe1f7f27ddf589b62
|
Provenance
The following attestation bundles were made for worthless-0.3.0.tar.gz:
Publisher:
publish.yml on shacharm2/worthless
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
worthless-0.3.0.tar.gz -
Subject digest:
e9999f341f52fb57646cc3546ddfb3f81c4663efb4493e8a5788112ff8d63cb1 - Sigstore transparency entry: 1340230816
- Sigstore integration time:
-
Permalink:
shacharm2/worthless@abb5bf1cbb64e38629f43067ad19a74823051f3c -
Branch / Tag:
refs/tags/v0.3.0rc2 - Owner: https://github.com/shacharm2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@abb5bf1cbb64e38629f43067ad19a74823051f3c -
Trigger Event:
push
-
Statement type:
File details
Details for the file worthless-0.3.0-py3-none-any.whl.
File metadata
- Download URL: worthless-0.3.0-py3-none-any.whl
- Upload date:
- Size: 93.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
394dbf797fa11b0e9bb2f9bf58ac03dcf021ede5cfc121ad99f43f2831826c52
|
|
| MD5 |
4c251469a77941ef8a3b61b3ad9362c8
|
|
| BLAKE2b-256 |
9268c0f8cfee33fc4da4ef4ce34e031d51e3c035a75e8357ccc50c0d4225b563
|
Provenance
The following attestation bundles were made for worthless-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on shacharm2/worthless
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
worthless-0.3.0-py3-none-any.whl -
Subject digest:
394dbf797fa11b0e9bb2f9bf58ac03dcf021ede5cfc121ad99f43f2831826c52 - Sigstore transparency entry: 1340230820
- Sigstore integration time:
-
Permalink:
shacharm2/worthless@abb5bf1cbb64e38629f43067ad19a74823051f3c -
Branch / Tag:
refs/tags/v0.3.0rc2 - Owner: https://github.com/shacharm2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@abb5bf1cbb64e38629f43067ad19a74823051f3c -
Trigger Event:
push
-
Statement type: