<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Horizon Flow</title>
    <description>The latest articles on DEV Community by Horizon Flow (@horizonflowlive).</description>
    <link>https://dev.to/horizonflowlive</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3766647%2F7954079e-5481-4da6-8e9b-14714a25a7f8.png</url>
      <title>DEV Community: Horizon Flow</title>
      <link>https://dev.to/horizonflowlive</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/horizonflowlive"/>
    <language>en</language>
    <item>
      <title>Your AI Agent's API Keys Are Probably in Plaintext Right Now</title>
      <dc:creator>Horizon Flow</dc:creator>
      <pubDate>Wed, 11 Feb 2026 15:12:46 +0000</pubDate>
      <link>https://dev.to/horizonflowlive/your-ai-agents-api-keys-are-probably-in-plaintext-right-now-2g0e</link>
      <guid>https://dev.to/horizonflowlive/your-ai-agents-api-keys-are-probably-in-plaintext-right-now-2g0e</guid>
      <description>&lt;p&gt;Every major AI agent framework stores API keys the same way: plaintext in a .env file or config YAML. OpenClaw, LangChain, AutoGPT, CrewAI — pick one. Your keys sit on disk, unencrypted, readable by any process, and one leaked log, bad plugin, or prompt injection away from exposure.&lt;/p&gt;

&lt;p&gt;I built Vault-0 to fix this for my own OpenClaw agents. It's open source, runs locally, and never sends secrets anywhere.&lt;/p&gt;

&lt;p&gt;The Core Problem&lt;/p&gt;

&lt;p&gt;When you set up a ClawBot agent, the onboarding flow asks for your OpenAI key, Anthropic key, and whatever else your agent needs. Those get written to ~/.openclaw/.env. From that point on, they exist in plaintext on your disk indefinitely.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;p&gt;Any process running as your user can read them&lt;br&gt;
A prompt injection that triggers a file-read tool can exfiltrate them&lt;br&gt;
A verbose logging config can print them to stdout&lt;br&gt;
A malicious MCP plugin can access them directly&lt;br&gt;
This isn't theoretical. Agent frameworks are designed to give LLMs tool access. Tools read files. Files contain keys.&lt;/p&gt;

&lt;p&gt;How Vault-0 Solves It&lt;br&gt;
Secrets are encrypted in a local vault using AES-256-GCM with Argon2id key derivation. Your master passphrase (12+ characters) derives the encryption key. The vault file lives at ~/Library/Application Support/Vault0/vault.enc — it's unreadable without the passphrase.&lt;/p&gt;

&lt;p&gt;When you launch your agent through Vault-0, the flow is:&lt;/p&gt;

&lt;p&gt;Vault-0 decrypts your secrets in memory&lt;br&gt;
Writes an ephemeral .env to ~/.openclaw/.env&lt;br&gt;
Restarts the OpenClaw daemon so it reads the file&lt;br&gt;
Waits ~2 seconds for the process to load&lt;br&gt;
Zeros the .env (replaces contents with a comment)&lt;br&gt;
Keys exist on disk for roughly 2 seconds. After that, the daemon has them in memory and the file is clean. The entire process runs in Rust.&lt;/p&gt;

&lt;p&gt;Why Not a Vault API?&lt;br&gt;
Tools like HashiCorp Vault or Doppler expect your application to call an API to fetch secrets at runtime. AI agent frameworks don't support this. They read .env at boot and that's it. You'd have to fork the framework to add vault integration.&lt;/p&gt;

&lt;p&gt;The ephemeral .env approach works with the framework as-is. No upstream changes required.&lt;/p&gt;

&lt;p&gt;Policy Engine&lt;br&gt;
Vault-0 also runs a local proxy on 127.0.0.1:3840 that enforces security policies on outbound requests. Policies are YAML-based and support:&lt;/p&gt;

&lt;p&gt;Domain allow/block lists — restrict which APIs your agent can call&lt;br&gt;
HTTP method restrictions — block DELETE or PUT if your agent shouldn't modify resources&lt;br&gt;
Output redaction — regex patterns that strip sensitive values from response bodies before they reach your agent&lt;br&gt;
x402 spend caps — limit how much your agent can auto-pay per 402 settlement&lt;br&gt;
Auto-settle rules — control whether 402 Payment Required responses are handled automatically&lt;br&gt;
Example policy:&lt;/p&gt;

&lt;p&gt;allow_domains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;api.openai.com&lt;/li&gt;
&lt;li&gt;api.anthropic.com
block_domains:&lt;/li&gt;
&lt;li&gt;internal.corp.net
output_redact_patterns:&lt;/li&gt;
&lt;li&gt;"sk-[a-zA-Z0-9]{20,}"
spend_cap_cents: 500
auto_settle_402: true
MCP Hardening
If your agent uses MCP (Model Context Protocol) tools, Vault-0 adds three protections:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Origin allowlist — only approved MCP server origins can be contacted&lt;br&gt;
SSRF blocking — requests to private/internal IPs (127.x, 10.x, 192.168.x) are rejected&lt;br&gt;
Token passthrough disabled — the proxy never forwards your client authorization tokens to MCP servers&lt;br&gt;
MCP is powerful but it expands your agent's attack surface significantly. These controls reduce that surface without disabling MCP entirely.&lt;/p&gt;

&lt;p&gt;Evidence Ledger&lt;br&gt;
Every policy decision, proxied request, and payment event is logged to a SHA-256 chained evidence ledger. Each entry includes a timestamp, event type, detail string, and a hash of the previous entry — making the log tamper-evident.&lt;/p&gt;

&lt;p&gt;You can export receipts from the dashboard and trace exactly what your agent did, when it did it, and which policy allowed or blocked it.&lt;/p&gt;

&lt;p&gt;x402 Payment Support&lt;br&gt;
Vault-0 includes native handling for the x402 payment protocol. When an upstream API returns HTTP 402 Payment Required:&lt;/p&gt;

&lt;p&gt;Vault-0 parses the payment intent (amount, recipient, network)&lt;br&gt;
Signs a payment authorization using EIP-3009 (TransferWithAuthorization) with your on-device EVM wallet&lt;br&gt;
Retries the request with an X-PAYMENT header containing the signed payload&lt;br&gt;
Logs the settlement to the evidence ledger&lt;br&gt;
Your wallet's BIP-39 mnemonic is stored in macOS Keychain — it never leaves the Keychain and never touches the webview layer.&lt;/p&gt;

&lt;p&gt;Tech Stack&lt;br&gt;
Frontend: Tauri 2 + Svelte 4 + Tailwind CSS&lt;br&gt;
Backend: Rust (Axum proxy, aes-gcm vault, argon2 KDF, alloy EVM signer)&lt;br&gt;
Terminal: xterm.js + tauri-plugin-pty (embedded terminal for OpenClaw CLI)&lt;br&gt;
Key storage: macOS Keychain via the keyring crate&lt;br&gt;
Binary size: ~15MB. No Electron.&lt;br&gt;
What's Not Done Yet&lt;br&gt;
Being transparent about current limitations:&lt;/p&gt;

&lt;p&gt;Spend tracking — the policy field for spend caps exists, but per-request cost tracking isn't implemented yet. Caps are only enforced at x402 auto-settlement time.&lt;br&gt;
Wallet balance — get_wallet_balance() returns hardcoded zeros. No RPC calls to fetch real on-chain USDC balance yet.&lt;br&gt;
Payment history — get_payment_history() returns an empty list. Pending payments are tracked but historical records aren't persisted.&lt;br&gt;
Platform support — macOS only for v1.0. Keychain integration requires macOS 12+.&lt;br&gt;
Agent frameworks — only OpenClaw is supported. The ephemeral .env pattern could work for other frameworks but the detection/migration flow is OpenClaw-specific.&lt;br&gt;
Getting Started&lt;br&gt;
git clone &lt;a href="https://github.com/0-Vault/Vault-0.git" rel="noopener noreferrer"&gt;https://github.com/0-Vault/Vault-0.git&lt;/a&gt;&lt;br&gt;
cd Vault-0&lt;br&gt;
npm install&lt;br&gt;
cargo tauri dev&lt;br&gt;
The guided setup will detect your OpenClaw installation, scan for plaintext keys, and walk you through migrating them into the encrypted vault.&lt;/p&gt;

&lt;p&gt;Links&lt;br&gt;
Repo: &lt;a href="https://dev.tourl"&gt;github.com/0-Vault/Vault-0&lt;/a&gt;&lt;br&gt;
Demo video: &lt;a href="https://dev.tourl"&gt;x.com/HorizonFlowLive/status/2021542413177909481&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're running AI agents with API keys in plaintext .env files, give it a try. Issues and PRs welcome.&lt;/p&gt;

</description>
      <category>security</category>
      <category>rust</category>
      <category>opensource</category>
      <category>openclaw</category>
    </item>
  </channel>
</rss>
