Alright, i figured it is difficult to ensure food is safe without governement.
So let's say we are in a libertarian society. Some comapnies produce food, indeed, but they are rational agents and they wants to maximise profits, so they start lowering quality/ using dangerous chemicals or whatever process that's cost-effective but unhealty for the consumer.
What warranty the consumer will have to buy sane/quality food ?
I have figured some companies could just pay some laboratories to make tests on their products to ensure quality&safety, but then the companies which analyse the food will in order need food companies to sustain, so there is a conflict of interrest, and labortories will be tempted to say the food is safe not to lose their customers. Also their lies the corruption problem.
Then you can object that some non-profit organisation will perform tests voluntarily on food, but that suppose them to be vertuous and selfless, and again their big influence on the market will make then in a position where they will have a lot of pressure, and the peoples volunteering will need to eat so they need money, so they can be bought to hide dirty test results.
So, how do you solve this ?
This works for food quality and safety but also for other goods, such as electronics, chemicals, cosmetics and so on.