Show HN: OneCLI – OSS credential gateway that keeps secrets out of AI agents

Hacker News Top Tools

Summary

OneCLI is an open-source credential gateway that injects secrets into AI agent requests transparently, keeping API keys hidden from the agents.

hey HN, Jonathan and Guy here, creators of OneCLI (<a href="https:&#x2F;&#x2F;onecli.sh&#x2F;">https:&#x2F;&#x2F;onecli.sh&#x2F;</a>). OneCLI is an open source vault for AI Agents.<p>Traditional vaults are used to store your secrets and, on demand, provide them to you all in a secure way, trusting the person to keep them safe. We figured that in the agent&#x27;s world, this is not the case, as you don&#x27;t know what happens with the secret after it&#x27;s delivered to the agent, or where it was saved. Or maybe someone even manipulated them to hand them over...<p>From that understanding, we decided to build a network gateway that sits between your AI agents and the services they call. OneCLI matches the request by host&#x2F;path, verifies the agent should have access, swaps the placeholder for the real credential, and forwards the request. the secrets set inside the OneCLI vault, encrypted on rest, or could fetch in realtime from your bitwarden &#x2F; 1password wallets.<p>Demo - <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=5e5pbPEzZfY" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=5e5pbPEzZfY</a>.<p>We started working on this by accident, even though our careers were in the security space. We were working on a devtool called ChartDB, an open-source DB tool. When OpenClaw took off back in January, we started using it to orchestrate agents on top of ChartDB. We quickly understood there is a big issue around auth. Agents need credentials to do real work, but to give them those secrets would not be the best idea. they keep them in their memory and also write them down to local files and their sessions as plain text. And we knew that agents can easily be fooled into giving up those API keys&#x2F;secrets. So we needed some way to control the agent and stop prompt injections from tricking it into using its services for an attacker&#x27;s benefit. Not providing the keys to the agent + adding alerts or human-in-the-loop for sensitive operations, in case someone manipulates the agent, and access logs are being audited.<p>We use it ourselves daily. My OpenClaw runs my day across Attio, Gmail, and my calendar, with human-in-the-loop approval on sensitive actions. The approval is enforced at the network layer, so it holds whether the agent goes through MCP, CLI, curl, or code it wrote on the fly. Guy uses it to review PRs but can&#x27;t merge without his approval.<p>Companies mostly use it for coding agents currently, which get creative about finding ways to elevate their permissions to reach the goal. With OneCLI, it doesn&#x27;t matter what the agent finds: if the request isn&#x27;t in policy, it will not go through.<p>The proxy is written in Rust, the dashboard is Next.js, and secrets are AES-256-GCM encrypted at rest. Everything runs in a Docker container. It works with any agent framework (Claude Code, Codex, Cursor, OpenClaw, Hermes or anything that can set an HTTPS_PROXY).<p>It won&#x27;t stop an agent from misusing access it legitimately has, so scope policies tightly!<p>happy to answer anything. We believe we can&#x27;t trust the model to behave and have to set deterministic rules to stay in control. Comments welcome!
Original Article
View Cached Full Text

Cached at: 07/24/26, 05:02 AM

onecli/onecli

Source: https://github.com/onecli/onecli

OneCLI

The secret vault for AI agents.
Store once. Inject anywhere. Agents never see the keys.

Website · Docs · Discord


How OneCLI works

What is OneCLI?

OneCLI is an open-source gateway that sits between your AI agents and the services they call. Instead of baking API keys into every agent, you store credentials once in OneCLI and the gateway injects them transparently. Agents never see the secrets.

Why we built it: AI agents need to call dozens of APIs, but giving each agent raw credentials is a security risk. OneCLI solves this with a single gateway that handles auth, so you get one place to manage access, rotate keys, and see what every agent is doing.

How it works: You store your real API credentials in OneCLI and give your agents placeholder keys (e.g. FAKE_KEY). When an agent makes an HTTP call through the gateway, the OneCLI gateway matches the request to the right credentials, swaps the FAKE_KEY for the REAL_KEY, decrypts them, and injects them into the outbound request. The agent never touches the real secrets. It just makes normal HTTP calls and the gateway handles the swap.

Architecture

OneCLI Architecture
  • Rust Gateway: fast HTTP gateway that intercepts outbound requests and injects credentials. Agents authenticate with access tokens via Proxy-Authorization headers.
  • Web Dashboard: Next.js app for managing agents, secrets, and permissions. Provides the API the gateway uses to resolve which credentials to inject for each request.
  • Secret Store: AES-256-GCM encrypted credential storage. Secrets are decrypted only at request time, matched by host and path patterns, and injected by the gateway as headers or URL query parameters.

Quick Start

The fastest way to run OneCLI locally:

curl -fsSL https://onecli.sh/install | sh

Or, if you prefer to run it manually:

git clone https://github.com/onecli/onecli.git
cd onecli
docker compose -f docker/docker-compose.yml up -d --wait

Open http://localhost:10254, create an agent, add your secrets, and point your agent’s HTTP gateway to localhost:10255.

The Quick Start runs OneCLI in local mode (single-user, no login), so no .env or NEXTAUTH_SECRET is required. To enable Google OAuth for multiple users, set NEXTAUTH_SECRET and the Google credentials (see Configuration).

Features

  • Transparent credential injection: agents make normal HTTP calls, the gateway handles auth
  • Encrypted secret storage: AES-256-GCM encryption at rest, decrypted only at request time
  • Host & path matching: route secrets to the right API endpoints with pattern matching
  • Multi-agent support: each agent gets its own access token with scoped permissions
  • Easy setup: curl -fsSL https://onecli.sh/install | sh starts everything (app + PostgreSQL)
  • Two auth modes: single-user (no login) for local use, or Google OAuth for teams
  • Rust gateway: fast, memory-safe HTTP gateway with MITM interception for HTTPS
  • Vault integration: connect Bitwarden (or other password managers) for on-demand credential injection without storing secrets on the server

Project Structure

apps/
  web/            # Next.js app (dashboard + API, port 10254)
  gateway/        # Rust gateway (credential injection, port 10255)
packages/
  db/             # Prisma ORM + migrations
  ui/             # Shared UI components (shadcn/ui)
docker/
  Dockerfile      # App image (gateway + web)
  docker-compose.yml

Local Development

Prerequisites

  • mise (installs Node.js, pnpm, and other tools)
  • Rust (for the gateway)
  • Docker (for PostgreSQL)

Setup

mise install
pnpm install
cp .env.example .env
pnpm db:generate
pnpm db:up          # Start PostgreSQL
pnpm db:migrate     # Apply migrations
pnpm dev

Dashboard at http://localhost:10254, gateway at http://localhost:10255.

Commands

CommandDescription
pnpm devStart web + gateway in dev mode
pnpm buildProduction build
pnpm checkLint + types + format
pnpm db:upStart PostgreSQL (Docker)
pnpm db:downStop PostgreSQL
pnpm db:generateGenerate Prisma client
pnpm db:migrateRun database migrations
pnpm db:studioOpen Prisma Studio

Configuration

All environment variables are optional for local development:

VariableDescriptionDefault
DATABASE_URLPostgreSQL connection stringSee .env.example
NEXTAUTH_SECRETEnables Google OAuth (multi-user)Single-user mode
GOOGLE_CLIENT_IDGoogle OAuth client ID—
GOOGLE_CLIENT_SECRETGoogle OAuth client secret—
SECRET_ENCRYPTION_KEYAES-256-GCM encryption keyAuto-generated

Contributing

We welcome contributions! Please read our Contributing Guide and Code of Conduct before getting started.

License

Apache-2.0

Similar Articles

OneCLI

Product Hunt

OneCLI provides a secured and sandboxed professional assistant agent for employees to enhance productivity.