OneCLI: Open-Source Gateway Keeps Real Credentials Out of AI Agents
OneCLI is an open-source Rust proxy that sits between AI agents and target services to inject real API keys dynamically. Agents interact using placeholder tokens, while OneCLI handles AES-256-GCM secret decryption and pattern-based header replacement. This prevents autonomous agent tools from ever exposing or exfiltrating raw credentials.
Impact: High
Why it matters
You can securely give autonomous agents access to dozens of APIs without risking production key leakage.
TL;DR
- 01Store API keys in an encrypted gateway, giving agents placeholder tokens like FAKE_KEY.
- 02Intercept outbound HTTP/HTTPS requests on port 10255 to swap keys transparently by host and path.
- 03Integrate Bitwarden or local secret stores to prevent raw credential disk persistence.
Key facts
- Gateway Port
- 10255
- Dashboard Port
- 10254
- Encryption Standard
- AES-256-GCM
- Auth Modes
- Single-user local, Google OAuth
Zero-Trust Proxy Architecture for Agent Workflows
Giving agentic workflows direct access to production secrets risks credential exfiltration during sandbox escapes or unexpected model behavior. OneCLI shifts authentication responsibility to a fast Rust-based HTTP proxy layer, ensuring agent tools never process raw API keys directly.
Transparent Credential Swap via Host and Path Matching
Instead of hardcoding environment variables, agents configure standard HTTP request calls using dummy access tokens (e.g., FAKE_KEY). When the agent sends a request through localhost:10255, OneCLI intercepts the headers, resolves the host and path pattern, decrypts the true key at runtime, and injects it into outbound headers or URL parameters.
Local-First Deployment with Docker Compose
OneCLI can be deployed locally using a single shell installer or Docker Compose. It includes built-in password manager integration (such as Bitwarden) for fetching keys on demand without storing secrets on disk, alongside optional Google OAuth for multi-developer team environments.
Try it in 2 minutes
curl -fsSL https://onecli.sh/install | sh
# Dashboard: http://localhost:10254
# Rust Gateway Proxy: http://localhost:10255bash
✓ When to use
- Deploying autonomous agents (Claude Code, Cursor agent mode) with access to paid third-party APIs.
- Managing multi-agent environments where granular, per-agent credential scopes are required.
✕ When NOT to use
- Simple local scripts where tool calls do not touch external HTTP APIs.
- Environments where client network traffic cannot be routed through a local HTTP proxy.
What to do today
- Run `curl -fsSL https://onecli.sh/install | sh` to boot the local dashboard and gateway.
- Configure your Claude Code, Cursor, or custom AI agent HTTP proxy settings to point to `http://localhost:10255`.
What the community says
“Oo this is interesting, blocking it on the network level is nice”
“It works great for static credentials... Gateway does the OAuth dance to get the access token, this is quite practical”
Sources