agentkeys
Revoke the agent, not the quarter. The never-in-context credential broker for AI agents: agents hold only references, real secrets stay in your keychain / credential files / vault, short-lived audience-bound tokens are injected at egress — and one command kills all of an agent's access in ≤1 second, replay-verified in CI.
Part of the agentic-suite — open-source, harness-agnostic security for AI agents. Apache-2.0.
Status
v0.1.0 release candidate — the broker is built and field-tested; the tag is pending the release gates. The full requirement set (PRD 00–23 + Appendix A) and the build plan (v0.1.0 WBS — 16 milestones, M0–M15) are public on purpose, so we can be held to them.
The M14 field test is complete and hand-verdict: 71 PASS · 0 FAIL · 3 WARN · 0 NOT RUN across 74 cases, with all five blocking scenarios green (kill-time, context dump, tamper, evidence, scan/migrate) — see the hand-maintained field report. Three WARNs remain, each with a named limitation, and one earlier WARN was upgraded only after a real enforcer was composed.
Release readiness is in progress: the security audit found 0 verified secrets in the tree and the full history, the claims ledger resolves every public claim to a committed case, and the compatibility matrix labels each harness honestly. Nothing is verified — that word means an independent third party reproduced the claim, and the published benchmark is how someone can.
Still honest stubs in the frozen command surface: init, context-dump, scan-usable — each exits
non-zero and names its milestone rather than pretending. See honest gaps
and the release notes. Claims stay at their evidence label
(evidence labels).
Install & run (v0.1.0 foundation)
pip install agentsec-agentkeys # stdlib-only, no runtime dependencies
agentkeys --version # agentkeys 0.1.0
agentkeys --help # the frozen v0.1.0 command surface
agentkeys doctor # read-only health check: 0 healthy · 2 denied · 3 tamper
Configuration lives under AGENTKEYS_HOME (default ~/.agentkeys) in config.toml. It carries
references only — a literal secret in config is an error, never stored and never printed. See the
foundation design and the CLI reference.
Reserved exit codes (stable within v0.x)
| Code | Meaning |
|---|---|
0 |
success (and for scan-usable: 0 usable credentials — the invariant holds) |
1 |
usage or internal error |
2 |
denied — fail-closed denial with a reason |
3 |
tamper detected — integrity check failed |
4 |
revoke verified — the replay was refused |
scan, migrate, ref, run, revoke, replay, export, verify-log, conformance, serve,
backup, and restore are implemented; init, context-dump, and scan-usable remain honest stubs that
exit non-zero and name the milestone. The quickstart is replayed by a step
test (tests/docs/test_quickstart.py).
Platforms: macOS and Linux. Windows is not supported — the CLI says so rather than failing cryptically.
The problem
The most dangerous string in your agent's context isn't the prompt — it's the API key in its environment: static, long-lived, over-scoped, no audience binding, no kill switch. Prompt injection exfiltrating production keys is documented in the wild, and when it happens, "revoke" means rotating the credential across every system it touches. A quarter of work for what should be one command.
What agentkeys does
| Never-in-context | Agents hold opaque akref: references — safe to log, print, and leak. A full context-dump attack pack must find zero usable credentials; it runs in CI as a permanent invariant. |
| Egress-only injection | Real credentials resolve at the moment of use and inject at egress — child-process env (stdio MCP), HTTP header, or RFC 8693 token exchange. The agent's transcript never contains the secret. |
| Bound tokens | Every token is short-lived, audience-bound (RFC 8707), tool-scoped, and session-bound. Replay it anywhere else — it fails, and the attempt is logged. |
| Revoke ≤1s | agentkeys revoke <agent|session|all> — the next exchange refuses, issued tokens stop authenticating. Measured end-to-end (issue → revoke → replay fails), continuously in CI. |
| stdio MCP virtualization | The flagship nobody covers: local stdio MCP servers launched under the broker, credentials supplied at call time — no secret in mcp.json, env, or transcript. |
| scan / migrate | agentkeys scan finds the secrets your agents can read (.env, mcp.json, scripts); agentkeys migrate moves one into the keychain and rewrites every use site to a reference. |
| Step-up approvals | Prod-class scope is impossible to mint without an approving human decision (via agentpolicy); timeout = deny. |
| Evidence-grade audit | Every issuance/use/upgrade/revocation lands in a hash-chained local ledger + agentwatch events — a credential lifecycle an auditor reconstructs per session. |
| Fail closed, everywhere | Locked keychain, corrupt store, offline sink — every failure is a denial, never a fallback to a static secret. |
The 60-second demo (the designed v0.1.0 experience)
$ agentkeys scan
Found 3 candidate secrets (masked previews only):
.env AWS_SECRET_ACCESS_KEY ***…7f2a broad-reuse: 2 sites
.mcp.json GITHUB_TOKEN ***…9c11 static, in agent-readable config
scripts/deploy.sh NPM_TOKEN ***…4b0d
$ agentkeys migrate .mcp.json GITHUB_TOKEN --backend keychain
✔ moved to keychain item "agentkeys/dev/github-pat"
✔ rewrote .mcp.json → "GITHUB_TOKEN": "akref:keychain/agentkeys/dev/github-pat"
✘ original value deleted from config; present nowhere except the backend
$ claude # the agent runs; the MCP server authenticates via the broker
…tool call succeeds — transcript contains only the reference…
$ agentkeys context-dump --session latest | agentkeys scan-usable
0 usable credentials found in transcript/env/args/config/logs ✔
$ agentkeys revoke --agent claude-code && agentkeys replay --last
revoked in 0.19s · replay of pre-revoke token: REFUSED (exchange-rejected)
(Commands are the designed CLI — the plan of record. Every line above maps to a gated scenario: SC-51, SC-12, SC-40, SC-24.)
Why not X?
- Why not just 1Password / Doppler / Infisical? Use them — as backends. They store secrets well; they don't virtualize stdio MCP, unify per-tool/session token models across your whole agent surface, or publish a ≤1s kill. agentkeys makes your vault never-in-context. (FAQ)
- Why not Aembit / Entra Agent ID? Excellent — and enterprise control planes. agentkeys is the OSS, local-first, stdio-inclusive end; later, a standards-native client of the same control planes.
- Another injection detector? No. We don't classify prompts; we make injection not worth it — there is nothing usable in the context to steal. (Why brokers, not detectors)
Compatibility (below the harness, by construction)
| Harness | v0.1.0 | v0.3.0 |
|---|---|---|
| Claude Code | ✅ recipe #1 (first) | ✅ |
| Cursor | ✅ recipe #2 | ✅ |
| GitHub Copilot (agent mode) | documented lower-layer coverage | ✅ |
| OpenAI Codex CLI | not yet | ✅ |
| Gemini CLI | not yet | ✅ |
| Generic MCP clients / SDKs | ✅ by construction | ✅ |
Verified, not asserted: a harness is "compatible" when its attack pack passes in CI (PRD 19, PRD 16).
Documentation
PRD — the plan of record (00–23 + Appendix A)
- PRD index — the full set, with the reading order per audience
- Pitch: Press release / FAQ · Why · Landscape
- Build: Architecture · Features R1–R19 + E1–E15 · Data model · Adapters & integration
- Trust: Security baseline · Issuance integrity · Standards & claims · Evidence & method
- Deliver: Roadmap · Operations & governance · Enterprise adoption · Traceability
- Appendix A — consolidated source PRD (the vault PRD verbatim, every line traced)
- Guides: Quickstart (designed) · Adoption paths · Demo scripts · Why brokers, not detectors · CLI · Glossary · Control-coverage matrix
WBS — the build plan for v0.1.0 (16 milestones, M0–M15, across 8 parts)
- WBS index — milestones, the standard gates, and the requirement → CUJ → scenario → milestone trace
- Part 1 — Foundation & BrokerStore (M0–M1)
- Part 2 — Contracts & Backends (M2–M3)
- Part 3 — Egress & the stdio Flagship (M4–M5)
- Part 4 — Revocation & Evidence (M6–M7)
- Part 5 — Hygiene & Hardening (M8–M9)
- Part 6 — Approvals & Assurance (M10–M11)
- Part 7 — Operations & Docs (M12–M13)
- Part 8 — Field Test & Release (M14–M15) — the final two milestones (field tests + release readiness, incl. the
trufflehog+ git-history security audit that gates the tag) - Code review log
Roadmap (one headline per release, gate or no release)
| Release | Headline | Gate |
|---|---|---|
| v0.1.0 | The complete never-in-context lifecycle + stdio flagship + scan/migrate | kill-time ≤1s in CI; 0 usable secrets; fail-closed matrix; ≥2 Tier-1 recipes |
| v0.1.x | Enterprise/cloud backends + posture report | conformance-gated backends; posture on real machines |
| v0.2.0 | Server/HA fleet broker + SPIFFE/WIMSE identity | monotonic delegation; cluster-safe store |
| v0.3.0 | Product depth: budgets, DPoP, attestation, taint, canaries; all 5 harnesses; MCP ext-auth landed | full v0.3.0 gate (PRD 09) |
The ecosystem
agentkeys is the hands on the keys in agentic-suite: agentwatch owns the event schema · agentpolicy decides approvals · agenthalt triggers revocations · agentdrill measures kill times · agentcomply turns the ledger into evidence.
Contributing & security
CONTRIBUTING.md (test-first, one ticket at a time, DCO signed) · vulnerabilities go to SECURITY.md, never a public issue.
License
Apache License 2.0 — see LICENSE.
Metadata
Release files for agentsec-agentkeys 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentsec_agentkeys-0.1.0.tar.gz | 218.6 kB | Without provenance | Details for agentsec_agentkeys-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentsec_agentkeys-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for agentsec_agentkeys-0.1.0-py3-none-any.whl |
Total release size: 395.3 kB
Release files / agentsec_agentkeys-0.1.0.tar.gz
| Download URL | agentsec_agentkeys-0.1.0.tar.gz |
|---|---|
| Size | 218.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f05739786f264b1f87da700111acb9acf1e6801c48db6a7e5726390979e2e328
|
|
BLAKE2b-256 checksum How to use checksums |
7e3c18bf2d4dc56d65ab7ba699887a2186b4748ae2cde69e5b217af59a9644e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Release files / agentsec_agentkeys-0.1.0-py3-none-any.whl
| Download URL | agentsec_agentkeys-0.1.0-py3-none-any.whl |
|---|---|
| Size | 176.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5276735432ea99fb2f840fab15b6e5b46abeaa50e1abd5b261844000256e6b90
|
|
BLAKE2b-256 checksum How to use checksums |
c4570f004e9711f497c4a9703bf8394aa034b0c00e95956150e078d37df633cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Security for agentsec-agentkeys 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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.