“The bearer was convicted of a sex offense against a minor,” it says, “and is a covered sex offender pursuant to 22 United States Code Section 212b(c)(l).”

The scary notation, which was revealed this week, is the State Department’s response to a 2016 law requiring that the passports of certain registered sex offenders include a “unique identifier” to help maintain their status as pariahs wherever they travel. Although the warning is supposedly aimed at stopping sexual predators from abusing children in other countries, it will mark the passports of many people who pose no such threat.

The “unique identifier” is mandated by the International Megan’s Law, which purports to prevent “child sex tourism,” a crime that seems to be pretty rare. From 2003 through 2009, according to an earlier version of the bill, the Justice Department “obtained 73 convictions of individuals from the United States charged with committing sexual crimes against minors in other countries” — an average of about 10 per year.

Instead of focusing on people who have demonstrated a propensity to commit such crimes, the IML casts a wide net that covers offenders who have never assaulted a child, let alone traveled to another country for that purpose.

The Americans whose passports will brand them as international child molesters include people convicted of misdemeanors as well as felonies, people who committed their offenses as minors, people who were convicted decades ago and have never reoffended, people who as teenagers had consensual sex with other teenagers, and people who committed noncontact offenses such as sexting, streaking, public urination and looking at child pornography.

At a party 15 years ago, when she was 19, Shawna Clouatre hooked up with a boy who turned out to be 14. As a result, she was forced to register as a sex offender for life, which among other things means she has trouble keeping jobs and is not allowed to take her own children to the park.

In a heartbreaking interview with documentarian David Feige, the young Oklahoma mother talks wistfully about her dreams of traveling the world, rendered impractical by the lifetime probation imposed after her youthful mistake. Even if she managed to overcome that obstacle, the passport notation required by the IML would ensure that she was viewed with unjustified fear and suspicion wherever she might go.

Last year, four sex offenders challenged the IML in federal court, claiming it violates their Fifth Amendment right to due process and the constitutional ban on retroactive punishment. The plaintiffs argued that the “Scarlet Letter” and “international travel blacklist” created by the IML will expose them and their traveling companions to harassment, impinging on their freedom to travel, to earn a living, and to visit relatives in other countries.

One plaintiff, who “was convicted of a felony sex offense involving a minor over 25 years ago,” is “an officer of a corporation with facilities and customers in Europe and Asia, and routinely travels to various countries within Europe and Asia for business purposes.” Another plaintiff, who committed a crime minor enough that he was sentenced only to probation and was initially told he would not have to register as a sex offender, will nevertheless have to carry a special passport.

A federal judge dismissed the lawsuit, saying the IML easily passes the “rational basis” test. “Under rational basis review,” she explained, “a law ‘may be over inclusive, under inclusive, illogical, and unscientific and yet pass constitutional muster.’”

Stigmatizing someone like Shawna Clouatre as a threat to children everywhere for the rest of her life may seem irrational, but that does not mean it fails the rational basis test. Even if the IML is poorly designed to achieve its ostensible goal, Congress says it will protect children, and that’s rational enough for government work.

Jacob Sullum is a senior editor at Reason magazine.