Seth Joel/Getty Images Detail-oriented and anxious, he’s the right guy to pore over intelligence reports and the wrong guy to take a polygraph.

WASHINGTON ― Logan tried to stay calm as he boarded the subway to take the one-mile trip from his office at FBI headquarters to Patriots Plaza. He could have walked, but he didn’t want to risk getting sweaty or disheveled before his polygraph examination.

There was nothing to worry about, Logan told himself. During his 11 years as an FBI intelligence analyst, he had already passed two polygraphs ― one when he was hired in 2003 and another in 2008. The bureau administers polygraphs to potential hires and then reinvestigates its employees every five years throughout their employment.

But as he headed to Patriots Plaza that morning in September 2014, Logan (whose name has been changed to protect his identity) couldn’t stop thinking about his polygraph results from the year before. His anxiety had taken over, and the test caught physiological reactions in response to national security questions. The examiner accused him of lying and attempting to cheat the polygraph. Logan denied both charges. The FBI scheduled a retest.

This time would be different. It had to be different, or he could lose his security clearance and his job.

But the 2014 retest got off to a bad start. Logan felt a panic attack set in as soon as the exam began. He focused on steadying his breathing and restoring his calm.

Logan’s attempts to quiet his nerves backfired. The polygrapher accused him of using a “countermeasure” ― a poorly defined term for deliberately altering one’s physiological state (by, say, sticking a thumbtack in one’s shoe) in order to hide lying on a polygraph. Logan denied the charge, but after several hours under pressure, he amended a written statement to include self-incriminating phrases he alleges were fed to him by the polygrapher. That statement was later used against him when the FBI revoked his security clearance, effectively putting him out of work. Logan appealed.

After nearly two years without pay, he is still trying to regain his clearance.

Nobody wants to be the one to miss the next Snowden. A current FBI employee

Polygraphs, often erroneously referred to as lie detectors, aren’t a foolproof means of determining whether someone is telling the truth. They detect changes in a person’s physiology ― pulse, blood pressure, breathing rate, perspiration. But those changes aren’t always a sign of dishonesty. That’s why many jurisdictions ban polygraph results from being used as evidence in court.

Because polygraphs are unreliable, the FBI isn’t supposed to use them as its sole justification for firing an employee. The bureau told the Justice Department's inspector general in 2006 that it had never fired an employee solely on the basis of polygraph results.

But Logan’s story ― confirmed by the FBI’s investigative file and his appeals paperwork, which his lawyer provided to The Huffington Post ― shows that the bureau has found a clever way to evade this restriction. Instead of disciplining employees for failing polygraphs, the FBI can accuse them of using countermeasures and punish them for that. In Logan’s case, the FBI relied exclusively on countermeasure allegations to cut ties, without proving he did anything wrong.

Richard Gunion/Getty Images Every five years FBI employees with high-level security clearances must take a polygraph test.

“Accusing a test subject of using countermeasures may be a method of avoiding the requirement to find any independent evidence of misconduct and base an adverse decision solely on the polygraph process,” Sen. Chuck Grassley (R-Iowa) wrote to the Justice Department’s inspector general earlier this year. The Senate Judiciary Committee chairman referenced Logan’s case.

Firing an employee for allegedly using a countermeasure is arguably even more subjective than firing the person for failing a polygraph. Unlike polygraph results, which have some scientific basis, there is no physiological indicator to show that somebody is using a countermeasure.

An FBI spokeswoman declined to comment specifically on Logan’s case in answer to HuffPost’s questions, but said broadly that the polygraph is “one of many tools” used to determine if a person is eligible to handle classified information. “Such determinations are not based solely on the result of a polygraph examination,” she said.

The FBI’s allegations of countermeasure use have increased noticeably in recent years, according to current and former bureau employees. Internal FBI documents and correspondence with its congressional overseers show that the bureau only started tracking alleged employee countermeasures in late 2013 ― just after whistleblower and former National Security Agency contractor Edward Snowden leaked secret documents about the government’s domestic spying capabilities, sparking a scramble to tighten security within the law enforcement and intelligence community. In fiscal year 2015, the FBI accused at least 15 employees of using countermeasures on polygraphs ― more than twice the number it had reported the entire previous year.

The FBI is in a tough position, said a current employee, who requested anonymity to speak about his employer. “Nobody wants to be the one to miss the next Snowden.”

Bobby Yip/Reuters In 2013, former NSA contractor Edward Snowden leaked thousands of pages of classified information about U.S. government surveillance and fled the country.

Logan’s interest in working with the FBI was prompted by the 2001 arrest of Robert Hanssen, a double agent who sold U.S. secrets to Russia for 15 years while working for the bureau.

Once it became clear that a closer look at Hanssen’s financial records could have tipped off the bureau to his activities, the FBI began recruiting financial intelligence analysts. The work was a perfect fit for Logan, who, just a few years out of college, had lost his job at a bank in New York amid massive layoffs after the 9/11 attacks. He joined the FBI in 2003.

Although he never felt discriminated against at work, Logan, who is ethnically Chinese, believes there’s an extra level of suspicion within the notoriously homogeneous FBI about employees of Chinese, Russian or Arab descent. At some point ― Logan doesn’t know when, and the FBI won’t say ― the bureau put Logan on an internal surveillance program that some employees have told reporters amounts to institutionalized racial profiling, Grassley noted in his letter to the inspector general.

Meticulously detail-oriented, Logan has the right personality for an intelligence analyst ― and the wrong personality for a polygraph.

“I am a Type A person and tend to worry about the smallest thing, like ‘taking a pen from the supply room,’” Logan wrote in his appeal to reinstate his security clearance. He had never received any type of disciplinary notice from the FBI ― not even for minor infractions like failing to lock his computer when he went to the bathroom, his lawyer said.

“Ironically, the people who are very conscientious and are really trying to answer the polygrapher’s questions honestly are really the ones that seem to have the most problems,” the current FBI employee said. This employee has undergone three polygraphs with the bureau. On at least one occasion, he thought he was going to fail because of his own anxiety. “You’re running through your mind all these scenarios that have happened in the last five years. … You’re thrown into this cycle that’s very stressful.”

I am a Type A person and tend to worry about the smallest thing, like ‘taking a pen from the supply room.' Logan, in his appeal to reinstate his security clearance

It’s almost impossible to tell the difference between someone who is trying to cheat a polygraph and someone who is just trying to control anxiety about failing. “It is quite plausible and probable that an innocent examinee will respond to the consequences of being labeled a liar, rather than fear of detection of being caught in a lie,” former FBI special agent and prominent polygraph critic Dr. Drew Richardson wrote in a statement included in Logan’s appeal.

Despite these hurdles, Logan passed his 2008 polygraph. But he ran into trouble during the next test in 2013, and the FBI told him he had failed.

Logan believes the physiological spikes on his 2013 polygraph were caused by “internal anxiety” about a several-year period when he was deployed on joint duty to the Office of the Director of National Intelligence’s Advanced Research Projects Activity (IARPA) and sometimes briefed private companies.

Before that assignment, Logan wrote in his appeal stateme, he had no experience briefing outside organizations that work with the intelligence community. He denied divulging any classified information during those discussions, but wrote that his lack of experience caused him to worry whether he had ever “said too much,” even while following the agency’s guidelines.

The FBI’s internal reporting on the 2013 polygraph contradicts Logan’s account. He “admitted he intentionally neglected to disclose that he ‘may’ have provided classified information regarding functional capabilities the FBI required for financial anomaly detection systems during ‘capability briefs’ conducted in the presence of individuals who did not possess security clearances,” the bureau alleged.

Because the FBI didn’t include a transcript of the polygraph interview in Logan’s investigative file and doesn’t videotape the interactions between examiner and examinee, it’s Logan’s word against the FBI’s.

After Logan failed the 2013 test, the FBI scheduled a retest for the following year. As it approached, he told a friend he was nervous. He had the same concerns about his time working at IARPA. He fretted that his anxiety would trigger another false positive.

Pablo Martinez Monsivais/Associated Press Under FBI Director James Comey, the bureau's allegations that its own employees are using countermeasures have risen.

Logan arrived at Patriots Plaza on Sept. 24, 2014, on time for his 9 a.m. polygraph, but the examiner didn’t take him until 20 minutes past the hour. The examiner told Logan he had been briefed by the person who conducted the previous test. Logan suspected this violated FBI rules meant to limit the polygrapher’s bias, but contends the examiner ignored his questions.

In 2013, the FBI had asked Logan to sign a consent form that made a passing reference to countermeasures. By the time he was retested, the FBI had updated its form to include a longer, bolded clause about countermeasures that warned employees they could lose their security clearances if they tried to cheat.

The test took place in a small room, with a long desk and two chairs. Fluorescent lighting illuminated the room’s white walls ― troubling to Logan, who has an eye condition called aniridia that makes him especially sensitive to light. (The FBI gave him the option to close his eyes.)

To Logan, it seemed that the polygrapher was intent on twisting his efforts to tell the truth and demonstrate his allegiance to the U.S. into evidence of dishonesty and dual loyalty.

Logan told the polygrapher he had read a 2003 government-commissioned report about polygraphs and countermeasures. He wrote in his appeal that he read the report for work. But the examiner accused him of reading up on ways to cheat the test.

“It borders on axiomatic that a U.S. Government commissioned report would not be a likely repository” for information on how to beat a polygraph,” Mark Zaid wrote in his client’s appeal. Zaid is a Washington, D.C.-based attorney who specializes in national security law and represents Logan.

When Logan spoke with pride of his father’s 30 years of government experience in national security positions, the polygrapher asked if he was “part of some father and son spy ring.” The suggestion left Logan unnerved and wondering if it was a jab at his Chinese ancestry.

“These types of remarks, as you can guess, did nothing to keep my anxiety at bay,” Logan later wrote. Once the tubes to measure breathing were wrapped around his torso, his lungs tightened, his chest constricted and he struggled to breathe. He described his symptoms as feeling like the onset of a panic attack.

The polygrapher asked if he was 'part of some father and son spy ring.'

“The more I thought about it, the more my breathing became pronounced in my own mind and distracted my attention from the test itself,” he wrote.

Over the next hour, the polygrapher conducted six to eight “runs” of the same series of questions in different orders before telling Logan he had failed. The polygrapher also accused Logan of having visibly “labored breathing,” he recalled, and told him to write down what he believed had happened.

Logan initially pushed back, fearing a written statement would be interpreted as a confession of wrongdoing. But the polygrapher pressed him, warning that his alleged attempts to “counter the test” were so bad that the FBI could revoke his badge immediately.

The examiner left the room, and Logan wrote what he described as a two-page play-by-play of the previous hour, including descriptions of his physical reactions and why he thought they had occurred. He denied trying to cheat the polygraph.

When the examiner returned 10 to 15 minutes later, Logan recalled, he took a quick look at the statement, crumpled it up, tossed it across the desk, and said it was too technical and difficult to understand.

Logan assumed that this tossing aside of his statement was just for show. Surely it would be smoothed out and added to his investigative file, he thought. (The FBI’s internal report says that Logan’s first statement was “very scientific” and hard to understand, but makes no mention of the examiner crumpling the paper and throwing it aside.)

The polygrapher instructed him to start over ― but this time, Logan recalled, the polygrapher would stay in the room and help him come up with the right phrasing. A combination of fatigue, fear of appearing uncooperative and hope that the examiner really wanted to help him led Logan to comply.

In his appeal, Logan wrote that the polygrapher repeatedly pressured him to admit that he had used a countermeasure and to include the phrase “favorable outcome” in his statement. Intentionally altering one’s breath counts as a countermeasure, the examiner told him. Logan objected to this definition as “overly broad,” since he was not trying to trick the test.

He eventually agreed to add a “clarification” note at the bottom of his second statement that read: “To prevent an over-reaction to questions, I concentrated on slowing my breathing and tried to clear my mind of any thoughts to focus the question at hand. I did these on ‘negative’ or ‘scary’ questions which were the national security ones. This occurred on both the 2013 + 2014 tests. … I used the calming technique hoping for a more positive outcome.”

After further prodding, Logan added another note, apologizing to the examiners for both tests. “My actions were deliberate as a way to make the outcome of today’s test positive and prove/communicate … that I did not commit any national security activities,” he wrote.

The FBI’s internal report makes no mention of the polygrapher pushing him to add specific language to his second statement.

In hindsight, Logan knows his actions seem naive. It’s obvious to him now that the examiner was trying to elicit a confession. But he talked himself into believing that, since he was a 11-year employee of the FBI, he and the examiner were on the same team.

Logan left Patriots Plaza close to noon, feeling defeated. As he walked back to the metro station, he ran through everything he should have said and done differently. He could have gotten more sleep. Maybe he should have had less coffee. He had planned to go back to work after the exam but knew he wouldn’t be able to focus, so he headed home.

You engaged in the use of countermeasures during polygraph testing in an effort to alter the outcome of the examination. The FBI's security division, in a letter to Logan

With time, the sinking feeling that he was about to lose his job faded. By Christmas, Logan was feeling optimistic. But after the holidays, his supervisor called him in and handed him a letter from the FBI’s security division accusing him of trying to cheat the polygraph.

“You engaged in the use of countermeasures during polygraph testing in an effort to alter the outcome of the examination. Your conduct calls into question your trustworthiness, reliability, and judgement, and warrants the suspension of your clearance at this time,” the letter read.

His top secret security clearance was suspended immediately, pending further investigation. After a two-month review, the FBI upheld that decision, again citing Logan’s alleged “documented use of countermeasures during polygraph testing.”

When the bureau turned over its 150-page investigative file, which included multiple copies of the same documents, Logan couldn’t find a copy of his first, uncoached statement.

The FBI’s internal write-up of the 2014 polygraph says the first statement “was scanned and made a part of this polygraph file.” The bureau spokeswoman declined to comment on whether throwing away an examinee’s written statement would violate FBI policy.

Logan’s lawyer submitted an appeal in October 2015. The FBI is not required to respond to appeals within a specific timeframe. For months, it was silent and Logan wondered if officials were waiting for him to run out of money or patience and quit voluntarily.

Finally, in September 2016, the FBI told Logan’s lawyer that it had rejected his request. Earlier this month, Logan’s lawyer filed paperwork for his final appeal, a hearing before three officials from the Office of the Attorney General. Their decision is final.

Getty Images Polygraphs measure changes in a person's pulse, blood pressure, breathing rate and perspiration. But a change in any of those doesn't necessarily mean someone is lying.

The FBI didn’t always subject its employees to polygraph tests. The bureau used to be one of the most vocal critics of using the test as a screening tool, said Michael German, a former FBI special agent who is now a fellow at the Brennan Center for Justice. But it “completely flipped” after the 2001 arrest of Hanssen ― the double agent whose deceit also prompted Logan’s career change ― and added polygraphs to the reinvestigation process.

“That was actually quite controversial at the time,” German said. “It did not produce scientifically rigorous results that would allow it to be used as evidence [at trial]. So if we can’t use it as evidence, why in the world would we want an FBI agent to lose his or her job over it?”

The shift was typical of the government’s response to leaks, Zaid said. “React with a sledgehammer when you need a laser.”

Critics of the polygraph note that while it can be a useful tool in pushing suspected lawbreakers into confessions, it wasn’t designed for mass screenings of people who aren’t accused of wrongdoing. Even where there is suspicion of wrongdoing, the test can elicit a false positive.

Richardson, the polygraph critic who died in July, wrote in Logan’s appeal that the false positive rate could be as high as 50 percent. Subjecting FBI employees to the test, he declared, forced them to play “statistical Russian roulette.”

If we can’t use it as evidence, why in the world would we want an FBI agent to lose his or her job over it? Michael German, a former FBI special agent

As for countermeasures, the only way to know if someone is trying to subvert the test (shy of a shoe full of tacks) is for them to admit doing so, said Thomas Mauriello, who oversaw polygraph exams at several government agencies, including the NSA. “Anything short of that is guess work by the examiner,” he wrote in a statement on Logan’s behalf.

“When anyone is faced with failure, it is normal to do whatever they can to help the process show the truth,” Mauriello added. “Sometimes attempting rhythmic breathing during the test and trying to clear your mind of anything that may be causing negative reactions helps the subject be successful.”

It is the polygrapher’s job to know the difference between innocent anxiety and attempted deceit, Mauriello wrote. “[Logan’s] admission of any of these actions does NOT constitute ‘countermeasure.’”

The current FBI employee said that when he was hired in 2004, the examiner made no mention of countermeasures. During his first retest in 2009, the polygrapher mentioned countermeasures only briefly. But in his most recent test in 2014, the examiner specifically asked if he had researched ways to beat the polygraph.

Andrew Harrer/Bloomberg via Getty Images Sen. Chuck Grassley pushed the Justice Department's inspector general to look into the FBI's use of countermeasure allegations.

When Grassley pressed the FBI last year for information about how it proves the examiner’s “subjective observation” that countermeasures were used, the bureau failed to point to any scientific indicators. If an employee is suspected of using countermeasures, the FBI wrote the senator, it confronts the employee directly, offers a retest and refers the employee for additional investigation.

But “absent finding a nail in somebody’s shoe or finding a search on somebody’s computer that they were looking up things to defeat the polygraph, you’re getting into looking at a crystal ball and saying, ‘Well, I think you were using a countermeasure,’” said James Wedick, a retired FBI special agent.

In its letter to Grassley, the FBI didn’t cite any evidence that it had ever proved that an employee actually used countermeasures. It said only that it had never proved that an employee accused of using countermeasures was innocent.

After prompting from Grassley, the Justice Department’s inspector general initiated a review of how the FBI identifies attempted use of countermeasures and the punitive process that can follow.

The inspector general’s findings probably won’t come in time to help Logan. As long as he’s in limbo at the FBI, he can’t work at another government agency ― and because of potential conflicts of interest, he can’t take many private sector jobs for which he would be qualified. If he loses the final stage of his appeal, he’s worried about transitioning into a new field because most of his professional experience involves work that requires a security clearance.

None of that matters to the government, Zaid said. The government’s mindset, he said, is that “we can sacrifice 99 innocent people to get that one guilty person.”

Did you lose your security clearance because you were accused of using countermeasures on a polygraph? Email me: jessica.schulberg@huffingtonpost.com

Sign up for the HuffPost Must Reads newsletter. Each Sunday, we will bring you the best original reporting, longform writing and breaking news from The Huffington Post and around the web, plus behind-the-scenes looks at how it’s all made. Click here to sign up!