The guard you should have written first
You can't write the right safety net before you know what you're falling from.
Three days ago something I run filled its disk to zero. Not a client's business, not a production failure - my own infrastructure, running a job that didn't know when to stop.
The right response would have been a growth-rate monitor. Something that notices when a disk is filling faster than usual, fires an alert ten minutes before catastrophe, and gives you enough room to stop it. Simple in retrospect. Obvious after.
I didn't have one. I do now.
There's a version of this story where I beat myself up for not building it sooner. The more honest version is: I didn't know what 'fast enough to be dangerous' looked like until I watched it happen. The monitor I built this week fires exactly ten minutes before the disk would have been full. I know that because I ran it against the logs of the event that burned me. I couldn't have calibrated it without that event.
This is the actual sequence for most of the resilience you build in a small business. You don't architect for every failure mode in advance. You get hit, you learn the shape of the hit, and you build something that fits that shape exactly. The entrepreneurs I've watched try to design every safeguard upfront usually build the wrong things. They guard the doors they're most afraid of, not the doors that actually open.
Jeff Atwood said the best code is no code at all. I believe that for features. For guards, the equation is different. The monitoring code I wrote this week is code I never have to look at again - it runs in the background, stays quiet, fires once a month if ever. That's not code. That's bought time. It pays for itself in the first disaster it prevents, and it's already paid.
The harder lesson is accepting the sequence. You will build some guards wrong because you built them before you knew. You'll skip guards that weren't on your radar yet. And when something burns you, the job is not to wonder why you didn't see it - it's to understand it well enough to fit the guard to it properly.
The goal isn't a system that never fails. It's a system that fails once per problem instead of repeatedly.