Skip to content

About

Never-in-context credential broker with one-action revocation

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

agentkeys

CI License: Apache-2.0 Python 3.11+ Status: release candidate Field-tested: 71 PASS · 0 FAIL · 3 WARN Release: unsigned Ruff Type checked OpenSSF Scorecard

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

pip install agentsec-agentkeys   # published: v0.1.0 (unsigned release)
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

From source, if you prefer a checkout:

git clone https://github.com/agentic-suite/agentsec-agentkeys
cd agentsec-agentkeys && python -m venv .venv && . .venv/bin/activate && pip install .

agentkeys init is still an honest stub (it exits non-zero and names its milestone), so the quickest first run writes the config directly — the quickstart does exactly that and is replayed by a test on every commit.

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)

WBS — the build plan for v0.1.0 (16 milestones, M0–M15, across 8 parts)

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.

About

Never-in-context credential broker with one-action revocation

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

Generated from agentic-suite/template