Broker Quickstart
Beta — 0.1.0b5The Zabta Broker is a local daemon that keeps API keys out of your AI agents' hands. Instead of an environment variable your agent can read at will, secrets live in an encrypted local vault; your agent requests a credential at the moment of use, and the Broker evaluates policy before handing over a short-lived lease.
Install
pip install zabta-broker==0.1.0b5Install by exact version, never --pre. While the Broker is in beta, pip only resolves pre-releases when named exactly — and --pre would opt your entire dependency tree into pre-release versions, not just this package. Requires Python 3.10+ on macOS or Linux.
Set up the daemon
1. Store a secret in the encrypted vault
zabta-broker vault add --provider stripe --scopes charges:create2. Start the daemon
zabta-broker start
# Binds to 127.0.0.1:9477 — loopback only, never a network service3. Register with the Zabta cloud control plane
zabta-broker register --api-key <your-zabta-api-key>
# Connects to the Zabta cloud control plane for policies, approvals,
# and agent-identity syncThis is what lets the Broker pull your policies and learn your registered agents — see Agent identity below.
Optional: run as a background service
Instead of running zabta-broker start in a foreground terminal, install it as a launchd (macOS) or systemd (Linux) service:
zabta-broker install-daemon
# launchd on macOS, systemd on Linux — starts the Broker at login/bootAgent identity
The Broker identifies agents by DID (did:zabta:<agent id>), derived directly from the cloud agent id you already have — there is no separate identity to create or manage. Set one environment variable:
export ZABTA_AGENT_ID=<your agent id>
# The id shown in the Zabta dashboard for this agent. Nothing else
# needs configuring — see "Agent identity" below.The cloud is the source of truth: when the Broker registers and syncs, it pulls your tenant's active agents and populates its local identity registry with their derived DIDs. Unregistered DIDs are hard-denied — identity is checked before policy runs.
Requesting a credential
On the agent side, use the zabta SDK:
import zabta
with zabta.credential("stripe", ["charges:create"]) as key:
... # `key` is a fresh checkout; use it now, don't store itAn async equivalent, acredential(), ships from day one for async agent code:
import zabta
async with zabta.acredential("stripe", ["charges:create"]) as key:
...The full context-manager contract — the yields-or-raises invariant, the exception taxonomy, and safe adoption patterns — is in the Credential Leasing Guide.
Related