Have you ever swerved dangerously when driving to avoid hitting a chipmunk, raccoon, or a turtle? I have, and there's always that moment afterwards where you realize that maybe it wasn't the safest decision.

Those split-second choices are when driving becomes dangerous and difficult, and it's why the German government has now released the world's first ethical guidelines for how driverless cars should handle such decisions. They include prioritizing human safety over protecting animals or property, and always allowing the human driver to supercede the program's decisions.

"It will not be possible to prevent accidents completely," reads the report, which was published by the Ethics Commission at the German Ministry of Transport and Digital Infrastructure. "This makes it essential that decisions be taken when programming the software of highly and fully automated driving systems."

The report details 15 rules for designing driverless car systems to prioritize "safety, human dignity, personal freedom of choice and data autonomy," according to Udo Di Fabio, a former judge and head of the ethics commission. The rules state that driverless cars should strive to minimize harm to humans, including driving defensively and anticipating possible hazards. The cars must "be programmed to accept damage to animals or property in a conflict if this means that personal injury can be prevented," and are prohibited from making decisions about human safety based on "age, gender, physical or mental constitution."

If the choice is between damaging a fence and killing the driver, it's clear why the commission wants to prioritize people over property or animals. But what about less black-and-white decisions? What about when it's between killing a pedestrian or killing the driver? In these cases—a point of ongoing debate as driverless technology advances—even the commission was stumped, and said the system should defer to human decision.

"Genuine dilemmatic decisions, such as a decision between one human life and another, depend on the actual specific situation, incorporating 'unpredictable' behaviour by parties affected," the report reads. "They can thus not be clearly standardized, nor can they be programmed such that they are ethically unquestionable."

Many German-based companies, such as BMW and Volkswagen, are investing heavily in autonomous vehicles, including cars and transport trucks, so the government has been hastening to get guidelines in place so that tests can advance quickly and safely.