Why Per-Process?
Most Kubernetes identity systems assign one identity per pod (or at best, per container). Hexr goes further: every agent process gets its own SPIFFE ID. This matters because:- Multi-agent frameworks (CrewAI, LangChain) run multiple agents in one process tree
- Sub-agents (researcher, writer, editor) need distinct identities for access control
- Audit trails need to know which specific agent made which API call
- Cost attribution needs per-agent LLM token tracking
Standard K8s Identity
One identity per pod/container.No visibility into which sub-agent made which call. Cost attribution impossible.
Hexr Identity (Per-Process)
One identity per agent process.Per-role access control, cost tracking, and audit logs.
SPIFFE ID Format
Every agent process receives a SPIFFE ID following this pattern:
Examples:
How It Works
The identity lifecycle has four stages:Stage 1: Build-Time Discovery
hexr build performs AST analysis on your Python source code to discover all agents:
Stage 2: Pod Startup & Registration
When the pod starts, the Auto-Registrar creates SPIRE entries:Kubernetes fires pod event
Kubernetes API notifies the Auto-Registrar that a pod with
hexr.io/managed=true was created.Auto-Registrar reads contexts
Reads process context ConfigMaps mounted in the pod. Each file describes one agent role
(researcher, writer, editor, etc.).
SPIRE entries created
For each process role, the Auto-Registrar calls
SPIRE.CreateEntry:Stage 3: Runtime Marker Files
When the agent process starts, the SDK writes a marker file:/proc, and writes the enriched context:
Stage 4: SVID Issuance
The agent process fetches its SVID from the SPIRE Workload API:- mTLS — Envoy loads it via SDS for encrypted communication
- JWT exchange — Credential Injector verifies it for cloud credential access
- Audit — Every action is attributed to this specific process identity
Identity in Practice
Cloud Credential Scoping
Each process identity can be scoped to specific cloud resources:Multi-Agent Cost Attribution
Withhexr_llm(), every LLM call is tagged with the calling process’s SPIFFE ID: