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 CloudWorkload & Agent Tokens

Workload & Agent Tokens

Workload Tokens (prefixed with agt_prod_... or agt_dev_...) are cryptographically signed, capability-scoped credentials used by production containers, CI/CD pipelines, and autonomous AI agents to authenticate against AgentSecrets Cloud.


Cryptographic Structure

Workload tokens are high-entropy cryptographic strings:

agt_prod_7f8a9b2c3d4e5f6a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a └──┬──┘ └──────────────────────────────────┬─────────────────────────────────┘ Prefix 256-bit Cryptographic Entropy
  • agt_prod_...: Scoped to production environments.
  • agt_dev_...: Scoped to development and staging environments.

Tokens are hashed using SHA-256 before persistence in the control plane database. The raw token is displayed only once upon creation.


Least-Privilege Capability Scopes

Workload tokens enforce granular capability boundaries to prevent over-privileged access:

Permission ScopeTypeEnforcement Behavior
can_env_readbooleanGrants access to retrieve project environment secrets via POST /api/workloads/env/ (used by agentsecrets env).
can_proxy_resolvebooleanGrants permission to resolve placeholder handles via Cloud Resolver (POST /v1/resolve or proxy :8765).
allowed_domainsstring[]Restricts outbound calls to specific target hostnames (e.g. ["api.stripe.com", "*.openai.com"]).
allowed_handlesstring[]Restricts resolution to specific secret names (e.g. ["STRIPE_KEY"]).
environmentstringBinds the token strictly to an isolated environment (development, staging, or production).
expires_attimestampOptional timestamp for automatic token invalidation.

Token Issuance Workflows

1Web Dashboard Issuance

  1. Navigate to Workloads & Agents in the AgentSecrets Web App.
  2. Click Issue New Token.
  3. Select target environment (production), configure domain allowlists and secret handles, and generate the token.

2CLI Issuance

# Register an agent and issue its initial token agentsecrets agent register billing-worker --env production # Issue an additional token with a specific label agentsecrets agent token issue billing-worker --env production --label "ecs-task-runner"

Production Deployment Patterns

1Docker & Kubernetes

Provide AGENTSECRETS_TOKEN via environment variables:

# docker-compose.yml services: agent-runner: image: my-org/agent:latest environment: - AGENTSECRETS_TOKEN=agt_prod_7f8a9b2c3d4e... command: ["agentsecrets", "env", "--", "python", "main.py"]

2Cloud Platforms & Secret Managers

Configure AGENTSECRETS_TOKEN in your provider's secret storage:

  • AWS ECS / Fargate / Lambda: Add to Task Definition Secrets.
  • Render / Railway / Fly.io: Set in Environment Variables dashboard.
  • Vercel: Configure under Project Settings -> Environment Variables.
  • GitHub Actions: Store in Repository Secrets (secrets.AGENTSECRETS_TOKEN).

3Programmatic Agent Tool Calling (Python SDK)

When AGENTSECRETS_TOKEN is present in the container environment, the SDK automatically initializes cloud resolution:

from agentsecrets import AgentSecrets, credential secrets = AgentSecrets() response = secrets.call( "https://api.github.com/repos/my-org/backend/issues", method="POST", headers={"Authorization": f"Bearer {credential.GITHUB_TOKEN}"}, body={"title": "Automated system alert"} )

Revocation & In-Memory Eviction

When a workload token is compromised or rotated:

  1. Revoke the token via Web Dashboard or CLI: agentsecrets agent token revoke <token_id>.
  2. The control plane marks the token as revoked and broadcasts an invalidation event.
  3. The Cloud Resolver evicts the SHA-256 token hash from volatile RAM within 2 seconds, immediately terminating subsequent resolution attempts.
Was this helpful?
Thanks for your feedback!
Your feedback helps us improve the platform.