The "Unlocked Hotel Room": Imagine key #101 accidentally opening room #102. When AI writes code to fetch a file, it searches by the number in the link alone. Anyone can change the number in their browser to view someone else's private files!
What your AI writes alone
Dangerous Mistake
What is wrong with this code?
What it writes with secure-code
Safe Production Code
Want to scan your existing project for these bugs? Run:
npx github:carbonthecoder/secure-code audit
The Real-Life Difference
Real examples showing how 1 simple rule stops catastrophic mistakes.
| The Scary Mistake | What Your AI Does Alone ❌ | How secure-code Fixes It ✅ |
|---|---|---|
|
Stranger reads your private files Changing the number in the web link opens someone else's files. |
Finds by file number only | Checks who is logged in first |
|
Prices and balances are wrong Computers get confused doing decimal math (0.1 + 0.2). |
Does math with decimals | Counts in whole pennies |
|
Prankster deletes your entire database Typing evil commands into a search bar wipes your data. |
Glues user text into commands | Treats search text as words only |
|
Hackers easily guess secret keys Quitting on the first wrong letter gives hackers clues. |
Basic '===' password check | Takes exact same time (0 clues) |