Storing herbs and garlic in oil for cooking may seem like a great pair for cooking and flavoring, but in fact, this can provide the perfect environment for the botulism toxin to survive and thrive.
Herbs, garlic, and oil are all low-acid foods. Botulism can make low-acid foods unsafe to eat if they haven't been properly stored or processed. Other low-acid foods include vegetables, meat, and mixtures of those two (spaghetti sauce with meat). All low-acid foods must be canned using a pressure canner to reach a safe temperature of 240 degrees F. Heating to that temperature for a specific amount of time (determined based on the food and size of the jar being used) will kill any botulism spores. There are currently NO recommendations to pressure can herbs, garlic, or oil mixtures. Cooking the garlic does not help prevent botulism either.
Commercial prepared mixtures of herbs, garlic, and oil have strict procedures that aren't available for home use. There is no safe way to prepare these at home. You cannot add vinegar or acid to a mixture to make it safe.
Herbs, garlic, and oil mixtures can be prepared fresh and stored in the refrigerator to be used within 2-3 days. They cannot sit out at room temperature because the "danger zone" (temperatures of 40-140 degrees, which includes room temperature) favors conditions for botulism to grow and reproduce. This toxin can cause serious illness if a food is consumed that has been contaminated. There is no way to smell or taste the toxin.
If you have done this before, do not do it again. Maybe no one got sick the time before, but all it takes it one time for someone to become very ill. There is no surefire way to tell if someone had a light case of botulism, sometimes we attribute food borne illness to something else - like indigestion or "I ate too much." Food borne illness can range from very light to very severe.
Herbs, garlic, and oil can be mixed and stored in the refrigerator for a few days. Or, just mix them into your recipes and cooking. Commercially prepared mixtures are fine, but don't try this at home!