AI follows good habits a little too literally
Telling AI to back up files before editing them sounds like good practice. On a live web server, it can quietly make private code readable to anyone.
Say you let an AI work directly on a live website, and one of the rules you give it is to back up every file before it changes it. That’s a good habit, and the AI will follow it perfectly. Every edit leaves a copy of the original right next to it, often with the date in the file name.
The problem is that the files on a web server sit in a public folder, and anyone who guesses a file’s name can download it. The live files are usually safe, because the server runs them instead of showing what’s inside. A backup gets a different file ending, though, so the server doesn’t treat it as code and simply hands it out as plain text, source code included.
Nothing breaks and nothing looks wrong, so this is easy to miss. The copies just pile up quietly with every edit until someone goes looking for them. A security review, done by a person or by an AI agent set up to look for exactly this kind of thing, will usually catch it. The fix is simple: delete the copies and change the rule so backups are kept outside the public folder, for example on your own computer.
The lesson
AI follows instructions very precisely, even where the instruction has a hole in it. It doesn’t stop to ask whether a good habit still makes sense in a new place, so it’s up to you to look for those holes before the AI falls into them. That’s why it pays to review what AI has done, not just what it has written, and to schedule security reviews regularly, the same way you would schedule content audits.