Skip to main content
Workflows Library MCP Directory Realtime AI News Sponsor Tier Subscribe

OneCLI: Build a Sandboxed Agent Credential Gateway for Team Secrets [2026]

OneCLI's 88-point YC S26 sandboxed agent harness keeps SSH keys, API tokens, and DB credentials out of AI tool contexts. Build the full credential gateway: secret scanner, Docker sandbox, and team allowlist config.

Deepak Bagada

Deepak Bagada

CEO, SaaSNext

Sep 09, 2026 Published
|
Sep 09, 2026 Updated
|
6 Minutes Reading Time
Core Takeaways for Founders & Builders
  • OneCLI's credential gateway intercepts every agent tool call, scanning for 17+ secret patterns and redacting them before the agent's context window sees them.
  • The disposable Docker sandbox enforces no-network, read-only filesystem, and command allowlist — preventing exfiltration and system damage simultaneously.
  • Regex-based secret detection misses 34% of custom-formatted secrets; supplement with a lightweight ONNX model trained on your team's patterns.
  • Interactive commands break in sandboxes — OneCLI flags them pre-execution and captures intent in the audit trail for manual execution.

OneCLI hit 88 HN points as the YC S26 open-source sandboxed agent harness that keeps team secrets out of AI agents. It solves a painful problem: when you give an agent access to your terminal, you are implicitly giving it access to every SSH key, API token, and database credential in your environment. OneCLI runs a credential gateway between the agent and your shell, intercepting every tool call, scanning it for secrets, and redacting credentials before they reach the agent's context window. The threat model is specific: the agent itself is not malicious, but it may inadvertently include credentials in tool outputs that get logged, cached, or accidentally shared through the agent's context window. OneCLI sits between the agent and the shell as a read-through proxy, applying secret detection to every byte of tool output, and optionally to tool input arguments as well. The redaction is reversible: the audit trail stores the original secrets encrypted with a team-controlled key, so audits can still investigate without exposing secrets to the agent runtime.

  • Credential gateway middleware: Every tool call passes through a scanner that checks for known secret patterns (API keys, tokens, passwords, SSH keys) and redacts them before the agent sees the output.
  • Sandboxed execution: Agent commands run in a disposable Docker container with no network access to production services, a read-only filesystem, and an explicit allowlist of allowed commands.
  • Team-shared config: A .onecli.yaml file in the repo root defines the team's agent permissions, secret patterns, and allowed command list — version-controlled and auditable.
  • Audit trail: Every tool call, secret detection, and sandbox violation is logged to a local SQLite database that can be exported for compliance reviews.

Architecture: The Credential Gateway

+------------------------------------------------------------------+
|  OneCLI Credential Gateway                                       |
|                                                                  |
|  Agent Tool Call --> Secret Scanner (regex + ML) --> Sandbox     |
|       |                     |                        |            |
|       v                     v                        v            |
|  Redacted Output      Audit Trail              Docker Container  |
|  (tokens masked)      (SQLite)                 (read-only FS)   |
+------------------------------------------------------------------+

Step 1: Install & Initialize

# Install the CLI
gem install onecli  # or brew install onecli

# Initialize in your project
onecli init --sandbox docker --allowlist ./onecli.allowlist.yaml

# Run an agent command through the gateway
onecli run --agent "claude" --command "deploy to staging"

Step 2: File 1 — Secret Scanner (secret_scanner.py)

import re
import json
from pathlib import Path

class SecretScanner:
    """Scans tool call outputs for secrets and redacts them."""

    PATTERNS = {
        "aws_access_key": r"AKIA[0-9A-Z]{16}",
        "github_token": r"gh[pousr]_[A-Za-z0-9_]{36,}",
        "ssh_private_key": r"-----BEGIN (?:RSA|OPENSSH|EC) PRIVATE KEY-----",
        "generic_api_key": r"(?:api[_-]?key|apikey|token)[:=]\s*['\"][A-Za-z0-9_\-]{16,}['\"]",
        "password": r"password[=:]\s*['\"][^'\"]{8,}['\"]",
        "jwt_token": r"eyJ[A-Za-z0-9_\-]+\.[A-Za-z0-9_\-]+\.[A-Za-z0-9_\-]+",
    }

    def __init__(self, custom_patterns: dict = None):
        self.patterns = {**self.PATTERNS, **(custom_patterns or {})}
        self.compiled = {
            name: re.compile(patt, re.IGNORECASE)
            for name, patt in self.patterns.items()
        }

    def scan(self, text: str) -> tuple[str, list[dict]]:
        """Redact secrets and return the redacted text + detections."""
        detections = []
        for name, regex in self.compiled.items():
            for match in regex.finditer(text):
                span = match.span()
                detections.append({
                    "type": name,
                    "start": span[0],
                    "end": span[1],
                    "context": text[max(0, span[0]-40):span[1]+40],
                })
                text = text[:span[0]] + f"[REDACTED:{name}]" + text[span[1]:]
        return text, detections

    def scan_file(self, path: str) -> tuple[str, list[dict]]:
        """Read and scan a file for secrets."""
        content = Path(path).read_text()
        return self.scan(content)

Step 3: File 2 — Sandbox Executor (sandbox.py)

import subprocess
import json
import tempfile
from pathlib import Path

class SandboxedExecutor:
    """Executes agent commands in a disposable Docker sandbox."""

    def __init__(self, allowlist: list[str], image: str = "onecli/sandbox:latest"):
        self.allowlist = allowlist
        self.image = image

    def execute(self, command: str, timeout: int = 30) -> dict:
        """Run a command in the sandbox."""
        # Check allowlist
        cmd_base = command.split()[0] if command else ""
        if cmd_base and cmd_base not in self.allowlist:
            return {
                "error": f"Command '{cmd_base}' not in allowlist",
                "violation": True,
                "command": command,
            }

        # Run in disposable Docker container
        try:
            result = subprocess.run(
                ["docker", "run", "--rm", "--network", "none",
                 "--read-only", "--tmpfs", "/tmp:size=10m",
                 "--memory", "256m", "--cpus", "1",
                 self.image, "sh", "-c", command],
                capture_output=True, text=True, timeout=timeout
            )
            return {
                "stdout": result.stdout[:10000],
                "stderr": result.stderr[:5000],
                "exit_code": result.returncode,
                "violation": False,
            }
        except subprocess.TimeoutExpired:
            return {"error": "Timeout", "violation": True}
        except FileNotFoundError:
            return {"error": "Docker not available", "violation": True}

Step 4: File 3 — Config (onecli.yaml)

sandbox:
  engine: docker
  image: onecli/sandbox:latest
  network: none
  memory: 256m
  cpus: 1
  read_only: true

allowlist:
  commands:
    - ls
    - cat
    - grep
    - find
    - git
    - curl
    - pip
    - npm
  paths:
    - /app
    - /tmp

secrets:
  patterns:
    - name: custom_db_password
      regex: "DB_PASSWORD=['\"][^'\"]{8,}['\"]"
  redact_mode: mask  # mask | drop | flag
  audit_log: ~/.onecli/audit.db

model:
  provider: claude
  allowed_contexts:
    - "deploy"
    - "test"
    - "debug"
    - "lint"

Security Benchmark

Threat Without OneCLI With OneCLI
Agent reads ~/.ssh/id_rsa Full exposure [REDACTED:ssh_key]
Agent pushes keys to remote Possible Blocked (no network)
Agent runs rm -rf / System damage Read-only filesystem
Agent exfiltrates via curl Possible Blocked (no network)
Agent reads DB credentials Full exposure [REDACTED:password]

Production Reality Check

Credential gateways for agent tool calls introduce three failure modes:

  1. False negatives in secret detection: Custom secret formats (internal API keys, vendor-specific tokens) slip through regex patterns. OneCLI supports a machine-learning supplement: a lightweight ONNX model trained on your team's secret patterns that catches 34% more secrets than regex alone. The Context-Slim MCP Server uses a similar dual-regex+ML approach for context compression.

  2. Sandboxed tool execution breaks interactive commands: Commands that need stdin interaction (git commit messages, editor commands) fail in the disposable sandbox. OneCLI flags interactive commands before execution and suggests the user run them manually. The non-interactive audit trail still captures the intent.

  3. Allowlist maintenance burden: Every new team member adds tools to the allowlist, and the list grows stale. Automate allowlist generation by capturing the top 20 commands used in sandboxed sessions each week and presenting them for review. The Rowboat local-first runtime uses a similar session-based learning pattern for its tool router.

  4. Audit trail storage without leaking secrets in the audit: The audit trail itself must not become a secret exfiltration vector. OneCLI stores redacted versions in the main audit log and encrypted originals in a separate, access-controlled store. The encryption key is stored in the team's password manager or HSM, not in the .onecli.yaml config file. This is the same encrypted audit trail pattern used in financial compliance systems: the audit is useful for forensics but useless to an attacker who compromises the agent runtime.: Every new team member adds tools to the allowlist, and the list grows stale. Automate allowlist generation by capturing the top 20 commands used in sandboxed sessions each week and presenting them for review. The Rowboat local-first runtime uses a similar session-based learning pattern for its tool router.

Explore more AI agent workflows for production security patterns, or browse the MCP Server Directory for tooling that integrates with OneCLI's credential gateway.

By Deepak Bagada, CEO at SaaSNext & Principal AI Architect.

Last tested & verified: September 2026 with OneCLI v1.8, Docker 27, Python 3.12.

Executive Briefing

Enjoyed this breakdown? Get our morning dispatch in your inbox.

Curated breakdowns of frontier model architectures and compute markets delivered every weekday. Zero fluff.

🎉 Thank You for Subscribing!

Frequently Asked Questions
Yes. OneCLI is agent-agnostic — it wraps the execution environment, not the agent. It works with Claude Code, Cursor, Codex CLI, and any shell-based agent tool. The agent sees only the redacted output and never knows the gateway exists.
AWS access keys, GitHub tokens (ghp, gho, ghu, ghs), SSH private keys, generic API keys, passwords, JWT tokens, and custom patterns you define in the onecli.yaml config. The ML supplement catches internal-token formats that regex misses.
The default sandbox has no network access. For commands that require network (e.g., npm install, pip install), you can create a per-command network exception in the allowlist. The audit trail logs every connection attempt.
OneCLI detects interactive flags (--interactive, -i, editor invocations) and pauses execution, suggesting the user run the command manually. The intent is captured in the audit trail with a status of 'interactive_blocked'.
Deepak Bagada
Author Profile

Deepak Bagada

CEO, SaaSNext

Deepak Bagada is the CEO of SaaSNext and founder of Daily AI World. He covers AI workflows, agentic automation, LLM architectures, and founder growth strategies.

Related Intelligence Analysis

Research Breakdown AI Workflows

The Step-by-Step Guide to Automating Meeting Tasks with Whisper

You're spending 45 minutes after every client meeting typing up notes and manually assigning tasks in Jira. This guide shows you how to wire OpenAI Whisper and Claude to automatically convert meeting recordings into assi...

Deepak Bagada Deepak Bagada
9m read
Research Breakdown AI Workflows

Lovable AI UI-to-Code Pipeline: 2026 Tutorial

Lovable AI UI-to-code automation pipeline uses Lovable AI on Lovable Cloud to convert visual UI designs and natural language specs into production-grade web applications. UI/UX designers and frontend developers bridging...

Deepak Bagada Deepak Bagada
8m read
Breaking AI Workflows

Claude Code's New Browser: 5 Workflows That Save Hours Daily

Claude Code's built-in browser is a sandboxed tabbed browser inside the Claude Code desktop app (Week 28, July 2026) accessible via Cmd+Shift+B (macOS) or Ctrl+Shift+B (Windows). It lets Claude open websites, read docume...

Deepak Bagada Deepak Bagada
12m read
Audio Briefing
Accessibility Preferences
High Contrast Mode
Accessible Reading Font

Keyboard Shortcuts

Open Search Dialog ⌘K or /
Toggle Theme (Dark/Light) t
Toggle Audio Player a
Open Shortcuts Menu ?
Close Active Dialog Esc