Finally my military experience is relevant. If you've ever wondered why military ammo depots rarely blow up despite plenty of accidents and fires (at least in western cultures or specifically in the USA), a long time ago I was an Army sysadmin for a computer system devoted to keeping that safe. This wasn't a centralized control thing either, it was a distributed system.
There's a minimum contact diameter and maximum distance to propagate an explosion. Even if you detonate one pallet of one ton of ANFO literally making a checkerboard of pallets would seem from memory to be enough to make sure the explosion does not propagate to the other pallets. Now realize this was decades ago and I was more or less a sysadmin not a warrant officer nor one of the research scientists who wrote the books full of regulations nor the geospatial analysis code. Yes one pallet of one ton of ANFO would make a mess of the forklift driver next to it, but, maybe 100 or 200 hundred feet away, other than maybe some broken windows you'd be hard pressed to tell it happened.
One of many AN production processes generates about one part calcium carbonate (limestone, essentially) to one part AN, so you could literally alternate train cars of synthetic limestone with train car loads of AN.
Bulk storage is more problematic.
A pretty good analogy is forest fires. One tree chopped into segments and catches fire is a pretty cool bonfire or camp fire which is no big deal for outdoorsmen who intelligently plan ahead. You can do that a million nights in a row and nothing bad will happen. One million trees in close proximity and if one catches fire the whole forest burns down in one night, which is a huge problem.