How do you make “safe” raw cookie dough?

They say you’re not supposed to eat raw cookie dough, because eggs and untreated flour have a high likelihood of containing Salmonella and E. coli. So how do ice cream companies make cookie dough ice cream? Ben & Jerry’s has revealed their method. They say there are two keys: 1) no eggs and 2) heat treat the flour. Here’s how to treat the flour:
– Microwave your flour on high until it reaches 165°F throughout (use an instant-read thermometer). Or, heat your flour in a conventional oven. Spread the flour out on a rimmed baking sheet and bake it in a preheated oven at 300°F in 2-minute intervals, checking the temperature after each interval until it reaches 165°F throughout.
– The recipe (which you mix like you were making regular chocolate chip cookies):
1 stick unsalted butter
1 cup brown sugar, packed
2 tbsp. heavy cream
1 tsp. vanilla extract
1/2 tsp. kosher salt
1 cup flour (heat treated)
1/2 cup chocolate chips
Total Yield: About 2 cups of raw cookie dough. Eat it plain, or mix it into your ice cream.
(full instructions here: benjerry.com/flavors/recipes/edible-cookie-dough)

Now, enjoy that cookie dough!