AI wrote the code. It runs. And it is wrong.
This happens a lot, and it is the part of AI coding that people outside IT rarely see. The app opens, the buttons work, the demo goes well. The mistake sits somewhere nobody looks, and it stays quiet for weeks.
This post walks through three of these quiet bugs with small code examples, explains why they are so hard to notice, and then answers the question many IT students ask: is AI killing this job?
Bug 1: the wrong price in a rare case
Here is a discount function an AI might write. It looks fine.
def total_price(price, quantity, discount): return price * quantity - discount Normal order: 2 items at 30, discount 10. Total 50. Correct.
Rare order: 1 item at 8, and the customer finds a way to apply a discount code of 10 twice.
total_price(8, 1, 20) # returns -12 The shop now owes the customer 12. Nothing crashed. No error appeared. The code did exactly what it was told, and what it was told was incomplete. The fix is one line, but only if someone thought of the case:
def total_price(price, quantity, discount): return max(0, price * quantity - discount) Bug 2: a date that breaks at New Year
This function is meant to return "tomorrow".
def next_day(day, month, year): if day == 31: return 1, month + 1, year return day + 1, month, year It works for most days you will try by hand. On 31 December it returns day 1 of month 13. Depending on what the rest of the app does with month 13, an order is saved with a broken date, a report skips it, or an invoice shows January of the old year.
It works 364 days a year. It fails on the one day when everyone is on holiday.
The lesson is not "learn date maths". The lesson is: use the date tools your language already has, and test the edges of the calendar.
Bug 3: two people saving at once
Anna from support opens a customer record and changes the delivery address. Ben from sales opened the same record one minute earlier and now changes the phone number. Both press Save.
The app does this for each of them:
- Load the whole record.
- Change one field.
- Write the whole record back.
Ben loaded the record before Anna saved. When he writes it back, his copy still has the old address. Anna's change is gone, and nobody gets a warning.
This family of problems has a name: a race condition. Two actions race, and the result depends on who arrives last. It never shows up when one person tests alone, which is exactly how most AI-built apps are tested.
Why you do not see them
All three bugs share the same properties:
- The screen looks normal.
- The usual path works.
- The failure needs a special case: a rare input, a special date, or two people at the same moment.
Without the basics you have no reason to look. And when you finally notice, the damage is not one row. The bug has been running quietly for weeks, so hundreds of orders, dates or addresses are already wrong, and you cannot always tell which ones.
Runs is easy. Right is hard.
Software that runs is much easier to make now. Software that is
- right in every case, not only the usual one,
- safe with other people's data, and
- fixable in two years by someone who did not write it
is as hard as it ever was. AI moved the first part. It did not move the second.
So is AI killing the IT job?
No. It is cutting the bottom step of the ladder.
The simple tasks we used to give to juniors, such as a small form, a basic report or a simple script, are tasks AI does now in minutes. Those tasks were how beginners used to learn on the job. So the first step is higher than it used to be.
If what you sell is something anyone can build in one evening, that is a hard place to be. That part is true, and it is better to say it plainly.
Where the value goes
Someone still has to know how the whole system works:
| What a company needs | The knowledge behind it |
|---|---|
| "Why is it slow?" | Databases, queries, monitoring |
| "Where can it be attacked?" | Identity, access control, secrets, networks |
| "What happens to the data when something fails?" | Transactions, backups, recovery |
| "Can we still change this next year?" | Reading code, testing, version control |
If that is you, your value does not go down. It goes up. More software built fast means more software that needs someone to make it right.
On Azure, this work has names. Azure role-based access control (RBAC) decides who is allowed to do what. Microsoft Defender for Cloud points at weak settings before an attacker finds them. Microsoft Sentinel collects the logs in one place so you can see an attack while it is happening, not three weeks later.
What to do this week
- Take one function AI wrote for you and ask: what is the strangest input someone could give it? Try that input.
- Open your app in two browser windows and save the same record from both.
- Set your computer clock to 31 December, 23:59, and use the app for two minutes.
Three small tests, and you will know more about your app than the demo ever told you.
The short version
Do not race AI at writing code. Learn how systems break, and how to protect them.
Next in this series: the five things worth learning, with one plain example each.
Sources
- What is Azure role-based access control (Azure RBAC)?
- What is Microsoft Defender for Cloud?
- What is Microsoft Sentinel?
Made by CD with love from VietNam. One short Microsoft security video a day at 20:00 (Vietnam time) on YouTube: CD Security Lab.
Thanks for reading! I'm Cuong, and on CD Security Lab I rebuild real Microsoft security cases in a safe lab and explain them simply. Follow along:
- ▶️ YouTube (daily Shorts + explainers): CD Security Lab
- 💼 LinkedIn: Cuong Do
- 📘 Facebook: CD Security Lab
- 📸 Instagram: @cdsecuritylab
- 📝 More posts like this: Dev.to
Got a question about your own tenant? Drop it in the comments.
