OneCLI: Managing AI Agent Secrets from Scratch

DeepWhiz Intermediate 10h ago 111 views 6 likes 2 min read

Giving an LLM agent a raw API key is basically a security gamble. Between prompt injections and the tendency for agents to dump secrets into plain-text session logs or local files, you lose control the moment the key is handed over. I've been looking into ways to decouple credentials from the model's memory, and OneCLI is a solid open-source approach to this.

Instead of the agent holding the key, OneCLI acts as a network gateway. The agent sends a request with a placeholder, and the gateway swaps it for the real credential at the network layer before forwarding it to the service. This means the agent never actually "knows" the secret.

Deployment and Integration

Since the proxy is written in Rust and packaged as a Docker container, getting it running is straightforward. It supports any tool that can configure an HTTPS_PROXY, making it compatible with a wide range of AI workflows:

  • Compatible Tools: Claude Code, Cursor, OpenClaw, or any custom LLM agent.
  • Secret Sourcing: You can store secrets directly in the vault (AES-256-GCM encrypted) or sync them in real-time from 1Password or Bitwarden.
  • Control Layer: You can set up human-in-the-loop approvals. Even if an agent decides it needs to perform a sensitive action, the request is blocked at the proxy level until a human clears it.

Practical AI Workflow Benefits

The real-world value here is preventing "permission creep." Coding agents are notorious for trying to find creative ways to elevate their own permissions to finish a task. By moving the authorization to a deterministic proxy, you stop relying on the model's "behavior" and start relying on hard network policies.

For example, if you're using a deployment agent, you can allow it to trigger a build but require manual approval before it can actually merge a PR or push to production, regardless of what the agent's internal logic thinks.

Technical Trade-offs

  • Performance: The Rust core keeps latency low, but it is still an extra hop in the network path.
  • Scope: It doesn't stop an agent from misusing a permission it actually has. If you give the agent broad access to a database via the proxy, it can still delete tables. Tight scoping of policies is mandatory.

For anyone building a production-grade LLM agent, this is a much safer architecture than the standard "env file" approach.

https://onecli.sh/
AI ProgrammingAI Coding

All Replies (3)

A
AveryPilot Novice 10h ago
Great launch! I've been using Infisical for my projects lately and it's a lifesaver. Just wondering, who is your main target audience—solo hackers, small startups, or bigger enterprises? I'm always happy to see more competition in this space!
0 Reply
J
JulesCrafter Novice 10h ago
Still seems risky. I usually wrap mine in a proxy just to monitor the actual traffic.
0 Reply
J
JordanSurfer Intermediate 10h ago
Had an agent leak my OpenAI key in a log file once. Now I strictly use env vars.
0 Reply

Write a Reply

Markdown supported