Rosemary-infused olive oil is one of the most useful things you can keep in a home kitchen - a drizzle over bread, roasted vegetables, or pasta adds instant flavor. It also comes with a real food safety consideration that's worth understanding before making a batch, since fresh herbs and oil can be a genuine risk if handled incorrectly.
Garlic and fresh herbs stored in oil at room temperature can create the low-oxygen conditions that allow the bacteria responsible for botulism to grow, since oil blocks air from reaching the herb or garlic while moisture from the fresh ingredient supports bacterial growth. This isn't a reason to avoid infused oil altogether, but it does mean the how matters as much as the recipe itself.
Prep time: 5 minutes | Cook time: 10 minutes | Makes: about 1 cup
Refrigerate the finished oil and use it within 2 to 3 weeks - even with the heat method and straining out the solids, refrigeration and a reasonably short shelf life are the safest approach for a homemade infused oil rather than storing it at room temperature indefinitely the way a commercial, professionally processed infused oil is designed to be stored. The oil will solidify somewhat in the fridge; let it sit at room temperature for a few minutes before using.
If you want rosemary flavor without the storage considerations, infuse the oil fresh each time you use it rather than making a batch to store: warm the oil with a rosemary sprig just until fragrant, use it immediately while warm, and don't store the leftover infused portion beyond that meal. This sidesteps the storage risk entirely since nothing sits at room temperature for an extended period.
Rosemary oil is excellent for dipping bread, drizzling over focaccia (doubling down on the same flavor), finishing roasted vegetables or roasted potatoes, or using as a base for a simple vinaigrette.
Discard the oil if you notice any cloudiness beyond a normal slight haze, an off or rancid smell, bubbling, or any visible mold. When in doubt, throw it out - the ingredients and time involved in making a batch are not worth the risk of using oil that may have spoiled.
For more on using rosemary in everyday cooking, see the complete rosemary guide.