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
AgentSecrets CloudThe Dual-Engine Model

The Dual-Engine Model

AgentSecrets is architected as a Dual-Engine System. This ensures that the exact same application code, CLI commands, and SDK calls operate consistently across local development workstations and cloud production environments without modification.

DUAL-ENGINE ROUTING ┌─────────────────────┴─────────────────────┐ ▼ ▼ [ LOCAL ENGINE ] [ CLOUD ENGINE ] - Local Workstations - Cloud Containers / CI / Serverless - Resolves from OS Keychain - Resolves via Cloud Resolver - Zero calls to AgentSecrets servers - Scoped Workload Tokens (agt_prod_...) - Local development credentials - Centralized production credentials

The 4-Tier Precedence Hierarchy

Whether executing CLI commands or dispatching HTTP requests via the Python SDK, AgentSecrets evaluates the execution environment using a strict 4-tier precedence hierarchy:

Loading diagram...
TierTrigger MechanismTarget EnginePrimary Use Case
1. CLI Flag / Code Config--cloud flag OR settings.use_cloud = TrueCloud Engine1-off local debugging against Cloud staging secrets
2. Global Environment VarAGENTSECRETS_USE_CLOUD=true (or 1)Cloud EngineGlobal shell configuration or local Docker emulation
3. Headless Auto-DetectionAGENTSECRETS_TOKEN=agt_... presentCloud EngineProduction containers (Docker, ECS, Kubernetes, Vercel)
4. Default FallbackNone (Standard workstation)Local EngineZero-network local development from OS Keychain

Code & Integration Patterns

1Python SDK Integration

Applications using the Python SDK utilize the built-in credential helper. The SDK routes requests to the local proxy or Cloud Resolver based on your settings configuration, automatically defaulting to cloud resolution when running in headless container environments:

from agentsecrets import AgentSecrets, credential # Routes via local proxy on developer laptops, Cloud Resolver in headless containers secrets = AgentSecrets() response = secrets.call( "https://api.stripe.com/v1/customers", method="GET", headers={"Authorization": f"Bearer {credential.STRIPE_KEY}"} ) print("Response Status:", response.status_code) print("Data:", response.json())

2Transparent Interception (Stripe, OpenAI, LangChain)

For applications that interface with third-party SDKs (such as the official openai or stripe packages), enable ambient proxying with install_interceptor():

import openai from agentsecrets import install_interceptor # Transparently intercepts outbound HTTP traffic install_interceptor() # Injects OPENAI_API_KEY on the wire automatically client = openai.OpenAI() response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Analyze system performance"}] )

3Programmatic Configuration Overrides

You can explicitly configure resolution behavior in code:

from agentsecrets import settings # Explicitly force cloud resolution settings.use_cloud = True # Optionally override Cloud Resolver endpoint (for self-hosted clusters) settings.cloud_resolver_url = "https://resolver.agentsecrets-website.vercel.app"

4Headless Container Execution ()

For containerized applications that read environment variables on initialization:

# On your workstation: resolves from local OS Keychain agentsecrets env -- npm run dev # Testing against cloud secrets locally: agentsecrets env --cloud -- npm run dev # In Docker: automatically detects AGENTSECRETS_TOKEN and reads from Cloud agentsecrets env -- node server.js

5Production Dockerfile Specifications

Install the CLI in container images using standard package managers:

# Node.js Container: FROM node:20-alpine WORKDIR /app COPY . . RUN npm install -g @the-17/agentsecrets ENTRYPOINT ["agentsecrets", "env", "--", "node", "server.js"]
# Python Container: FROM python:3.11-slim WORKDIR /app COPY . . RUN pip install agentsecrets-cli ENTRYPOINT ["agentsecrets", "env", "--", "python", "main.py"]

Architectural Benefits

  • Elimination of .env Drift: Eliminates the risk of developers sharing unencrypted .env files or running stale credentials locally.
  • Autonomous Local Development: Local secret resolution executes entirely within the operating system keychain without depending on an external network connection or remote secret vault.
  • Zero Application Refactoring: Moving an application from local development to production Kubernetes clusters requires zero changes to application code.
Was this helpful?
Thanks for your feedback!
Your feedback helps us improve the platform.