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

ComponentPurpose
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
VaultLogical container for credentials + service rules. Has members with roles (admin/member/proxy)
ServicePer-vault rule: host pattern + auth config (bearer/basic/api-key/custom/passthrough) + optional substitutions
CredentialAPI key / secret stored encrypted at rest (AES-256-GCM) behind KEK/DEK key wrapping
ProposalAgent-initiated request for new credentials + services. Human must approve via browser link
AgentIdentity (token) that can be scoped to vaults with proxy role
SessionVault-scoped short-lived token from vault run (5 min–7 days)

Data Flow

  1. Agent sets HTTPS_PROXY=http://agent-vault:14322, HTTP_PROXY=http://agent-vault:14322
  2. Agent uses a dummy placeholder value for API keys (e.g., ANTHROPIC_API_KEY=__anthropic_api_key__)
  3. Agent makes an API call → traffic hits Agent Vault proxy
  4. Agent Vault authenticates the agent via Proxy-Authorization header (agent token, never forwarded to upstream)
  5. Matches the target host against vault’s services
  6. Looks up real credential from encrypted store
  7. Injects real credential into the outbound request header (or substitutes placeholders in path/body/query)
  8. Forwards the request to the real upstream API over HTTPS
  9. 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):

TypeMechanismExample
bearerSets Authorization: Bearer <credential>GitHub, OpenAI, Stripe
basicSets Authorization: Basic <base64>Jira, Twilio
api-keySets a named header (e.g., x-api-key)Anthropic
customTemplate {{ KEY }} → resolves at proxy timeProprietary APIs
passthroughAllowlists host, no injectionClient-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

LayerMechanism
At restAES-256-GCM encryption, KEK/DEK key wrapping, Argon2id master password derivation
In transitCredentials injected server-side during proxy forwarding — never transit the agent’s network stack
Token model256-bit crypto/rand tokens, SHA-256 hashed before storage, raw token returned exactly once
Network guardDNS rebinding protection, IP-level blocklist for RFC-1918/cloud metadata
Rate limitingTiered per-actor/vault budget
Egress filteringStrict deny mode: reject unmatched hosts with 403
Access controlInstance roles (owner/member/no-access) × vault roles (admin/member/proxy)
Request loggingFull 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

AspectHermes .env (Current)Agent Vault (Proposed)
Credential locationOn agent host in .env fileOn separate broker host, encrypted at rest
Credential transitLoaded into agent process memory, sent in outbound HTTP by agentInjected by proxy server-side; agent never sees raw values
Exfiltration riskKeys exposed to the agent may be extracted via prompt injectionUpstream-key exposure is reduced; agent-token theft and authorized API abuse remain possible
Attack surfaceAgent has direct access to all API keysAgent token grants proxy-only access; no credential access
Multi-credential poolsBuilt-in (CredentialPool class, failover, cooldown)Not built-in (single credential per service slot)
Credential rotationManual: edit .env + restart agentManual: update in Agent Vault UI, or use Infisical-backed store for auto-sync
Egress controlDepends on host/network controlsUnmatched traffic forwards by default; set unmatched_host_policy=deny for 403 and enforce proxy-only network access separately
Audit/loggingAgent-side only (Hermes trajectory logs)Proxy-side: all authenticated traffic logged
Human approvalNot applicable (keys pre-configured)Proposal workflow: agent requests, human approves
Setup complexityCopy keys into .env fileDeploy separate service, create vaults, configure services, mint agent tokens
Latency overheadNo broker hopAdds a proxy hop; latency has not been measured here
InfrastructureSingle machine in this proposalSeparate broker host is recommended; access, transport and network controls are still required
Multi-tenancySingle user/machineMulti-vault, multi-agent, role-based access
Passwordless modeNoYes (DEK stored in plaintext DB — suitable for PaaS)
Key count supportedUnlimited (flat .env)Unlimited (per vault)
LLM provider failoverCredentialPool rotates credentials within one provider; cross-provider routing is separateCross-provider failover is not established by this report

Security Comparison

Current .env approach vulnerabilities:

  1. Prompt injection → credential exfiltration: Agent could be tricked into reading .env, printing os.environ, or including keys in output
  2. Filesystem access: Processes with sufficient file permissions can read .env; same-host presence alone does not grant access
  3. Hardcoded in process memory: Keys persist in Python process memory for session duration
  4. No access scoping: Agent has ALL keys — can’t restrict per-host or per-task
  5. No audit trail: Can’t distinguish which key was used for which request

Agent Vault mitigations:

  1. Agent holds placeholders and an agent token; prompt injection can still misuse that token or authorized services
  2. Agent token is revocable, vault-scoped, and grants only proxy role (cannot read credential values)
  3. Credentials are decrypted for forwarding; discarding references is not proof of secure memory erasure
  4. Service rules scope credential injection; deny unmatched hosts explicitly and prevent direct network bypass to enforce an allowlist
  5. Full request logging on the proxy

Trade-offs

Hermes WinsAgent Vault Wins
Zero infrastructure: No separate service to deployExfiltration prevention: Agent never touches real keys
No latency overhead: Direct API callsEgress filtering: Control which hosts each agent reaches
Simpler setup: Just edit .envAccess control: Per-vault roles, multi-agent support
Multi-credential failover: Built-in pool rotationHuman-in-the-loop: Proposals let humans review before granting access
200+ keys supported: Flat file, no configuration overheadAudit logging: Every authenticated request is logged
Tools/skills compatibility: All existing tools read os.environ seamlesslyToken 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:

  1. Provision two VPS boxes (broker + agent host)
  2. Install Agent Vault on the broker
  3. Create vault with credentials + services
  4. Create agent token
  5. 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

  • Deploy Agent Vault on separate host
  • Set HTTPS_PROXY environment variable
  • Replace real keys with placeholders in .env
  • agent-vault run -- hermes wrapper
  • 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’ CredentialPool for 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-vault skill that:
    • Mints short-lived sessions via Agent Vault SDK
    • Automates vault/service configuration
    • Provides hermes agent-vault setup wizard
  • Pros: Quick to ship, can be an optional skill
  • Cons: Still relies on HTTPS_PROXY under the hood

Technical Challenges

  1. CredentialPool incompatibility: Hermes’ CredentialPool operates on raw credential values for failover/rotation. Agent Vault’s proxy model intentionally hides raw values. A deep integration would need an adapter layer.

  2. 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.

  3. 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.

  4. ${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.

  5. 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 setup command 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-vault subcommand 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 setup wizard
  • Update .env.example with placeholder documentation
  • Add integration guide to Hermes docs

Phase 2 — Proxy Integration (already works out of the box)

  • Test and verify agent-vault run -- hermes end-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 CaseRecommended Approach
Local development, single user.env — simpler, no infra overhead
Production deployment on VPSAgent Vault — credential exfiltration prevention
Shared machine (dev server, CI)Agent Vault — multi-tenant isolation
Ephemeral sandboxesAgent Vault — short-lived sessions, revocable
Enterprise / team usageAgent Vault — audit, egress control, roles
Rapid prototyping, experimentation.env — no setup friction
Running on trusted hardware onlyEither — 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

DimensionRating (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.