Hackers Are Coming for Your AI Coding Agent (Lock It Down Now)
Summary
Coding agents have become a viable attack path: malicious settings files, trojaned packages, and leaked credentials in transcripts give adversaries a foothold with the same permissions your agent has. Cole walks through several recent real-world incidents, then layers practical hardening steps — scoped keys, tighter allowlists, and spend monitoring — on top of a free audit skill that scans an agent's configuration and installs a secrets guard hook.
Key takeaways
- Treat agent config as executable surface: settings files, hooks, and MCP definitions can trigger downloads or shell commands the moment a session starts, so review them like code before cloning or opening a repo.
- Installing packages inside an agent session inherits the agent's environment — run installs in a sandbox or container without ambient cloud/API credentials mounted.
- Conversation transcripts and logs are de facto credential stores; avoid pasting env files or tokens into chat, and prune history rather than assuming it is private.
- Persisted allowlist approvals convert a one-time yes into durable access — keep the allowlist small, review it periodically, and never let secret-bearing commands get whitelisted.
- Rotate and scope LLM API keys, cap spend, and alert on anomalies to blunt LLMjacking, where stolen keys are resold or burned for free inference.
- Automate a configuration audit (the agent-config-audit skill plus its secrets guard hook) so drift in agent settings gets caught before an attacker exploits it.