Serve deception endpoints at the paths automated scanners already probe. Scanners hammer every site looking for leaked secrets and misconfigurations, and a normal 404 tells them nothing, so they keep going. The day one of those files is genuinely exposed, it is over. You want to catch the scanner the instant it reveals itself.
Why this works so well: no human and no legitimate app ever requests /.env. So a single hit is a 100%-confidence attack signal - which means you can block on request number one, with no threshold and effectively no false positives. That is rare in security.
The counter-intuitive part: return 200 with convincing fake content, not 403. A 403 confirms the path is interesting and tells the scanner to look harder. A 200 full of realistic junk wastes their time analysing nothing, and never reveals they were detected. Block the source IP at the edge on the hit, fire-and-forget.
Ordering matters: run the honeypot check before your rate limiter, so a scanner is caught on request one rather than after burning through a rate-limit window.
And keep your real bait list private. Publishing your full list lets scanners route around it. Start from the universally-known targets that every scanner tries anyway (.env, wp-config.php, .git/config, phpMyAdmin, common cloud-credential files) and grow it from what you actually see probing you.
A honeypot can block your own users. Before any new page or feature goes live, run every path it fetches through the real bait-matching function. A new tab that loads a small data file can have a path that matches a bait name, and a real visitor is then blocked on one ordinary request, for as long as the block lasts. Your own addresses are usually on an allowlist, so the same click works for you every time and you never see it. Add a scheduled check that lists blocked addresses whose earlier requests look like an ordinary visit (pages, assets, normal navigation) followed by a single bait hit, and have someone read that list. When a clash is found, rename the file in the app and add an exemption for that exact host and exact path for a few weeks, because cached copies of the old app keep asking for the old name.
Related: the scanners that avoid your bait paths. Full item: https://www.tigzig.com/security/perimeter.
Building something like this? How I work covers the rates, the availability and what I take on.