On April 22, 2013, Miles J. Slack of Clay County, West Virginia made a bad decision. Slack was going through a divorce at the time and had grown concerned about his wife's relationship with an "unnamed individual." So he entered his wife's workplace after normal business hours, located her PC, and installed a tiny keylogger between her keyboard cable and her computer. The keylogger would record his wife's e-mails and her instant messaging chats as she typed them out letter by letter, along with the usernames and passwords she used for various online services. Slack left the office without getting caught.

Installing hardware keyloggers can be risky even in low-security circumstances, but Slack had made his offense far worse by installing the device on a computer belonging to the West Virginia Supreme Court. Slack's wife worked for the Clay County Magistrate Court and often had occasion to enter the financial details of defendants convicted in court—including the credit cards they used to pay their fines. Slack's bid to spy on his wife's e-mails was also vacuuming up private court information, which the government was bound to take extremely seriously if it found out.

Making the whole situation just that much worse was the fact that Slack was a cop. Not just any cop, either; Slack was the county sheriff. He had served as a Clay County deputy sheriff for 16 years and in November 2012 won an election to become the chief law enforcement officer in all of Clay County. At the time of the keylogger job, Slack had been in office only three months, and if the device were ever found, Slack stood to lose his career.

It took less than three weeks. On May 6, a Supreme Court technician was out at the magistrate office doing a scheduled replacement of many of the machines; he noticed the keylogger and reported it. When the West Virginia State Police questioned Slack about the matter, the sheriff "pretended not to know what a keystroke logger was," according to a later government court filing, "a response unworthy of a law enforcement officer."

Slack held out for several months before resigning, but eventually quit his job and pleaded guilty to a federal charge of wiretapping. Federal prosecutors, outraged that a county sheriff was essentially wiretapping the judiciary, wanted a tough sentence. Anything more modest "would erroneously equate this offense with the wiretap of a private citizen by a private citizen." But Slack argued that, stupid as his scheme was, the goal had only been his wife's information—not the court's. He asked for probation.

On December 19, Slack was sentenced to two years of probation and a $1,000 fine. "You have lost your position as sheriff, lost your career in law enforcement... That alone is enough," said Judge John Copenhaver, according to the Charleston Gazette. Slack's ex-wife requested leniency and hugged Slack after the ruling.

Update: Due to an editing error, an earlier version of this post misspelled Slack's last name. The post has been corrected.