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
CLI ReferenceSecrets

Managing Secrets

AgentSecrets manages your credentials using a secure hierarchy of Workspaces, Projects, and Environments (development, staging, production). Under the hood, secrets are stored in the local OS Keychain via keychain-auth and automatically synchronized to the cloud using end-to-end zero-knowledge encryption.


Core Principles

  1. Zero Plaintext Disk Storage: Secrets are never written to project files or general configuration files on disk. They live securely inside the native OS Keychain.
  2. Automatic Zero-Knowledge Cloud Sync: When you set a secret with agentsecrets secrets set, it is saved locally to your OS Keychain and automatically encrypted client-side and synchronized to the cloud. Teammates and your other machines receive updates seamlessly.
  3. Scoping by Environment: Every secret is scoped to a specific project and environment. This ensures your AI agent in development cannot accidentally access staging or production credentials.
  4. No Plaintext Retrieval (get): In accordance with the Zero-Knowledge principle, secret values are never displayed back in terminal plaintext. They are only injected into authenticated outbound proxy requests (agentsecrets call / Python SDK) or spawned process memory (agentsecrets env).

Basic CLI Operations

1Setting a Secret (Automatic Local + Cloud Sync)

When you set a secret, AgentSecrets writes it to the local OS Keychain and immediately encrypts and pushes the ciphertext blob to the cloud backend:

agentsecrets secrets set STRIPE_KEY=sk_test_51...

To set a secret across all environments simultaneously:

agentsecrets secrets set STRIPE_KEY=sk_test_51... --all-envs

Note: Modifying secrets in the production environment or using --all-envs requires local account password verification.

2Listing Secret Keys

To view all configured secret keys in the active project and environment:

agentsecrets secrets list # Or shortcut alias: agentsecrets list-secrets

This command lists key names and cross-environment coverage status, but never displays secret values.

3Deleting a Secret

To delete a secret from the active environment:

agentsecrets secrets delete STRIPE_KEY # Or shortcut alias: agentsecrets delete-secrets STRIPE_KEY

Bulk Synchronization & Migration

While individual secret changes via secrets set and secrets delete are synced automatically, bulk commands are available for initial project setup and multi-machine sync:

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