The U.S. Environmental Protection Agency and California officials say some 482,000 Volkswagen and Audi diesels were engineered to falsify their emissions for federal tests—a violation that opens the German automaker to a theoretical fine totaling $18 billion. The EPA and California Air Resources Board say the affected models had software in its computer engine controls that could sense exactly when it was being tested for emissions quality. At all other times, it would run the diesels in a different mode with illegal levels of pollution; for example, spewing up to 40 times more nitrogen oxide, a key component of smog,...