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
TroubleshootingKeychain Storage & Backends

Troubleshooting Keychain Storage & keychain-auth

AgentSecrets delegates all secret storage and decryption operations to the keychain-auth security daemon, which communicates directly with your operating system's native secure credential backends.


Supported Storage Backends

PlatformStorage BackendSecurity LayerFallback / Interop
macOSmacOS Keychain (Security.framework)AES-256-GCM via Secure EnclaveProcess hash attestation via LOCAL_PEERPID
Linux (Native)GNOME Keyring / Secret ServiceKernel-verified SO_PEERCREDHardware TPM 2.0 Key Sealing (/dev/tpm0)
WindowsWindows Credential ManagerDPAPI (User-scoped encryption)Named Pipe IPC (\\.\pipe\keychain-auth)
WSL (Linux VM)Windows Host Credential ManagerWSL Host Interop Auto-ExtractionWindows keychain-helper.exe bridge

Common Issues & Diagnoses

1/ Socket Connection Errors

If the CLI reports that it cannot connect to the keychain-auth socket or pipe:

  1. Check daemon status: Run the daemon diagnostic command to check whether the process is alive:

    keychain-auth status --json
  2. Verify socket location and permissions:

    • Linux (System service): Sockets are located at /run/keychain-auth/agent.sock owned by keychain-auth:agentgroup with 0660 permissions. Ensure your user account belongs to the agentgroup group:
      sudo usermod -aG agentgroup $USER
    • macOS: Daemon socket defaults to ~/.config/keychain-auth/agent.sock.
    • Windows: The daemon listens on named pipe \\.\pipe\keychain-auth.
  3. Restart the daemon:

    # Restart daemon via AgentSecrets helper agentsecrets init # Or restart directly on macOS/Linux pkill -x keychain-auth && keychain-auth start &

2WSL (Windows Subsystem for Linux) Setup & Helper Extraction

In WSL environments, running Linux D-Bus services is often unavailable. keychain-auth automatically uses Windows Host Interop:

  • Automatic extraction: On startup, keychain-auth embeds and extracts keychain-helper.exe into your Windows user directory:
    C:\Users\<WindowsUser>\.config\keychain-auth\keychain-helper.exe
  • Testing host interop: Verify from inside WSL that the helper can communicate with the Windows Host Credential Manager:
    /mnt/c/Users/$USER/.config/keychain-auth/keychain-helper.exe version
  • Antivirus / Execution Policy blocks: If Windows Defender or endpoint security blocks the helper execution, add an exclusion for keychain-helper.exe in C:\Users\<WindowsUser>\.config\keychain-auth\.

3Linux Binary Re-Authorization Prompt ()

When you install a new update of agentsecrets or compile from source, its SHA-256 hash changes:

  • Expected behavior: The next command you execute will prompt for authorization to update /etc/keychain-auth/config.json.
  • Manual re-authorization:
    sudo keychain-auth authorize $(which agentsecrets) AgentSecrets

4Secret Compound Key Namespaces

Secrets in the OS Keychain are stored with compound namespace identifiers to prevent cross-project or cross-environment collision:

workspace_id:project_id:environment:key_name

For example, STRIPE_KEY in the production environment of project proj_payments in workspace ws_acme is stored as:

ws_acme:proj_payments:production:STRIPE_KEY

Switching environments via agentsecrets environment switch staging switches which compound key namespace is read. There is zero risk of a staging secret being resolved during a production deployment.

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