Democratic front-runner Hillary Clinton will have to be on her toes when she is finally grilled by federal prosecutors and the FBI about her email scandal because she could end up facing perjury and contempt charges if she missteps and gives the wrong answer.

FBI agents are reportedly nearing the end of their investigation into her use of an unauthorized email server, and that means the former secretary of state could soon be on the short list of people to interview.

If and when she is brought into a room to go face-to-face with prosecutors, her attorney will have one question that will set the tone for the rest of the meeting: “Will these questions relate to a criminal investigation?”

That’s when Clinton will find out what type of defense she’ll have to play.

“If she’s being asked questions about her conduct potentially being criminal, then she could plead the Fifth,” said Laura Coates, a former federal prosecutor in Washington, D.C. “It wouldn’t be the most politically savvy move, but as far as her criminal justice rights — and her constitutional rights — you’re absolutely allowed to do so.”

But pleading the Fifth Amendment to avoid self-incrimination is not a catch-all defense. If federal agents ask her whether the National Security Agency told one of her staffers about the dangers of using an unsecured BlackBerry, what can she say?

If she denies it — and a recent Washington Post story indicating otherwise is true — she perjures herself. If she admits it, that would likely give prosecutors extra ammo for an indictment.

If Clinton pleads the Fifth, investigators can continue questioning but can later have a judge determine whether she has a right not to answer.

“A judge can intervene and decide whether or not the question goes to the heart of criminal liability,” Coates said. “The judge could hold a hearing to determine whether she doesn’t have to answer any questions. Questions that are benign are not going to be the type of questions that she can’t answer.”

If a judge makes that call and forces Clinton to answer questions, another possible pitfall arises. If she continues to dig her heels in, she can be held in contempt of court — an embarrassing, and damning, pickle that could land her in jail. She could also face obstruction of justice charges.

That’s what doomed former House Speaker Tom Finneran when he claimed during a federal probe that he had little to do with a redistricting plan critics said was unfair to minorities. A federal judge found that hard to believe seeing as how Finneran was the most powerful Democrat in the state, and he eventually pleaded guilty to one count of obstruction.

When Clinton finally sits with federal investigators, there is yet another, scarier, scenario facing the former first lady. The feds could have no questions at all.

They could look across the table and tell Clinton what they know about the email scandal, and unfurl all of the evidence they’ve dredged up. That’s called a reverse proffer, and many federal defendants have gotten cold sweats as they’ve listened to the damning soliloquy.

After it’s over, the defendant can go home and think about whether it’s time to cut a deal.