Sometimes you win. Sometimes you lose. And sometimes the game is rigged. When that happens, you can give upâ€Š—â€Šor you can try to change the game.

A small town in rural Pennsylvania is doing precisely that.

In 2012, Grant Township became a target for fracking waste. Oil and gas producer Pennsylvania General Energy (PGE) applied for a permit to pump toxic chemicals used in drilling operations into an injection well beneath the community. Residents were alarmed. Injections can induce earthquakes, and wells can leak, contaminating water supplies. The chemicals used in fracking have been linked to cancer, infertility and birth defects.

“We live in an area that doesn’t have public water. We all live off springs and private wells,” said Judy Wanchism, 74-year-old native of Grant Township. “You ruin our water, our home is no good anymore. Nothing. You have to have water in order to live, to water your plants, to drink, to bathe, everything… I don’t know how else to say it. Water is life, and without water, you don’t have a life.”

Wanchism and her neighbors shared their concerns with officials from the Environmental Protection Agency (EPA) to no avail. Regulators must listen to the public, but they don’t have to take those concerns into account. The EPA issued the permit to PGE. The people of Grant Township couldn’t win. “We thought they would protect us. They wouldn’t,” said Wanchism. “You have to figure out ways to protect yourself, and that is basically what we did.”

Wanchism enlisted the help of Chad Nicholson, an organizer with the Community-Environmental Legal Defense Fund (CELDF), a public interest nonprofit law firm based in Pennsylvania. “It’s called a ‘regulatory system’ for a reason. They don’t actually stop the harm from being inflicted on the environment. They regulate the rate or the flow of the harm,” said Nicholson. “Why are we left arguing over the terms of the permit and how much harm we are going to get? Why can’t we just say ‘no’?”

Rather than accept that a certain amount of pollution was inevitable, Wanchism and her neighbors worked with CELDF to craft an ordinance that asserted the “residents of Grant Township, along with natural communities and ecosystems within the Township, possess the right to clean air, water and soil.” They then banned activitiesâ€Š—â€Šincluding the operation of injection wellsâ€Š—â€Šthat infringed on those rights.

Major environmental laws like the Clean Air Act and Clean Water Act protect human health and property, but they don’t recognize the intrinsic value of ecosystems. “If you want to try to protect a river from pollution upstream, you have to say that you own property on the river and your property values are being decreased,” said Nicholson. “If you don’t have an immediate property interest or economic interest that’s being harmed, it’s very difficult for you to try to use those other laws.”

Asserting the rights of “natural communities and ecosystems”â€Š—â€Ša controversial idea, to say the leastâ€Š—â€Šallowed Grant Township to target a broad set of environmental threats. The town drafted laws that prohibit pollution “not based on how many trucks per day, not based on how much impact it’s going to have on the waterway or things like thatâ€Š—â€Šbut prohibit it as a violation of the rights of the people that live in the community,” said Nicholson.

“They have rights to clean air and clean water. They have rights to self-government. They have rights to a sustainable future,” he said.

In 2015, a federal judge overturned the part of the ordinance blocking the operation of an injection well. Grant Township, she said, had exceeded its authority as a second-class township. Residents responded by adopting a home-rule charter, which gave the community more legal authority.

In an ironic twist, the Pennsylvania Department of Environmental Protection (DEP) is now suing Grant Township, arguing its home-rule charter violates state law. “We shouldn’t be fighting the DEP,” said Wanchism. “The DEP should be protecting us and helping us.”

Grant Township is now countersuing the DEP for failing to protect the community. A state court will hear oral arguments this fall. Residents are also dealing with legal fallout of the original ordinance. PGE claims Grant Township owes the company for damages incurred by blocking the injection well.

“Sometimes, I talk about it as sustainability actually being illegal,” said Nicholson. “If you try to put into place sustainable energy policies for your community, you can be sued by the industry that would be aggrieved by these sustainable policies.”

At the root of the conflict is a question of rights. Corporations are protected by state and federal laws. They are legally permitted to pollute. But, Nicholson contends that laws protecting polluters are not legitimate because they violate citizens’ right to clean air and water. International law recognizes the right to a healthy environment. And, while the U.S. Constitution does not explicitly afford this right, the Pennsylvania Constitution does.

“We draw a distinction between legal and legitimate,” he said. “If the state or federal government is implementing policies that would allow corporations or other actors to engage in activities that violate rights, then those policies are illegitimate.”

This argument appears to be gaining traction. A group of young Americans is currently suing the federal government for failing to address climate change, which threatens the rights of U.S. citizens. “This intergenerational injustice violates the rights of young people and future generations to life, liberty and the pursuit of happiness and property, without due process of law,” said Sophie Kivlehan, one the plaintiffs.

Polluters can only operate with the consent of the government, but Grant Township isn’t playing along. Civic leaders are now using every available tool to stop polluters. Last year, they legalized nonviolent direct action. Residents can now prevent trucks full of fracking waste from accessing the injection well. The town is nowhere near ready to back down from this fight.

“This requires an exhaustive amount of time and energy, mostly on the computer doing research, just trying to figure out who do I call, where do I get help,” said Wanchism. “You have to just keep going, because what you allow will continue if you don’t try to stop it.”