There isn’t a guarantee that buying locally grown food will prevent any food safety issues. However, shopping lower on the food chain (i.e., buying locally) does allow you to at least get to know your farmer (or food producer) and their operation. It allows you to feel comfortable with where your food comes from based on empirical experiences, not some fancy label or empty government oversight.
The recent bout with deadly pet food is just one cogent example of how consolidated our mass produced food system really is. This is no different for food designed for human consumption. Much of the food found on grocery store shelves all comes from basically the same place, and you can’t find out where that is. But stop in at your local farm, or at a market that supports local farmers, and you can be pretty sure you’ll find out where your asparagus was grown and by whom. And although no one can guarantee absolute food safety at any level, the better you know your local food system, the less likely there will be problems.
Even with a hugely consolidated food system in this country, our own government can’t guarantee its overall safety, much less the safety of imported foods. Personal consumer responsibility has to take over. And given that not one of us relishes digging through a mass of freight containers, I suggest you find a farm, and its farmer, for your next meal. Come face to spear with your asparagus, and embrace it!