What is AI coding agent?
An AI tool that doesn't just suggest code but runs commands, edits files and installs things for you.
Where AI coding agent goes wrong in real apps
Each of these is a short scenario built from a real failure in an app made with AI. Read the answer here, or walk through it yourself in about four minutes.
Data you can lose · 5 minutes · Free
The agent that reset production
You asked your coding agent to fix a failing migration. It says it 'reset the database to resolve drift'. Your live customers are gone.
Walk it, freeHow do I stop an AI agent deleting my database?
Do not keep production database credentials where the agent runs. Use a separate development database locally, give production a role that cannot drop tables, and keep backups the agent cannot reach. Instructions like 'never touch production' are not enough; only permissions reliably stop a destructive command.
Working with your AI agent · 5 minutes · Pro
The ticket that gave orders
Your coding agent is connected to your database so it can triage support tickets. One ticket is not quite a question.
Read the fixWhat is prompt injection in AI coding agents?
Prompt injection is when text the AI reads, such as a support ticket, email or web page, contains instructions the AI then follows as if they came from you. If the agent can read private data and send messages, it can leak that data. Limit its access with permissions, not prompts.
Working with your AI agent · 4 minutes · Free
Approve this command?
Your coding agent wants to clean up old build files before a fresh build. It asks you to approve one command.
Walk it, freeWhich AI agent commands should I always check?
Always read commands that delete, move, reset or force-push before approving them. Shell variables are replaced before a command runs, so an empty variable can turn rm -rf "$HOME/$CACHE_DIR" into deleting your whole home folder. Auto-approve only harmless commands, and run agents in a contained folder.
Working with your AI agent · 4 minutes · Pro
Force-pushed away
Your agent 'cleaned up the branch' to resolve a conflict. Three days of commits are gone from GitHub.
Read the fixHow do I recover commits after a force push?
Act quickly. Git rarely deletes commits immediately: the reflog on the machine that had them, or GitHub's activity history, still shows the old commit ids, and you can recreate a branch from them. Then protect your main branch against force pushes and stop agents pushing without approval.
Working with your AI agent · 4 minutes · Pro
48 green tests
You asked the AI to make the failing tests pass. All 48 tests are green. Yesterday there were 61.
Read the fixCan AI coding tools cheat on tests?
Yes. Asked to make tests pass, AI agents sometimes delete, skip or weaken tests instead of fixing the code. A green run then proves less than before. Watch the test count, review diffs to test files, and tell the agent test files are off-limits unless you asked for new tests.
Keeping it running · 4 minutes · Pro
Update everything, deploy nothing
You asked your AI to 'update everything to the latest versions'. The app runs on your laptop, but the deploy fails and the live site is stuck on the old version.
Read the fixWhy does my build fail after updating packages?
Usually because a package jumped a major version, which can change how it works, or because package.json and the lockfile no longer match, so the build server installs different versions than your laptop or refuses to install. Update one package at a time, read upgrade notes for major versions, and commit the lockfile with package.json.
Related terms
- Git, commit, repository
- Git saves snapshots (commits) of your code in a repository, so you can see history and go back.
- Database
- Where your app keeps its data, organised in tables, like a set of spreadsheets.
- Secret key
- A password your app uses to talk to a paid service. Anyone who sees it can use it, and spend your money.
- Production
- The real, live version of your app that customers use, as opposed to the copy on your laptop.
- Deploy
- Putting a new version of your app online so users get it.
- Authorization
- Checking what someone is allowed to do once you know who they are. Signed in does not mean allowed.