I had a massive embarrassment last week where an AI email I sent out included a link to a 'case study' that did not exist. It looked broken. How can I set up a system to verify every link an AI generates? I am looking for a tool or a process that automatically checks link validity before the email sends.
Automated link verification requires stripping generative URLs in favor of hard-coded references or validating all output against an allowlist and performing automated connectivity checks before final delivery.
3 answers
You need to move away from generative link creation and integrate a hard-validation gate into your pipeline.
- Strip all generated URLs from the raw AI response.
- Replace placeholders with known-good links from a curated configuration file.
- Use a headless browser or curl to ping every link found in the draft during the staging phase.
- Block the send action if any URI returns a 404 or 500 status code.
- Require manual human-in-the-loop approval for any email containing external references.
You should implement a deterministic URL validation middleware between your LLM output and the email transmission gateway. Relying on an AI to generate valid links is a fundamental architectural flaw, so you must decouple the content generation from the link resolution process using a library like requests or a custom script that performs a HEAD request to ensure a 200 OK status code before queuing the email.
I agree with Mangala Shayana, though I worry about the performance latency this might introduce. Perhaps we should consider adding a caching layer just in case something breaks during the validation process.
I remember back in 2018 when a legacy monitoring tool I managed started auto-generating incident reports that referenced nonexistent server nodes, and the chaos that ensued really shaped my approach to automated systems. We ended up implementing a strict whitelist approach where no automated communication could go out without passing a secondary validation layer that reconciled every asset identifier against our central CMDB.
It feels like you are trying to trust the LLM to know the state of your website, which it cannot do reliably because it does not have real-time access to your routing table. You need to stop letting the model hallucinate URLs entirely and instead use a templating system where the model only inserts a variable that a downstream script replaces with a verified, hardcoded link from your database.


Mangala Shayana makes a sound point, even if it adds another layer to an already complex pipeline. I am tired of dealing with broken links, so I suppose this extra step is necessary.