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
IntegrationsHTTP Proxy (Any)

HTTP Proxy Integration

The most universal way to integrate AgentSecrets into any codebase—regardless of language or framework—is by routing your standard API calls through the AgentSecrets local proxy.

The proxy runs locally on http://localhost:8765 and acts as a transport-layer injector.


Standard Request Format

To route a request through the proxy, you modify three parts of your standard HTTP call:

  1. Change the actual request URL to http://localhost:8765/proxy.
  2. Provide the destination URL in the X-AS-Target-URL header.
  3. Provide the key reference in an injection header (e.g., X-AS-Inject-Bearer).

Client Code Examples

cURL

curl -X POST http://localhost:8765/proxy \ -H "X-AS-Target-URL: https://api.stripe.com/v1/charges" \ -H "X-AS-Inject-Bearer: STRIPE_KEY" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "amount=2000&currency=usd"

Python (Requests)

import requests response = requests.post( "http://localhost:8765/proxy", headers={ "X-AS-Target-URL": "https://api.stripe.com/v1/charges", "X-AS-Inject-Bearer": "STRIPE_KEY", "Content-Type": "application/x-www-form-urlencoded" }, data={"amount": 2000, "currency": "usd"} ) print(response.json())

Node.js (Fetch)

const response = await fetch("http://localhost:8765/proxy", { method: "POST", headers: { "X-AS-Target-URL": "https://api.stripe.com/v1/charges", "X-AS-Inject-Bearer": "STRIPE_KEY", "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ amount: 2000, currency: "usd" }) }); const data = await response.json();

Go (net/http)

package main import ( "net/http" "strings" ) func main() { body := strings.NewReader("amount=2000&currency=usd") req, _ := http.NewRequest("POST", "http://localhost:8765/proxy", body) req.Header.Set("X-AS-Target-URL", "https://api.stripe.com/v1/charges") req.Header.Set("X-AS-Inject-Bearer", "STRIPE_KEY") req.Header.Set("Content-Type", "application/x-www-form-urlencoded") client := &http.Client{} resp, _ := client.Do(req) // Process response... }

Customizing Injection

AgentSecrets supports multiple injection methods depending on what the upstream API expects. See the Injection Styles Reference for details on:

  • X-AS-Inject-Header: <HeaderName> <KeyName> (Custom header injection)
  • X-AS-Inject-Query: <ParamName> <KeyName> (URL query parameter injection)
  • X-AS-Inject-Basic: <Username> <PasswordKey> (Basic authentication)
Was this helpful?
Thanks for your feedback!
Your feedback helps us improve the platform.