Agent Vault (Infisical) — Analysis for Hermes Agent Integration
Codex 核验(2026-10-09):Checked the official README: unmatched requests are forwarded by default; strict rejection requires
unmatched_host_policy=deny. Proxy use and CA trust do not themselves enforce host network isolation. The agent token still authorizes service use, so hiding upstream keys does not eliminate token theft or API abuse. The SDK creates sessions and proxy configuration; it does not hand upstream keys to the agent. The README recommends the separate Infisical product for enterprise production; this report did not validate production readiness, latency, secure memory erasure, or Hermes integration end to end. Historical stars and machine state remain snapshots.
Researched: 2026-06-06 Repository: github.com/Infisical/agent-vault (1,610 ★, Go) Docs: https://docs.agent-vault.dev License: MIT
1. Architecture Overview
Agent Vault is an HTTP credential proxy and vault written in Go. It sits as a MITM forward proxy between AI agents (Claude Code, Hermes, OpenClaw, custom agents) and the outbound APIs they call. It ships as a single binary that runs both a control-plane HTTP API (port 14321) and a transparent forward proxy (port 14322).
┌─────────────────────────────────────────────────────────────┐
│ Public internet │
│ api.anthropic.com api.github.com api.stripe.com │
│ ▲ ▲ ▲ │
└──────────┼───────────────────┼──────────────────┼────────────┘
│ │ │
└───────────────────┼──────────────────┘
│ outbound HTTPS (Agent Vault injects
│ real credentials on the way out)
┌──────────────────────────────┼──────────────────────────────┐
│ Private network │ │
│ ┌───────────────────────────┴────┐ ┌──────────────────┐ │
│ │ Agent Vault │ │ AI Agent │ │
│ │ :14321 management UI / API │◀───│ HTTPS_PROXY= │ │
│ │ :14322 MITM proxy │ │ agent-vault:14322 │ │
│ │ (real credentials encrypted) │ │ (placeholders) │ │
│ └────────────────────────────────┘ └──────────────────┘ │
└──────────────────────────────────────────────────────────────┘
Core Components
| Component | Purpose |
|---|---|
| Control plane (port 14321) | REST API + web UI for managing vaults, credentials, services, agents, proposals |
| MITM proxy (port 14322) | HTTP forward proxy + CONNECT handler. Intercepts agent outbound traffic, resolves credentials, injects them, forwards upstream |
| Vault | Logical container for credentials + service rules. Has members with roles (admin/member/proxy) |
| Service | Per-vault rule: host pattern + auth config (bearer/basic/api-key/custom/passthrough) + optional substitutions |
| Credential | API key / secret stored encrypted at rest (AES-256-GCM) behind KEK/DEK key wrapping |
| Proposal | Agent-initiated request for new credentials + services. Human must approve via browser link |
| Agent | Identity (token) that can be scoped to vaults with proxy role |
| Session | Vault-scoped short-lived token from vault run (5 min–7 days) |
Data Flow
- Agent sets
HTTPS_PROXY=http://agent-vault:14322,HTTP_PROXY=http://agent-vault:14322 - Agent uses a dummy placeholder value for API keys (e.g.,
ANTHROPIC_API_KEY=__anthropic_api_key__) - Agent makes an API call → traffic hits Agent Vault proxy
- Agent Vault authenticates the agent via
Proxy-Authorizationheader (agent token, never forwarded to upstream) - Matches the target host against vault’s services
- Looks up real credential from encrypted store
- Injects real credential into the outbound request header (or substitutes placeholders in path/body/query)
- Forwards the request to the real upstream API over HTTPS
- Upstream response flows back through the same connection
2. How Credential Brokering Works
The Core Principle: “Agents Should Not Possess Credentials”
Agent Vault’s key innovation: the AI agent never holds real API keys. The agent environment contains only:
- A revocable agent token (
av_agt_...) — authenticates to Agent Vault, has no relationship to the upstream API keys - Placeholder strings in env vars (e.g.,
__anthropic_api_key__) — these look like credentials but are inert
Credential Injection Mechanisms
Auth Type Injection (5 modes):
| Type | Mechanism | Example |
|---|---|---|
bearer | Sets Authorization: Bearer <credential> | GitHub, OpenAI, Stripe |
basic | Sets Authorization: Basic <base64> | Jira, Twilio |
api-key | Sets a named header (e.g., x-api-key) | Anthropic |
custom | Template {{ KEY }} → resolves at proxy time | Proprietary APIs |
passthrough | Allowlists host, no injection | Client-managed credentials |
Substitution Injection: Placeholder strings in the URL path, query string, request body, WebSocket text frames, or headers are scanned and replaced at proxy time. Example:
- Service declares
substitutions: [{key: TWILIO_SID, placeholder: __sid__, in: [path]}] - Agent sends
GET /2010-04-01/Accounts/__sid__/Messages.json - Agent Vault replaces
__sid__with the real SID before forwarding
Security Architecture
| Layer | Mechanism |
|---|---|
| At rest | AES-256-GCM encryption, KEK/DEK key wrapping, Argon2id master password derivation |
| In transit | Credentials injected server-side during proxy forwarding — never transit the agent’s network stack |
| Token model | 256-bit crypto/rand tokens, SHA-256 hashed before storage, raw token returned exactly once |
| Network guard | DNS rebinding protection, IP-level blocklist for RFC-1918/cloud metadata |
| Rate limiting | Tiered per-actor/vault budget |
| Egress filtering | Strict deny mode: reject unmatched hosts with 403 |
| Access control | Instance roles (owner/member/no-access) × vault roles (admin/member/proxy) |
| Request logging | Full authenticated traffic inspection |
Proposal Workflow (the human-in-the-loop)
Agent hits 403 on unknown host
→ Agent POSTs /v1/proposals with service request + credential slots
→ Agent Vault creates proposal, returns approval URL
→ Agent shares URL with human (e.g., in Discord/Slack/Telegram)
→ Human clicks link, reviews requested permissions, provides actual credential values
→ Human approves
→ Agent Vault merges service rules + credentials atomically
→ Agent retries original request — now it works
Credential Store Backends
- Built-in (default): SQLite database, AES-256-GCM encrypted
- Infisical (external): Polls Infisical project, encrypts locally with same DEK
3. Comparison with Hermes’ Current .env Approach
Hermes Current Approach
Hermes loads credentials from ~/.hermes/.env via load_hermes_dotenv() in hermes_cli/env_loader.py:
~/.hermes/.env ~206 key=value pairs (API keys + config)
├── OPENROUTER_API_KEY (primary LLM provider)
├── GEMINI_API_KEY (alternative providers)
├── KIMI_API_KEY
├── ARCEEAI_API_KEY
├── HF_TOKEN (HuggingFace)
├── EXA_API_KEY (web search tool)
├── FIRECRAWL_API_KEY (web crawling)
├── FAL_KEY (image generation)
├── SLACK_BOT_TOKEN (messaging platform)
├── TELEGRAM_BOT_TOKEN
├── BROWSERBASE_API_KEY (browser automation)
├── GROQ_API_KEY (speech-to-text)
├── GITHUB_TOKEN (skill hub)
├── VOICE_TOOLS_OPENAI_KEY (TTS/STT)
├── ... and many more
Flow: .env → python-dotenv loads into os.environ → Hermes agent process reads os.environ[KEY] at runtime → sends directly in HTTP headers/API calls.
Credential Pool: Hermes has a CredentialPool class (agent/credential_pool.py) that manages multi-credential failover for same-provider scenarios. It supports strategies (fill_first, round_robin, random, least_used), tracks exhaustion, dead credentials, and cooldown TTLs. But it still operates on raw credential values that the process already holds in memory.
External Secret Sources: Hermes has basic support for Bitwarden via _SECRET_SOURCES tracking in env_loader.py, but this is a compile-time injection into os.environ — not a runtime proxy architecture.
Side-by-Side Comparison
| Aspect | Hermes .env (Current) | Agent Vault (Proposed) |
|---|---|---|
| Credential location | On agent host in .env file | On separate broker host, encrypted at rest |
| Credential transit | Loaded into agent process memory, sent in outbound HTTP by agent | Injected by proxy server-side; agent never sees raw values |
| Exfiltration risk | Keys exposed to the agent may be extracted via prompt injection | Upstream-key exposure is reduced; agent-token theft and authorized API abuse remain possible |
| Attack surface | Agent has direct access to all API keys | Agent token grants proxy-only access; no credential access |
| Multi-credential pools | Built-in (CredentialPool class, failover, cooldown) | Not built-in (single credential per service slot) |
| Credential rotation | Manual: edit .env + restart agent | Manual: update in Agent Vault UI, or use Infisical-backed store for auto-sync |
| Egress control | Depends on host/network controls | Unmatched traffic forwards by default; set unmatched_host_policy=deny for 403 and enforce proxy-only network access separately |
| Audit/logging | Agent-side only (Hermes trajectory logs) | Proxy-side: all authenticated traffic logged |
| Human approval | Not applicable (keys pre-configured) | Proposal workflow: agent requests, human approves |
| Setup complexity | Copy keys into .env file | Deploy separate service, create vaults, configure services, mint agent tokens |
| Latency overhead | No broker hop | Adds a proxy hop; latency has not been measured here |
| Infrastructure | Single machine in this proposal | Separate broker host is recommended; access, transport and network controls are still required |
| Multi-tenancy | Single user/machine | Multi-vault, multi-agent, role-based access |
| Passwordless mode | No | Yes (DEK stored in plaintext DB — suitable for PaaS) |
| Key count supported | Unlimited (flat .env) | Unlimited (per vault) |
| LLM provider failover | CredentialPool rotates credentials within one provider; cross-provider routing is separate | Cross-provider failover is not established by this report |
Security Comparison
Current .env approach vulnerabilities:
- Prompt injection → credential exfiltration: Agent could be tricked into reading
.env, printingos.environ, or including keys in output - Filesystem access: Processes with sufficient file permissions can read
.env; same-host presence alone does not grant access - Hardcoded in process memory: Keys persist in Python process memory for session duration
- No access scoping: Agent has ALL keys — can’t restrict per-host or per-task
- No audit trail: Can’t distinguish which key was used for which request
Agent Vault mitigations:
- Agent holds placeholders and an agent token; prompt injection can still misuse that token or authorized services
- Agent token is revocable, vault-scoped, and grants only
proxyrole (cannot read credential values) - Credentials are decrypted for forwarding; discarding references is not proof of secure memory erasure
- Service rules scope credential injection; deny unmatched hosts explicitly and prevent direct network bypass to enforce an allowlist
- Full request logging on the proxy
Trade-offs
| Hermes Wins | Agent Vault Wins |
|---|---|
| Zero infrastructure: No separate service to deploy | Exfiltration prevention: Agent never touches real keys |
| No latency overhead: Direct API calls | Egress filtering: Control which hosts each agent reaches |
| Simpler setup: Just edit .env | Access control: Per-vault roles, multi-agent support |
| Multi-credential failover: Built-in pool rotation | Human-in-the-loop: Proposals let humans review before granting access |
| 200+ keys supported: Flat file, no configuration overhead | Audit logging: Every authenticated request is logged |
| Tools/skills compatibility: All existing tools read os.environ seamlessly | Token revocation: Cut off an agent instantly without changing API keys |
4. Integration Feasibility
How Hermes Would Use Agent Vault (the documented approach)
The Agent Vault docs include a specific guide titled “Run Hermes on a VPS” that walks through:
- Provision two VPS boxes (broker + agent host)
- Install Agent Vault on the broker
- Create vault with credentials + services
- Create agent token
- On the Hermes host:
- Install Agent Vault CLI
- Set
AGENT_VAULT_ADDR,AGENT_VAULT_TOKEN,AGENT_VAULT_VAULT - Set all env vars to placeholder values (e.g.,
ANTHROPIC_API_KEY=__anthropic_api_key__) - Run:
agent-vault run -- hermes(boots Hermes with HTTPS_PROXY set)
This is already a fully documented, working integration path. The Agent Vault team has a companion video demonstrating this exact flow.
Integration Depth Options
Option A: Standard HTTPS_PROXY Integration (recommended, already works)
- Deploy Agent Vault on separate host
- Set
HTTPS_PROXYenvironment variable - Replace real keys with placeholders in
.env agent-vault run -- hermeswrapper- Pros: Zero code changes in Hermes, fully documented
- Cons: Doesn’t leverage Hermes-specific features (CredentialPool, credential source tracking)
Option B: Deep Integration (agent-vault-sdk / custom Python client)
- Build a Hermes plugin (
plugins/agent-vault/) that:- Implements Hermes’ credential resolution interface
- Mints scoped sessions and sets proxy configuration; upstream credentials remain at the broker
- Supports the proposal workflow (proactive proposal creation when new hosts are hit)
- Integrates with Hermes’
CredentialPoolfor failover
- Pros: Native Hermes experience, credential pool integration, proposal-aware
- Cons: ~2-4 weeks development effort
Option C: Minimal Integration (Hermes skill)
- Create an
agent-vaultskill that:- Mints short-lived sessions via Agent Vault SDK
- Automates vault/service configuration
- Provides
hermes agent-vault setupwizard
- Pros: Quick to ship, can be an optional skill
- Cons: Still relies on HTTPS_PROXY under the hood
Technical Challenges
-
CredentialPool incompatibility: Hermes’
CredentialPooloperates on raw credential values for failover/rotation. Agent Vault’s proxy model intentionally hides raw values. A deep integration would need an adapter layer. -
200+ env vars: Hermes has ~206 key=value pairs in
.env. Not all are credentials — many are config (timeouts, paths, flags). Only ~40-50 are actual sensitive credentials. Each would need a corresponding service rule in Agent Vault. -
Tools that bypass HTTPS_PROXY: Some tools/libraries may not respect
HTTPS_PROXY(e.g., direct socket connections, WebSocket libraries, custom transports). Agent Vault’s MITM handles CONNECT tunnels but edge cases exist. -
${LOCALIP} development: Running Agent Vault locally can work (
agent-vault server -d) but the security guarantee requires separation. On a single machine, the agent process could still access the Agent Vault process if not properly sandboxed. -
Proposal UX: The proposal workflow (agent asks human for credential approval via link) is powerful but adds friction. Hermes currently uses pre-configured keys — the friction of explicit approval every time a new service is needed may not suit all workflows.
What Would Need to Change in Hermes
For Option A (proxy-only):
- Install script: add Agent Vault installation step
- CLI: add
hermes agent-vault setupcommand to create vault/agent token - .env example: document placeholder mode
- Documentation: add Agent Vault integration guide
For Option B (deep integration):
- New plugin:
hermes-agent/plugins/credential-store/agent-vault/ - Modify
env_loader.py: add Agent Vault as a credential source (alongside Bitwarden) - Modify
CredentialPool: add Agent Vault adapter that calls the agent-vault-sdk - New proposal handler: intercept 403s from Agent Vault and auto-create proposals
- New CLI commands:
hermes agent-vaultsubcommand for management
5. Concrete Recommendation
Recommendation: ADOPT — but as a GRADUAL, COMPLEMENTARY deployment option
Agent Vault does not need to replace Hermes’ .env system. It should augment it as an alternative deployment mode for users who want stronger credential security guarantees. Both approaches can coexist.
Implementation Plan
Phase 1 — Document & Enable (1-2 days)
- Add Agent Vault as an optional skill/plugin
- Create
hermes agent-vault setupwizard - Update
.env.examplewith placeholder documentation - Add integration guide to Hermes docs
Phase 2 — Proxy Integration (already works out of the box)
- Test and verify
agent-vault run -- hermesend-to-end - Document the two-VPS architecture
- Add Docker Compose example for local evaluation
Phase 3 — Deep Integration (2-3 weeks, optional)
- Build
plugins/credential-store/agent-vault/Python client - Agent Vault-aware credential resolution in
env_loader.py - Proposal workflow integration (automatic proposal creation on unknown hosts)
- CredentialPool adapter for Agent Vault-backed failover
Phase 4 — Advanced (future)
- Short-lived session minting via agent-vault-sdk for ephemeral sandboxes
- Policy-as-code: define Hermes per-session service permissions in Agent Vault
When to Use Agent Vault vs .env
| Use Case | Recommended Approach |
|---|---|
| Local development, single user | .env — simpler, no infra overhead |
| Production deployment on VPS | Agent Vault — credential exfiltration prevention |
| Shared machine (dev server, CI) | Agent Vault — multi-tenant isolation |
| Ephemeral sandboxes | Agent Vault — short-lived sessions, revocable |
| Enterprise / team usage | Agent Vault — audit, egress control, roles |
| Rapid prototyping, experimentation | .env — no setup friction |
| Running on trusted hardware only | Either — security vs. simplicity tradeoff |
Key Judgment
Agent Vault has an official proxy integration design; production readiness and the proposed Hermes integration have not been tested here. Its README distinguishes this self-contained project from Infisical Agent Vault, which it recommends for production and enterprise use. The licensing statement also reserves an enterprise ee exception. The fundamental architecture is sound: proxy-based credential injection is the right security pattern for AI agents, addressing the prompt injection credential exfiltration problem that .env cannot solve.
The critical insight: Agent Vault does not compete with Hermes’ .env system — it complements it. The .env remains the simplest on-ramp for local development. Agent Vault becomes the production security layer when credentials must be protected from the agent itself.
For Hermes as an open-source project, offering both options is a differentiator: users can start with .env and graduate to Agent Vault as their deployment matures.
Verdict
| Dimension | Rating (1-5) |
|---|---|
| Architecture soundness | ★★★★★ |
| Security improvement over .env | ★★★★★ |
| Integration complexity | ★★★☆☆ (moderate) |
| Feature parity with .env | ★★★☆☆ (no CredentialPool failover) |
| Documentation quality | ★★★★★ |
| Project maturity | ★★★★☆ (active dev, 2.5 months old) |
| Long-term viability | ★★★★★ (backed by Infisical) |
Bottom line: Agent Vault should become a FIRST-CLASS deployment option for Hermes, alongside the existing .env mode. Make it easy to opt in, document both paths clearly, and build deeper integration over time. Do NOT force migration — offer choice.