What is AgentSecrets?
The Zero-Knowledge Difference
How AgentSecrets Works
Installation
Quick Start
Migrating from .env Files
Migrating from Vault / AWS
Migrating from dotenv-vault
Production Checklist
Credential Exposure
What Zero-Knowledge Means
The Proxy Model
The Three-Layer Model
Environments
Agent Identity
Storage Modes
The No get() Principle
Secret-Level Policies
Cloud Overview & Architecture
The Dual-Engine Model
Cloud Resolver Data Plane
Workload & Agent Tokens
Egress Allowlists & Audit Streams
Cloud REST API Reference
Account (init / login)
Server & Self-Hosting (server)
Docs
Shell Autocompletion
Keychain Auth
Secrets
Environments
Credential Proxy
env Injection
Workspaces & Teams
Projects
Agent Identity
Audit & Governance
Integrations Overview
Claude Desktop
Cursor
OpenClaw
HTTP Proxy (Any)
LangChain (Soon)
CrewAI (Soon)
CI/CD Pipeline
SDK Overview
Python SDK
Python API Reference
Python SDK Manual Testing
JavaScript SDK (Soon)
Ecosystem Overview
Zero-Knowledge MCP Server
Server Overview
5-Layer Architecture
Self-Hosting Guide
Authentication & Keys
Workspaces & Teams
Projects & Scope
Environments
Secrets & Sync Protocol
Agent Identity Resolution
Telemetry & Metrics Engine
Audit Log Sync
API Endpoint Reference
Security Overview
Anti-Impersonation & Process Verification
Encryption Model
Zero-Knowledge Sync
Proxy Security Layers
Threat Model
OWASP Top 10 Mitigation
Security FAQ
Third-Party Audit
Reporting Vulnerabilities
Guides Overview
Building on the SDK
Stripe Integration
OpenAI Integration
Multi-Agent Setup
Onboarding Team
CI/CD Pipeline
Publishing ZK MCP
Rotating Credentials
Auditing Team Activity
Dev to Production
Kubernetes Deployment
Monorepo Setup
Production Proxy Hardening
vs .env Files
vs HashiCorp Vault
vs AWS Secrets Manager
vs dotenv-vault
vs Infisical
When Not to Use
Proxy Not Starting
Proxy Not Resolving
Domain Blocked
Sync Conflicts
MCP Not Connecting
Session Token Errors
Proxy Session Authorization
Keychain Storage & Backends
SSRF & Destination Rules
Installation Issues
Error Codes Reference
Frequently Asked Questions
v3.1.x
v3.0.0
v2.1.0
v2.0.0
v1.4.0
v1.3.x
v1.2.0
v1.1.x
v1.0.x
GuidesProduction Proxy Hardening

Proxy Security Hardening Guide

The AgentSecrets Credential Proxy acts as the active firewall between your autonomous agents and your sensitive credentials. This guide outlines the security model and best practices for hardening the proxy in staging and production environments.


The Proxy Security Model

The proxy operates under a zero-knowledge, zero-trust framework designed to mitigate agent hijacking, prompt injection, and credential exfiltration.

+------------------+ X-AS-Session-Token +--------------------+ | Agent Runtime | ===========================> | Credential Proxy | +------------------+ +--------------------+ || Resolves via OS Keychain || \/ +------------------+ Injected Outbound +--------------------+ | Target API | <=========================== | Upstream Gateway | +------------------+ (Allowlist Bound) +--------------------+

Core Security Controls

1Pre-Shared Session Token Validation

Any process interacting with the proxy port must present a valid X-AS-Session-Token header.

  • Seamless CLI Handling: The CLI automatically extracts the active session token from the secure OS Keychain and injects it for you.
  • IPC Isolation: Unauthorized programs or sandboxed browser extensions cannot make requests through the proxy port without read access to the OS Keychain (which requires OS keychain authorization).

2DNS Rebinding Prevention

To block DNS Rebinding, the proxy resolves the target host's IP address and dials that specific IP directly rather than passing the hostname to the connection tunnel. This ensures that the IP cannot be switched to a loopback or private address between DNS resolution and TCP connection.

3Server-Side Request Forgery (SSRF) Blocking

The proxy dialer intercepts all outbound connections and blocks requests targeting:

  • Private IP ranges (RFC 1918, e.g., 10.0.0.0/8, 192.168.0.0/16).
  • Local loopback addresses (127.0.0.1, ::1).
  • Link-local addresses and cloud metadata endpoints (169.254.169.254).

Hardening Best Practices

Follow these configuration steps to ensure absolute isolation:

1Disable Local HTTP Loopback Bypass

Ensure that --allow-local-http is never enabled in staging or production. By keeping this option disabled, you guarantee that agents cannot communicate with any local databases, docker daemons, or sibling processes on the host machine.

2Enforce the Domain Allowlist

The domain allowlist is always strictly enforced by the proxy; there is no option or bypass flag to disable it. Always specify target domains explicitly before making requests:

agentsecrets workspace allowlist add api.stripe.com api.openai.com

Only administrators can alter this list (requiring admin password confirmation).

3Rotate Session Tokens Regularly

To minimize the exposure window of any local session, rotate the proxy pre-shared key periodically:

agentsecrets proxy rotate-session

This updates the OS Keychain and instructs the active proxy daemon to reload the token immediately.

Was this helpful?
Thanks for your feedback!
Your feedback helps us improve the platform.