Of course tests can't be perfect, but even a flimsy guardrail and a warning sign before a ravine is better than nothing.
The optimal solution would be to encase the whole thing in blast-proof transparent polymer, but nobody has the money to do that :)
Trying stuff until something sticks was not a solution when a human had to do the trying and every line of code cost money.
Now you can launch 20 agents to do slightly different things to see if something sticks - and still do the manual work yourself for the 21st path. The cost for those extra 20 attempts is next to nothing compared to the price of an actual programmer.