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
CLI Referenceagent (register / list / tokens)

agent

agentsecrets agent register

Registers a new agent identity in the current workspace and issues its first cryptographically signed token.

agentsecrets agent register <name> [flags]

Example

agentsecrets agent register "billing-processor" --project "payments" --env "production" --save-token

CLI Flags

FlagShortTypeDefaultDescription
--project-pstring""Scope the agent identity to a specific project name or ID.
--label-lstring""A human-readable label/description for the initial token.
--expires-estring""Expiry duration for the token (e.g. 30d, 90d, 1y).
--envstringcurrent environmentRestrict token usage to a specific environment (e.g. development, staging, production).
--save-tokenbooleanfalseAutomatically save the issued token directly to your OS Keychain without prompting.
--output-jsonbooleanfalseOutput the registration metadata and token as JSON.

agentsecrets agent list

Lists all registered agent identities in the current workspace.

agentsecrets agent list [flags]

Example

agentsecrets agent list --project "payments"

CLI Flags

FlagShortTypeDefaultDescription
--project-pstring""Filter the agent list to a specific project.
--output-jsonbooleanfalseOutput the list as JSON.

agentsecrets agent delete

Deletes an agent identity registration and permanently revokes all tokens associated with it.

agentsecrets agent delete <name> [flags]

Example

agentsecrets agent delete "billing-processor" --confirm

CLI Flags

FlagShortTypeDefaultDescription
--confirmbooleanfalseSkip the interactive verification prompt.

agentsecrets agent token issue

Issues a new cryptographic token for an existing registered agent. This is useful for rotates, multi-instance deployments, or environment boundaries.

agentsecrets agent token issue <name> [flags]

Example

agentsecrets agent token issue "billing-processor" --label "secondary-node" --expires "90d"

CLI Flags

FlagShortTypeDefaultDescription
--label-lstring""A human-readable label for this specific token.
--expires-estring""Expiry duration for the token (e.g. 30d, 90d).
--envstringcurrent environmentRestrict token usage to a specific environment (e.g. development, staging, production).
--save-tokenbooleanfalseAutomatically save the issued token directly to your OS Keychain without prompting.
--output-jsonbooleanfalseOutput the token metadata as JSON.

agentsecrets agent token list

Lists all active cryptographic tokens issued for a specific agent. For security reasons, the actual raw token values are never shown.

agentsecrets agent token list <name> [flags]

Example

agentsecrets agent token list "billing-processor"

CLI Flags

FlagShortTypeDefaultDescription
--output-jsonbooleanfalseOutput the list as JSON.

agentsecrets agent token revoke

Revokes a specific token by its public Token ID (agt_...), or revokes all tokens for the agent.

agentsecrets agent token revoke [token_id] [flags]

Example

# Revoke a single token agentsecrets agent token revoke agt_ws01hxyz_abc123 --agent "billing-processor" # Revoke all tokens for an agent agentsecrets agent token revoke --all --agent "billing-processor" --confirm

CLI Flags

FlagShortTypeDefaultDescription
--agent-astring""The name of the agent the token belongs to (required).
--allbooleanfalseRevoke all tokens issued for the specified agent.
--confirmbooleanfalseSkip the interactive confirmation prompt.

agentsecrets agent policy get

Retrieves the capability policy for the specified agent, showing whitelisted and blacklisted secret keys.

agentsecrets agent policy get <name>

Example

agentsecrets agent policy get "billing-processor"

agentsecrets agent policy set

Updates the capability policy for the specified agent to restrict which secrets they can access.

agentsecrets agent policy set <name> [flags]

Example

agentsecrets agent policy set "billing-processor" --allow "STRIPE_KEY,DATABASE_URL"

CLI Flags

FlagShortTypeDefaultDescription
--allowstringSlice[]Comma-separated or repeatable list of secret keys the agent is allowed to access (whitelisting).
--denystringSlice[]Comma-separated or repeatable list of secret keys the agent is blocked from accessing (blacklisting).

  • Setting agent policies is a sensitive administrative action. The CLI will prompt you for your workspace/project password to authenticate changes locally before sending them to the control plane.
  • The keys passed to --allow and --deny are validated to ensure they exist within the project context (either locally in the OS keychain or remotely in the environment). If a key doesn't exist, the command fails with a SEC-404 error to prevent granting policies on non-existent secrets.
Was this helpful?
Thanks for your feedback!
Your feedback helps us improve the platform.