On Thursday, a federal judge must decide whether Jeffrey Epstein will be detained pending his trial in Manhattan on alleged sex trafficking and other charges.

Federal defendants like Epstein have a right to bail which flows from two legal sources. First, the Constitution’s Eighth Amendment prohibits excessive bail. More recently, the Bail Reform Act of 1984 (BRA) requires a court to release a defendant subject to the least restrictive conditions that will reasonably assure the defendant’s appearance and the safety of others.

Even though the law expresses a preference for release, the law contains several exceptions — and exceptions to those exceptions. The law requires detention if, after a hearing, the judge concludes that no condition will reasonably assure the defendant’s appearance and the safety of the public.

If there is probable cause that the defendant committed one of several egregious crimes, a “rebuttable presumption” arises that the defendant is a flight or safety risk. Epstein is charged with sex trafficking, which is one of these “presumption” crimes.

Because Epstein’s is a “presumption” case, he then has a burden to rebut that presumption by providing some evidence that he does not pose a danger to the community or a risk of flight. Epstein has certainly provided an abundance of evidence he thinks proves he’s not a danger, offering a 14-point plan he says assures his home is a “jail” of his own construction.

The accused financier’s considerable wealth certainly helps him with this claim. Few other defendants could promise the court installation of surveillance cameras at the front and rear entrances of his home; GPS electronic monitoring; a massive bond secured by a mortgage on his Manhattan residence, valued at roughly $77 million; and the appointment of people to live in Mr. Epstein’s residence and report any violation to the Court.

When the defendant offers such evidence, the presumption favoring detention does not completely vanish, but it is reduced to just another factor for the court to consider.

Even in Epstein’s high-profile case on such serious charges, however, the prosecution retains the ultimate burden of persuasion — by clear and convincing evidence — that the defendant presents a danger to the community, and — by the lesser standard of a preponderance of the evidence — that the defendant presents a risk of flight.

This is the ultimate question the judge has to answer: Has the government met the burden to show that Epstein is more likely than not to flee? Or, has the government established that it is highly probable that he is a danger to others?

Conversely, prosecutors say his wealth is precisely what makes Epstein a flight risk, citing items found at his home: jewels, $70,000 in cash, and, strangest of all, an expired passport issued by another country bearing Epstein’s photo but a different name.

Most criminal defendants have limited funds or no funds at all. That’s partially why the Bail Reform Act was passed: to help ensure courts grant bail, but not set it so high that it effectively denies bail for people without a lot of money. The Bail Reform Act doesn’t really address situations where defendants have fabulous wealth.

Epstein’s money allows him to build his own secure, staffed, high-tech fortress for house arrest — something other defendants can’t do. His money allows him to virtually guarantee that he will not leave his house and that no potential victims can visit him. By doing that, he is the rare defendant who could pay enough to overcome the presumption against him and provide the assurances possibly warranting his release under the law.

Is that fair? It’s not a question answered by the Bail Reform Act. Even if the judge finds Epstein’s charged conduct to be deplorable, it’s possible that he may also find that Epstein has rebutted the government’s case for detention, and give him house—or “mansion”—arrest.