But the focus on the plain-sect dairy farmers is unavoidable: they own more than 50 percent of Lancaster County’s 5,000-plus farms.

“It’s been an issue over the last 30 years,” Dr. Kraybill said. “We have too many animals here per square acre  too many cows for too few acres.”

For now, the environmental agency’s strategy is to approach each farmer individually in collaboration with state and local conservation officials and suggest improvements like fences to prevent livestock from drifting toward streams, buffers that reduce runoff and pits to keep manure stored safely.

“These are real people with their own histories and their own needs and their own culture,” said John Hanger, the secretary of environmental protection in Pennsylvania. “It’s about treating people right, and in order to treat people right, you’ve got to be able to start where they are at.”

But if that does not work, the government will have to resort to fines and penalties.

Last September, Mr. McGuigan and his colleagues visited 24 farms in a pocket of Lancaster County known as Watson’s Run to assess their practices. Twenty-three of the farms were plain sect; 17 were found to be managing their manure inadequately. The abundance of manure was also affecting water quality. Six of the 19 wells sampled contained E. coli bacteria, and 16 had nitrate levels exceeding those allowed by the E.P.A.

Persuading plain-sect farmers to install fences and buffers underwritten by federal grants has been challenging because of their tendency to shy from government programs, including subsidies. Members neither pay Social Security nor receive its benefits, for example.

Image Inside a barn on the Stoltzfus farm in Lancaster, Pa., Roman Stoltzfus, 10, did his chores. Credit... Todd Heisler/The New York Times

Word of the E.P.A.’s farm visits last September traveled rapidly through Amish country, Mr. Stoltzfus said, even though most plain-sect farmers do not have their own phones.