On the safety side, I've had crude analysis done (which is the standard nutritional testing for pet food in the US and was $250 per flavor), and I've consulted with a couple of vets to make sure the product is safe.
On the legal side, I've got business insurance, which thankfully isn't that expensive. I've been holding off on forming an LLC since that's gonna run me about a grand here in CA including the cost of setting it up and LLC tax, but if there's continued interest in the product, I'll do that soon.
Edit: Also AAFCO is a group that has standards for this sort of thing that are pretty straightforward: https://petfood.aafco.org/Portals/1/pdf/eight_required_labei...