What It Does
The PID Mapper is the core innovation that enables per-process identity. It runs as a sidecar container withshareProcessNamespace: true, giving it visibility into all processes in the pod.
When a new process starts in the agent container (e.g., a CrewAI spawns a researcher subprocess), the PID Mapper:
- Detects the new process via
/procfilesystem monitoring - Matches the process to a role from the process context ConfigMap
- Requests a unique SPIFFE SVID for that specific process
- Delivers the SVID so the process gets its own cryptographic identity
How It Works
1
Agent forks subprocess
The agent container spawns a new subprocess (e.g.,
researcher at PID 42).2
PID Mapper detects new process
The PID Mapper watches
/proc and detects the new PID 42. It reads /proc/42/cmdline to identify the process.3
Match to process context
The PID is matched against the
process-context/researcher.json file to determine the SPIFFE role.4
Fetch SVID from SPIRE
PID Mapper calls
FetchX509SVID with selectors hexr:role:researcher + k8s:pod-uid:.... SPIRE returns an X.509 SVID for spiffe://.../researcher.5
Register SVID for PID
The SVID is registered for PID 42. When the researcher process calls
hexr_tool(), Envoy automatically uses this specific SVID for mTLS.Process Context
The PID Mapper reads from a ConfigMap mounted at/hexr/process-contexts/: