Local credential broker for AI agents with per-agent secret scoping.
Project description
brokr
Local credential broker for AI agents — scoped secret access per agent, no cloud required.
Your deploy bot shouldn't have access to your database password. brokr lets you control which agent can use which credential, locally, with zero cloud dependency.
pip install brokr
brokr init
brokr set OPENAI_API_KEY
brokr set GITHUB_TOKEN
brokr project init my-app
brokr project add OPENAI_API_KEY
brokr agent add deploy-bot
brokr grant deploy-bot OPENAI_API_KEY
brokr run --as deploy-bot -- python deploy.py
# ^ only OPENAI_API_KEY is injected. Nothing else.
Why brokr?
.env files |
brokr | |
|---|---|---|
| Encrypted at rest | No | Yes (AES-256-GCM) |
| Per-agent scoping | No — everything sees everything | Yes — grant specific secrets per agent |
| Git-safe | Gets committed constantly | Nothing to commit |
| Per-project association | .env, .env.local, .env.prod... |
One store, project-scoped injection |
| Works with any language | Needs dotenv library |
Injects env vars natively |
Install
pip install brokr
Requires Python 3.10+.
Quickstart
# 1. Create your encrypted store
brokr init
# 2. Store secrets
brokr set OPENAI_API_KEY
brokr set GITHUB_TOKEN
brokr set DB_URL --value "postgres://localhost/mydb"
# 3. Run with all secrets injected
brokr run -- python app.py
Inside app.py, read env vars as usual:
import os
key = os.environ["OPENAI_API_KEY"]
Project Scoping
Associate secrets with specific projects. brokr run in a project directory injects only that project's secrets.
cd ~/my-app
brokr project init my-app # creates .brokr file (add to .gitignore)
brokr project add OPENAI_API_KEY
brokr project add DB_URL
brokr run -- python app.py # only OPENAI_API_KEY and DB_URL injected
Agent Scoping
Control which agent gets which secrets. The LLM orchestrating the agent never sees raw values — brokr is an opaque broker.
brokr agent add deploy-bot
brokr agent add research-agent
brokr grant deploy-bot GITHUB_TOKEN
brokr grant research-agent OPENAI_API_KEY
brokr run --as deploy-bot -- python deploy.py
# ^ only GITHUB_TOKEN injected
brokr run --as research-agent -- python research.py
# ^ only OPENAI_API_KEY injected
CLI Reference
# Store management
brokr init # Create encrypted store (~/.brokr)
brokr set KEY_NAME # Store a secret (prompts for value)
brokr set KEY_NAME --value "sk-..." # Store inline
brokr get KEY_NAME # Print to stdout
brokr list # List keys (masked)
brokr list --show # List keys (revealed)
brokr rm KEY_NAME # Remove (cascades to projects/agents)
# Project management
brokr project init <name> # Register project, create .brokr file
brokr project add <SECRET> # Link secret to current project
brokr project rm <SECRET> # Unlink (cascades to agent grants)
brokr project list # List all projects (or current project's secrets)
brokr project show # Show current project details
# Agent management
brokr agent add <name> # Create agent in current project
brokr agent rm <name> # Remove agent and its grants
brokr agent list # List agents in current project
brokr grant <agent> <secret> # Grant secret to agent
brokr revoke <agent> <secret> # Revoke grant
# Run with injection
brokr run -- <command> # Inject secrets as env vars
brokr run --as <agent> -- <command> # Inject only agent's granted secrets
brokr run --only KEY1,KEY2 -- <cmd> # Inject only specific keys
# Maintenance
brokr doctor # Health check (permissions, refs, projects)
brokr passwd # Change passphrase
brokr export # Export as KEY="value" to stdout
brokr export --format json # Export as JSON to stdout
brokr --version # Show version
SDK
from brokr import get
# Basic (returns any secret)
api_key = get("OPENAI_API_KEY")
# Project-scoped (must be linked to project)
api_key = get("OPENAI_API_KEY", project="my-app")
# Agent-scoped (must be granted to agent)
token = get("GITHUB_TOKEN", agent="deploy-bot", project="my-app")
# Raises PermissionError if not granted
How it works
brokr derives an encryption key from your passphrase using scrypt, then encrypts all secrets with AES-256-GCM. Everything lives in a single file at ~/.brokr/store.enc with 0600 permissions. Projects and agent grants are stored in the same encrypted blob. The passphrase never touches disk.
License
MIT — see 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 brokr-1.5.0.tar.gz.
File metadata
- Download URL: brokr-1.5.0.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7914a366bcbdd5baaea5581e2bbe254d821e0f23dfad5022ad626d5cadef7e45
|
|
| MD5 |
75f18ac8ba04c5121373e3b1dcbca25e
|
|
| BLAKE2b-256 |
481c98d95a65e6858eed93af52d19e18d244a8f7cd91c35a54c3e57b6c31b444
|
Provenance
The following attestation bundles were made for brokr-1.5.0.tar.gz:
Publisher:
publish.yml on Virtuous6/brokr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brokr-1.5.0.tar.gz -
Subject digest:
7914a366bcbdd5baaea5581e2bbe254d821e0f23dfad5022ad626d5cadef7e45 - Sigstore transparency entry: 1078816319
- Sigstore integration time:
-
Permalink:
Virtuous6/brokr@35eab6f085b0e6edec645b91b90df43498c36b53 -
Branch / Tag:
refs/tags/v1.5.0 - Owner: https://github.com/Virtuous6
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@35eab6f085b0e6edec645b91b90df43498c36b53 -
Trigger Event:
push
-
Statement type:
File details
Details for the file brokr-1.5.0-py3-none-any.whl.
File metadata
- Download URL: brokr-1.5.0-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca144ecad623cfebb7a5b09d9e53c39e8394c2d089ddf23464b872ee18c75b7d
|
|
| MD5 |
053538f63efa1fea627a0925f1e92905
|
|
| BLAKE2b-256 |
23de7e94f4754bcfada5a2e69f9217425ec74483f7836902e4c2b3261117782c
|
Provenance
The following attestation bundles were made for brokr-1.5.0-py3-none-any.whl:
Publisher:
publish.yml on Virtuous6/brokr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brokr-1.5.0-py3-none-any.whl -
Subject digest:
ca144ecad623cfebb7a5b09d9e53c39e8394c2d089ddf23464b872ee18c75b7d - Sigstore transparency entry: 1078816367
- Sigstore integration time:
-
Permalink:
Virtuous6/brokr@35eab6f085b0e6edec645b91b90df43498c36b53 -
Branch / Tag:
refs/tags/v1.5.0 - Owner: https://github.com/Virtuous6
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@35eab6f085b0e6edec645b91b90df43498c36b53 -
Trigger Event:
push
-
Statement type: