Zero-trust JIT authorization for AI agents.
I built this because it is an important aspect of AI, in which models need access to sensitive data, but giving them persistent credentials can turn to be a real issue. This project aims to fix that by issuing short-lived tokens that are bound to a specific agent, file, and action.
You have an AI agent that needs to read financial_report.csv. Traditional approach: give it an API key with read access. But now that key can read anything, and if it is compromised has severe consequences.
The warden issues JIT (Just-In-Time) tokens that:
- Expire in 2 minutes
- Are locked to a specific file
- Only work for the agent they were issued to
Even if a token leaks, it's probably already expired.
Officer → Warden → Agent → Vault
↓ ↓
DENIED result → Officer
- Officer submits a work order with their identity token
- Warden checks policy and denied requests are rejected before any token is minted
- Warden mints a short-lived JIT token and dispatches to the Agent
- Agent uses the token to fetch data from the Vault
- The vault checks the token to verify warden signature on workorder
- Agent uses the data returns the result to the Officer depending on nature of request
The officer never sees the JIT token as it stays within the backend
Warden is the only service exposed to the host. Agents and Vault exist exclusively on an internal Docker network with no port mappings so there is no route to them from outside Docker. This means an officer cannot reach an agent or the vault directly.
[Officer]
|
:8000 (only exposed port)
|
[Warden] ── internal network ──▶ [Agent] ──▶ [Vault]
Before any token gets issued, the Warden checks the request against YAML-defined policies:
policies:
officer_jane:
permissions:
- resource: "financial_report.csv"
intents: ["summarize", "read"]
- resource: "system_config.yaml"
intents: ["read"]
agent_assignments:
summarize: "light-llm-01"
risk_audit: "heavy-analyzer-02"Each officer has explicit permissions for specific files and actions. The policy also determines which agent handles which type of task. If the request doesn't match the policy it will be rejected before any token is minted.
JIT tokens are single-use so the vault burns the token after the first successful request. Even if a token is intercepted, it can't be reused. Each token is also cryptographically bound to a specific agent, file, and intent, so a token for summarize on financial_report.csv cannot be used to read anything else. The vault also keeps track of used tokens for replay prevention.
The Agent and Vault both boot with the Warden's public key and will refuse to start without it. Every request is verified against that key before any work is done. Which means that neither service will act on a request that wasn't signed by the Warden.
Prerequisites: Docker, Python 3.10+
# the officer runs on the host, so install dependencies locally
cd warden
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# generate keys
cd keys
openssl genrsa -out auth_private.pem 2048
openssl rsa -in auth_private.pem -pubout -out auth_public.pem
openssl genrsa -out warden_private.pem 2048
openssl rsa -in warden_private.pem -pubout -out warden_public.pem
# run it (.env should be in the root directory)
cd ..
cp .env.example .env
docker-compose up --build
# demo — runs 4 legitimate requests and 4 blocked attacks
python3 -m officer.officerwarden/ - policy engine, verifies officer identity, mints JIT tokens, dispatches to agents
vault/ - hardened storage, verifies JIT tokens, single-use enforcement
agent/ - verifies JIT tokens, fetches data from vault, processes and returns result
officer/ - human client, submits work orders, receives results
keys/ - RSA key pairs for officer identity and JIT token signing