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
Credential Proxy Overview
Secrets Management
Environments
env Injection
Workspaces & Teams
Projects
Agent Identity
Audit & Governance
account (init / login / logout)
server (get / set / status / reset)
secrets (set / list / delete / push / pull)
proxy (start / stop / status / logs)
call (inject requests via proxy)
env (execute commands with secrets)
workspace (list / create / switch / roles)
project (list / create / use / update)
environment (list / switch / copy / merge)
agent (register / list / tokens)
agent policy (set / get / delete)
logs (list / watch / export / verify)
mcp (serve / install / config)
status (system & session diagnostics)
Aliases & Shortcuts
docs (interactive terminal viewer)
Shell Autocompletion
keychain-auth (daemon & security)
Ecosystem Overview
Zero-Knowledge MCP Server
Integrations Overview
Claude Desktop
Cursor IDE
OpenClaw
HTTP Proxy (Any Client)
LangChain (Native)
CrewAI (Native)
CI/CD Pipeline
SDK Overview
Python SDK
Python API Reference
Python SDK Manual Testing
JavaScript SDK (Soon)
ZK-MCP Integration Guide
Server Overview
5-Layer Architecture
Self-Hosting Guide
Self-Hosting Operations Manual
Server Data Migration
Authentication & Keys
Workspaces & Teams Backend
Projects & Scope Backend
Environments Backend
Secrets & Sync Protocol
Agent Identity Resolution
Telemetry & Metrics Engine
Audit Log Sync
API Endpoint Reference
Cloud Overview & Architecture
The Dual-Engine Model
Cloud Resolver Data Plane
Workload & Agent Tokens
Egress Allowlists & Audit Streams
Cloud REST API 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.x
v2.1.0
v2.0.0
v1.4.0
v1.3.x
v1.2.0
v1.1.x
v1.0.x
Secrets & EnvironmentsInjecting into Any Process

Running Any Process with Environment Injection

Because agentsecrets env operates at the operating system process boundary via the standard POSIX execve interface, it is 100% runtime- and language-agnostic. Any application that can read system environment variables can run with AgentSecrets without installing an SDK or modifying a single line of code.


Production Recipes & Integration Examples

1Docker & Docker Compose (Zero-Disk Secrets)

When building microservices or local containers, developers often place sensitive database passwords or API keys directly in docker-compose.yml or load them from a .env file that gets committed by accident.

Instead, define your Compose services to inherit variables from the host environment:

</div> # docker-compose.yml services: api: image: my-company/api:latest ports: - "8000:8000" environment: # Docker automatically binds these from host memory if not defined in YAML - DATABASE_URL - STRIPE_SECRET_KEY - REDIS_PASSWORD

Now, launch your containers with in-memory injection:

agentsecrets env -- docker compose up
  • Why this works: Docker Compose reads DATABASE_URL and STRIPE_SECRET_KEY directly from the parent environment created by agentsecrets env in RAM.
  • Security Win: No .env file exists on the host disk. Docker Compose configuration files can be committed safely to Git.

2Full-Stack Web Frameworks

Node.js / Next.js / Express

Run your development server or production build script:

agentsecrets env -- npm run dev </div> # Or with pnpm / yarn / bun: agentsecrets env -- bun run dev

Inside your Next.js API routes or server components:

// app/api/checkout/route.ts // Standard process.env access — no dotenv, no dotenv-vault packages required const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);

Python / Django / FastAPI

Run database migrations or local development servers:

agentsecrets env -- python manage.py migrate agentsecrets env -- python manage.py runserver 0.0.0.0:8000

In your settings.py:

import os # Resolves immediately from child process memory SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY") DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql", "NAME": os.environ.get("DB_NAME"), "USER": os.environ.get("DB_USER"), "PASSWORD": os.environ.get("DB_PASSWORD"), "HOST": os.environ.get("DB_HOST", "localhost"), "PORT": os.environ.get("DB_PORT", "5432"), } }

3Background Queues & Asynchronous Workers (Celery, BullMQ, Sidekiq)

Background workers require persistent database and broker connections, and must shut down gracefully when deployments occur or when developers press Ctrl+C.

Because agentsecrets env implements an active POSIX Signal Supervisor, it forwards SIGINT and SIGTERM directly to the worker process:

agentsecrets env -- celery -A myproject worker --loglevel=info

When you terminate the worker with Ctrl+C, agentsecrets env forwards the interrupt directly to Celery. Celery acknowledges the signal, stops accepting new tasks, waits for in-flight tasks to complete, and closes Redis/RabbitMQ connections cleanly without orphaning worker processes.


4Claude Desktop & Cursor IDE (AI MCP Servers)

Model Context Protocol (MCP) servers allow AI assistants like Claude Desktop and Cursor to interact with tools. Most MCP servers (e.g. Postgres MCP, Stripe MCP, GitHub MCP) require API keys configured in claude_desktop_config.json.

Storing plaintext API keys in Claude Desktop's JSON configuration is dangerous because any file-reading prompt injection can read the JSON file.

Wrap the MCP server command in agentsecrets env:

{ "mcpServers": { "stripe": { "command": "agentsecrets", "args": ["env", "--", "npx", "-y", "@stripe/mcp"] }, "postgres": { "command": "agentsecrets", "args": ["env", "--", "npx", "-y", "@modelcontextprotocol/server-postgres"] } } }
  • Security Win: Notice the complete absence of an "env" block in claude_desktop_config.json.
  • When Claude Desktop launches the MCP server, agentsecrets env retrieves STRIPE_SECRET_KEY and POSTGRES_URL directly from your OS Keychain and injects them into the spawned MCP process memory.

5Running Interactive Shells & REPLs

You can launch an interactive shell where all active environment secrets are temporarily accessible:

agentsecrets env -- bash

Or launch interactive language REPLs:

agentsecrets env -- python agentsecrets env -- node
  • Because childCmd.Stdin = os.Stdin, input is piped directly to your terminal.
  • Once you type exit or close the shell, the process terminates and all decrypted secrets disappear from memory.

Common Edge Cases & Troubleshooting

Why the -- Delimiter is Mandatory

If you run:

agentsecrets env python manage.py runserver --help

Without --, the Cobra CLI parser checks --help and displays the help page for agentsecrets env rather than passing --help to Django.

Always include -- to cleanly partition the CLI boundary:

agentsecrets env -- python manage.py runserver --help

Passing Complex Pipeline Commands (sh -c)

If you want to use pipes (|), shell redirects (>), or command chains (&&), wrap them in sh -c so your host shell doesn't execute the pipe before AgentSecrets spawns:

# Correct: Subshell receives the injected variables agentsecrets env -- sh -c 'python export.py | gzip > backup.gz' # Incorrect: The host shell executes the pipe outside of AgentSecrets agentsecrets env -- python export.py | gzip > backup.gz

Path Resolution (exec.LookPath)

agentsecrets env uses the host system $PATH to resolve the target executable. If you are using virtual environments (Python venv or poetry) or local Node binaries (npx, ./node_modules/.bin):

# Activate your virtualenv first: source .venv/bin/activate agentsecrets env -- python main.py # Or specify the path directly: agentsecrets env -- .venv/bin/python main.py agentsecrets env -- ./node_modules/.bin/jest
Was this helpful?
Thanks for your feedback!
Your feedback helps us improve the platform.