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
Getting StartedQuick Start

Quick Start

Install AgentSecrets, store your first secret, and make your first zero-knowledge API call. The whole setup takes about five minutes.

This guide walks you through everything you need to go from a fresh install to your first authenticated API call where the credential value never enters your agent’s context. By the end, you’ll have a project set up, secrets stored, an AI tool connected, and a live audit log entry to confirm it all worked.

1Install the CLI

Choose the installation method that fits your environment.

# macOS / Linux — recommended brew install The-17/tap/agentsecrets

Verify your installation with:

agentsecrets --version

2Initialize

Run agentsecrets init to create your account and set up your local environment.

agentsecrets init

The interactive setup will:

  1. Ask whether to create a new account or log in to an existing one
  2. Ask which storage mode to use:
    • Keychain (recommended) — secrets are stored in your OS keychain; no .env file is created
    • Standard — secrets are written to a .env file (traditional workflow)
  3. Generate a cryptographic keypair on your machine. Your private key never leaves your device.
  4. Write .agent/workflows/agentsecrets.md, a workflow file that teaches any AI assistant how to use AgentSecrets automatically.

To skip the interactive prompts:

agentsecrets init --storage-mode 1 # Keychain mode (recommended) agentsecrets init --storage-mode 2 # Standard .env mode

If you are returning to an existing account on a new machine, agentsecrets init detects that and walks you through joining your existing workspace.

The workflow file at.agent/workflows/agentsecrets.md is read automatically by Claude, Cursor, and other AI tools. Do not edit it manually to change environments — use agentsecrets environment switch instead.

3Create a project

Projects map to your applications. Secrets are partitioned by project, and every secrets operation uses the active project context.

agentsecrets project create my-app

This writes .agentsecrets/project.json in the current directory, linking it to the remote project. The file contains no credentials and is safe to commit.

New projects use the development environment by default. Switch environments at any time:

# Switch to staging environment agentsecrets environment switch staging

4Store your secrets

Set secrets one at a time or multiple at once. When you run secrets set, AgentSecrets writes the secret to your local OS Keychain and automatically encrypts client-side and syncs it to the cloud backend:

# Set a secret (auto-saved locally and synced to cloud) agentsecrets secrets set STRIPE_KEY=sk_live_... # Set multiple secrets agentsecrets secrets set STRIPE_KEY=sk_live_... OPENAI_KEY=sk-proj-...

The value goes directly to the OS keychain for the active environment. It is never written to disk in plaintext and never sent to the AgentSecrets server in plaintext.

If you already have a .env file, import it directly in bulk:

agentsecrets secrets push # Reads from .env or .env.development # Encrypts locally, uploads ciphertext # You can delete the .env file after this

Confirm what’s stored (key names only, values are never displayed):

agentsecrets secrets list

5Authorize your domains

Before making any proxy calls, tell AgentSecrets which API domains your project is allowed to reach. The allowlist is deny-by-default: calls to unauthorized domains are blocked before the secret is even resolved from the keychain.

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

Verify:

agentsecrets workspace allowlist list

This step is required. The proxy will return a 403 for any domain not on the allowlist, regardless of whether a matching secret exists. This is intentional — the domain check happens before secret resolution.

Allowlist changes require admin role and password confirmation.

6Connect your AI tools & Python Code

Connect AgentSecrets to your AI assistant, Python scripts, or custom backend services.

Use official client libraries (such as openai or stripe) directly with zero plaintext secrets in RAM:

import openai from agentsecrets import init, credential # 1. Initialize interception once init() # 2. Use official SDK with zero-knowledge credential placeholder client = openai.OpenAI(api_key=credential.OPENAI_API_KEY) response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Hello!"}] )

7Start the proxy

agentsecrets proxy start

Check status:

agentsecrets proxy status

Stop when done:

agentsecrets proxy stop

The proxy runs in the background at localhost:8765. It resolves credential values from the OS keychain and injects them at the transport layer. Your code sends key names. Values never cross into your process.


8Make your first authenticated call

Use agentsecrets call to make a one-shot authenticated request. Your agent provides the key name; the proxy resolves the value from the keychain and injects it into the outbound request.

agentsecrets call \ --url https://api.stripe.com/v1/balance \ --bearer STRIPE_KEY

Output:

HTTP 200 {"object":"balance","available":[{"amount":10000,"currency":"usd",...}]}

What was sent to Stripe: Authorization: Bearer sk_live_51H... What you (or your agent) saw: the API response only.

Theagentsecrets call command supports multiple injection styles. See injection-styles for the full reference.


9Check the audit log

Every call is logged with the key name, endpoint, agent identity, status, and duration. No value field exists in the schema.

# Check what was logged — key names, endpoints, status codes. No value field. agentsecrets proxy logs --last 5

Output:

TIME RESULT METHOD URL KEY AUTH STATUS REASON DURATION 14:23:01 * OK GET api.stripe.com/v1/balance STRIPE_KEY bearer 200 - 245ms

You can also tail the log in real time or filter by agent:

agentsecrets proxy logs --watch agentsecrets logs list --agent my-billing-agent

Verify everything is working

agentsecrets status

Expected output:

Logged in as: you@example.com Session: Active (expires 5 hours from now) Refresh Token: Available Selected Workspace: your Workspace (workspace type) Environment: development (from project.json) Current Project: project (in project's Workspace) Secrets: 9 synced (0 unsynced) Activity: Last Push: 2 mins ago | Last Pull: Never

If the proxy is not running, start it with agentsecrets proxy start. If you are not logged in, run agentsecrets init.

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