How I Built a Dead-Man's Switch for My AI Trading Pipeline in Python A developer built a dead-man's switch in Python to detect when their AI trading pipeline silently stops running. The switch flips the monitoring logic: instead of waiting for failure reports, it expects a success signal from the job, and an external watcher raises an alert if the signal doesn't arrive on time. This approach catches failures that produce no errors, such as a scheduling hiccup that prevents the code from ever executing. I run a small trading bot. Every morning before the market opens it pulls signals, weighs them, and decides whether to act. It had been humming along for weeks, so I'd mostly stopped watching it. Then one morning I opened the dashboard out of idle curiosity and something was off. No trades. Not "it decided not to trade", just crickets . I scrolled back. No trades the day before either. Or the day before that. Three days. The bot had silently stopped running and I had no idea. Here's the part that stuck with me: there was no error to find. No red text, no stack trace, no alert in my inbox. The overnight process that was supposed to kick everything off had just… not kicked off. A scheduling hiccup on my machine, most likely. The code was fine. The code simply never ran. And every single tool I had for catching problems was completely blind to it. Think about how we normally catch failures. We wrap risky things in try/except . We log errors. We wire up something to shout when an exception gets thrown: try: run morning routine except Exception as e: logging.error "Morning routine failed: %s", e send alert e This is good practice and you should do it. But notice the assumption baked into every line: it assumes the code ran. The try block has to execute for the except to ever fire. The logger has to be reached for it to log. The alert has to be triggered by a process that is, by definition, alive. None of that helps you when the process never starts. In every one of these cases there is no exception, because there is no running code to throw one. There's no log line, because nothing got far enough to write it. Your monitoring is sitting there patiently waiting for a signal that will never come, and interpreting the silence as "all good." That's the trap. Absence of an error is not the same as success. For unattended jobs like cron tasks, scheduled scripts, overnight pipelines, AI agents running on a timer etc. the most dangerous failure is the one that produces no output at all. The fix is to stop waiting for bad news and start expecting good news . A dead-man's switch the name comes from the pedal that stops a train if the driver goes unresponsive flips the logic around. Instead of your code reporting when it fails , it reports when it succeeds and something external watches for that report to arrive. If the expected check-in doesn't show up on time, the watcher raises the alarm. The crucial word is external . The thing doing the watching has to live somewhere your job doesn't. If the watchdog runs on the same machine as the job, then when that machine dies, the watchdog dies with it and a dead watchdog can't tell you anything is wrong. You need something running elsewhere whose entire purpose is to notice an absence. Concretely, three pieces: The silence becomes the signal. You just need something that's actually listening for it. Let me show the shape of it. This is deliberately minimal. The point is the pattern, not a framework. The job needs to announce itself at the start and confirm at the end. Pure standard library, no new dependencies: python import urllib.request PING = "https://your-watchdog.example/ping/