(CNN) โ€”ย Thatย cup of joeย that jolts you awake in the morning is pretty safe when it comes to contaminants and toxins, aย new investigation has found. Well โ€ฆ almost.

โ€œWhile some contaminants were present, most were found at minimal levels and well below the European Unionโ€™s safety limits per 6-ounce serving. This means coffee is generally safe,โ€ said Molly Hamilton, executive director of the nonprofit Clean Label Project, which conducted the investigation into caffeinated coffees.

Thatโ€™s great news because coffee has a stellar rรฉsumรฉ:ย Studiesย have found drinking about 3 cups of black coffee a day provides health benefits, such as reducing risk for such issues asย heart disease,ย multiple sclerosis,ย type 2 diabetes,ย liver disease,ย prostate cancer,ย stroke, dementiaย and more.

But hereโ€™s the grind โ€” the testing found traces of a worrisome herbicide called glyphosate and one of its byproducts. Glyphosate is a popular herbicide that has been linked toย hormone disruptionsย andย neurotoxic effects, including the development of autism and other developmental disorders in children.

The first MAHA (Make America Healthy Again) Commission report, released in May, raised concerns about the impact of glyphosate and other pesticides on childrenโ€™s health. The US Environmental Protection Agency and otherย regulatory bodies, however, say numerous studies and risk assessments have shown no adverse effects of glyphosate at levels found in the food supply.

Plastics from packaging

In addition to glyphosate, testing found some coffees also contained small amounts of phthalates, a plasticizer found in consumer products such as food storage containers, shampoo, makeup, perfume and childrenโ€™s toys.

Phthalates have been linked withย reproductive problems, such asย genital malformationsย andย undescended testesย in baby boys andย lower sperm countsย andย testosterone levelsย in adult males. Studies have also linked phthalates toย asthma,ย childhood obesityย andย cancer.

Testing found the highest levels of phthalates in coffee sold in cans, followed by pods and finally bags. The reason for that isnโ€™t yet clear, โ€œso our next study is going to be analyzing the packaging assembly line to discover why there is a change in contaminants,โ€ Hamilton said.

โ€œThe Clean Label Project plays an important role in post-market testing for contaminants in everyday consumer products, including this recent report on coffee,โ€ said David Andrews, acting chief science officer for the Environmental Working Group, or EWG, a nonprofit consumer advocacy group thatย maintains a databaseย on personal care products that contain toxins.

โ€œThe higher phthalate levels found in coffee pods and canned coffee suggest that packaging could be a meaningful source of exposure to these chemicals of concern,โ€ Andrews said.

The National Coffee Association, which represents the US coffee industry told CNN that it was โ€œhighly irresponsible to mislead Americans about the safety of their favorite beverage.โ€

โ€œDecades of independent scientific evidence show that coffee drinkers live longer, healthier lives,โ€ NCA President and CEO William โ€œBillโ€ Murray said in an email.

The Clean Label Project measures levels of heavy metals, pesticides and plasticizers in food and consumer products. The organization also checks to see whether the tested productsโ€™ labels list those contaminants.

To do the testing, Clean Label obtained samples of coffee from 45 popular brands โ€” which they did not name. Coffee beans were grown in Brazil, Colombia, Costa Rica, Ethiopia, Guatemala, Kenya, Peru and Hawaii.

A certified lab conducted over 7,000 tests looking for pesticides, including glyphosate; heavy metals such as lead, mercury, arsenic and cadmium; mycotoxins, which are toxic chemical compounds produced by some molds that grow on crops; and phthalates, a plasticizer found in consumer products such as food wrapping, food storage containers, shampoo, makeup, perfume and childrenโ€™s toys.

The tests found scant glyphosate, but โ€œsignificantโ€ amounts of aminomethylphosphonic acid, or AMPA, a byproduct of glyphosate as it breaks down in the environment, according to the report.

The half-life of AMPA is longer than that of glyphosate, which means it can persist in the environment and is easily absorbed by plants from soil and water. In addition, AMPA has been shown toย damage cellular DNAย in prostate cells and cause an increased risk ofย liver inflammationย and metabolic disorders in young adults.

Surprising finding in organic coffees

Testing found organic coffees bested conventional coffees in total amounts of contaminants, but there was one oddity โ€” there were levels of AMPA in all of the 12 organic coffees tested. Of the 45 samples of conventionally grown coffees, only 29 tested positive for aminomethylphosphonic acid, according to the report.

While certified organic coffee growers cannot use pesticides like glyphosate, itโ€™s possible for organic fields to be contaminated by runoff from neighboring conventional farms, Hamilton said.

โ€œStill, the detection of AMPA in 100% of organic samples we tested is definitely a wake-up call,โ€ she said. โ€œWe definitely need stronger safeguards and greater transparency in our food system.โ€

Other contaminants in coffee

Levels of heavy metals depended on where the coffee was grown. Africa has some of the lowest levels of heavy metals, while the highest were found in Hawaiian coffee. Hawaii, however, is a volcanic island and therefore expected to have more significant levels of heavy metals in the soil.

An analysis also found 100% of the tested coffee samples contained small amounts of acrylamide, a colorless, odorless chemical formed when certain foods are cooked at high temperatures, such as when frying, baking and roasting.

Acrylamide has been linked to cancer in animals when they are exposed to extremely high doses. However, the chemical is not thought to be toxic to humans at small levels of consumption. Despite that, the US Food and Drug Administration hasย advised manufacturersย to attempt to lower levels in the food supply.

Clean Labelโ€™s testing found levels of acrylamide varied with the degree of roasting of coffee beans. The highest levels of acrylamide were found in medium roasts, followed by light roasts and dark roasts.

โ€œThe dark coffees are the best choice because they are roasted at lower temperatures for a longer period of time so acrylamide levels donโ€™t rise,โ€ Hamilton explained. โ€œThe light coffees are roasted minimally, so here too, acrylamide levels donโ€™t build up.

โ€œHowever, medium roasts have the higher levels of acrylamide because they are roasted at higher temperatures long enough to darken the beans,โ€ she said.

What to do?

What could a coffee lover take away from the testing?

โ€œWhen you decide which coffee to buy, choose darker or the lightest roasts in bags or pods and consider where coffee is grown, which can impact the levels of heavy metals,โ€ Hamilton said.

โ€œBut I want to stress that itโ€™s important to put these findings into context,โ€ she added. โ€œCaffeinated coffee is still one of the cleanest product categories weโ€™ve ever tested.

โ€œOur report isnโ€™t meant to raise alarm or keep consumers from drinking coffee, but rather to empower people on how to choose the cleanest, safest cup of coffee.โ€