AI Agent Safety Checklist
Stop your AI agent going rogue
You get this PDF right away, plus one email a week with the new guide. Unsubscribe in one click. Privacy
The problem
You gave an AI agent your keys and your accounts, and you're not sure what it can reach anymore. Even the big labs got the limits wrong.
After this guide
You know exactly what your agents can touch, and a hard cap stops a runaway bill. You have a tested plan for the day a key leaks.
What's inside
- The five things rogue agents actually did, and the check for each
- Key, permission and hard spending-cap settings, step by step
- 6 copy-paste prompts that make your agent audit its own setup
- A one-fix-a-day plan to finish this week
Free preview
This checklist covers five checks for locking down AI agents such as ChatGPT, Claude Code or any other agent: keys, permissions, spend caps, logs and a named owner. It follows OpenAI's disclosure that it notified more than 100 organizations about its own agents' activity. It is for anyone who has set up an agent and wants to know what it can reach.
- Give each agent its own keyUse a separate key per agent or project, set an expiry date, and keep keys out of the browser, apps and repos. Store them in environment variables and search your repo for leaked keys today.
- Limit permissionsKeep tool approvals on, fence the file system with a sandbox, and block commands the agent never needs. Keep web pages, emails and user input out of system or developer prompts.
- Set a hard spend capAn alert only notifies and traffic keeps flowing. A hard limit returns an error once the cap is reached, so set it below your real ceiling, per organization and per project.
- Log every actionRecord each tool call, URL and file the agent touched. Read the usage page weekly, since a sudden spike at 3 a.m. can mean a leaked key or a loop.
- Name an ownerPick one person who can pull the plug: revoke keys, stop the job and disconnect tools.
- Audit and test the agentRun six read-only audit prompts inside Claude Code, Codex or Cursor to inventory, sweep for secrets, review permissions, test injection, review logs and write a leak runbook. The guide spreads them over a seven-day plan.
3 prompts from the guide
Do not change anything. List every agent, script, cron job, MCP server and API integration in this project. For each: what it can read, what it can write or send, which credential it uses (name only, never the value) and whether a human approves its actions. Output a table.
Read-only. Search this repo, its git history and config files for API keys, tokens, passwords and private URLs. Show file, line and key type, masked (first 4 characters only). Tell me which ones to revoke first and how to move each into an environment variable.
Read my agent settings and MCP config. List every permission broader than the job needs: write access where read would do, wildcard commands, network access, folders outside the project. Propose a tighter config and show the diff. Don't apply it.
The full guide has every step, all the prompts and the fixes for what usually goes wrong.
Questions
How do I stop an AI agent from leaking my API key?
Use a separate key per agent, set an expiry date, and keep keys in environment variables with the .env file listed in .gitignore. Never put a key in front-end code, a mobile app or a repo. The guide suggests searching your repo today with git grep -nE "sk-[A-Za-z0-9_-]{20,}", and if you find a key, revoke it first and clean it up after.
What is the difference between a spend alert and a hard limit?
An alert only notifies you while traffic keeps flowing. A hard limit returns error 429 (project_spend_limit_exceeded). It can overshoot slightly, so set it below your real ceiling.
How do I limit what an AI agent can access?
Keep tool approvals on so a human confirms reads and writes, and in Claude Code run /sandbox to limit which folders and network hosts commands can reach. Put commands like curl, wget or deploy commands in permissions.deny. Anthropic advises a virtual machine for agents that run scripts against outside web services.
What should I do if an agent key leaks?
Revoke first and investigate second. The guide's runbook order is: stop the agent, revoke and rotate keys, check usage and spend, check what it posted or changed, and tell anyone affected. Name one person ahead of time who can pull the plug.
What did OpenAI's agents actually do?
After its agents accidentally hacked Hugging Face, OpenAI reviewed what its models did online during training and testing and notified more than 100 organizations by September 26, 2026. OpenAI says most cases so far are low severity and that a notification does not mean private data was accessed or a system was compromised.
More free guides
AI Bug Hunting Without the Junk
The free security audit for your vibe-coded app
4 Settings Before an AI Runs Your Computer
The Claude Code site security setup guide
The 60-second repo check
Let AI edit your videos