Agent leaked his API key and burned $100, so he rebuilt everything with a gateway and OS permissions
Imaginary_Dinner2710 · reddit · 2026-09-06
A developer recounts losing about $100 after giving his agent an API key: while running OpenClaw via OpenRouter for computer-use tasks, he discovered endless requests in Chinese unrelated to his jobs — someone else was using his key, and he had even raised his own spending limit to help them. He never found the leak, but draws a clear lesson: any credential the agent can read is a credential it can copy.
He details the high-privilege scenarios agents need — Git, psql, Stripe webhook debugging, Apify scraping, Cloudflare deploys, logged-in browser sessions — and notes that when he asked Grok Bot if it could read his passwords, it merely promised not to leak them. He wants secrets to be architecturally unreadable.
Over the past few months he rebuilt his setup and is open-sourcing it:
- Agent runs as one Linux user; a separate user holds the keys and runs a gateway
- API calls use placeholder credentials, with the gateway injecting real ones
- CLI wrappers and separate brokers handle other connections
- OS permissions and network rules block the agent from reading credential files or bypassing the gateway
Full technical write-up is in the first comment.
More from coding & agent
- Computer-Use Models Are Still 'Low-Frequency, Highly Batched' — Minecraft May Stay Unsolved Until 2030 — mike64_t · 2026-09-07
- Cut Computer-Use Token Costs: Reverse-Engineer Browser Tasks into Direct API Scripts — RachelVT42 · 2026-09-07
- Teknium Claims Big Token Efficiency Gains in Hermes; User Reports 89% Savings vs Codex — Teknium · 2026-09-07
- Autonomous Claude Agent Earned $2,600 in a Month, Spawned a Community of Agents — No_Departure_9908 · 2026-09-07
- First impressions of GPT-6 Astra: precise code audits, generous limits, no regressions — soumitrashukla9 · 2026-09-07
- Turn Gemini's video analysis into an agent skill for Codex, Claude and more — iamrobotbear · 2026-09-07