A year ago, I was finalizing plans to leave a chemical engineering Ph.D. program and join the tech sector. But as Inauguration Day approached, I became so disgusted by President-elect Donald Trump’s behavior that I felt it would have been negligent to remain a bystander. So I traveled from Baltimore to join hundreds of thousands of protesters at counterdemonstrations around Mr. Trump’s swearing-in.

Little did I know that I would be swept up into a legal nightmare that demonstrates how prosecutors intimidate and manipulate defendants into giving up their rights.

Minutes after I got to downtown Washington on Jan. 20, police officers used pepper spray, “sting-ball” grenades and flailing batons to sweep up an entire city block in a mass-arrest tactic known as “kettling.” I was among the more than 230 people confined at 12th and L Streets with no access to food, water or bathrooms for up to eight hours.

That much can be gleaned from public legal filings connected to our criminal prosecutions, as well as a lawsuit filed on behalf of me and three other plaintiffs by the American Civil Liberties Union. (One of this case’s many paradoxes is that I’ve been advised not to talk publicly about what happened before my arrest.)