← All stories · Trusting agents & AI input

Stop an agent from revealing its API key

Agent tricked into revealing its API key on a vibe-coded dashboard · Security incident · X · @AlphaSignalAI · Sep 2026

An AI research org's vibe-coded dashboard had an authentication flaw that exposed an agent; an attacker prompted it to reveal its API key and used about $600K of provider credits over three weeks. The provider covered the credits.

Lesson

Never put a raw key where the model can read it, put auth in front of every agent endpoint and cap spend per key.

Fix prompt

Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.

I use LLM agent, which can read web pages, files, emails or tool output. Help me reduce the risk of prompt injection (hidden instructions in content the AI reads). 1) List what my setup can access (files, terminal, browser, MCP servers, email, databases) and what it can do without asking me. 2) Point out the riskiest combinations, e.g. reading untrusted content while also having access to secrets or the ability to send data out. 3) Suggest concrete settings: require approval for commands and network calls, remove MCP servers I don't need, use read-only tokens, and keep the tool updated. 4) Give me a short checklist to follow before opening untrusted repos or documents. Don't change anything until I've approved your plan. Never ask me to paste API keys, passwords or .env contents; tell me where to check them myself.
LLM agentEC2

Source: X ↗

The Honest Build. Real stories, not hype.

Every week: real stories of what building with AI actually took, the one lesson worth keeping, and the security slip-ups to avoid. Free, unsubscribe anytime.