Agents boarded an incoming flight from San Francisco and asked for—or demanded––ID from every passenger.

The incident at John F. Kennedy Airport, where Customs and Border Protection Agents boarded an incoming flight from San Francisco and asked for—or demanded––ID from every passenger, has hit a nerve with many people—some of whom, like me, think that a demand that passengers exiting a domestic flight show “papers” would probably be unconstitutional, and definitely smacks of a nascent police state.

But others have suggested that, because the incident took place at an airport, government agents actually have the legal authority to demand ID from anyone. I researched the question further, and reached out to former government lawyers. But I still can’t find legal authority for a demand for ID from passengers on a domestic flight.

Remember the question: Can the Homeland Security immigration agents require passengers deplaning from a domestic flight to show ID? My answer is still that I can’t find any statutory authorization or any case that would permit such a requirement.

A CBP spokesperson characterized the incident as a “consensual” search—meaning, in other words, that the agents asked passengers if they would mind terribly showing ID as they exited.

Under the Fourth Amendment, law enforcement can almost always ask a person to voluntarily provide ID, or allow a search, even in situations where they can’t demand either. Unfortunately, the courts have usually held that the officers are not required to tell people they have the right to refuse. The test is whether a reasonable person would feel free to refuse. So in theory, the individual can say something like, “Am I free to go?” or just stroll away. In practice, many people are intimidated or persuaded to cooperate.

If the JFK search was voluntary, the officers did nothing legally wrong in this case. But on the legal point, as far as I can tell, there is no exception to the Fourth Amendment that would allow a demand for ID.

A searched aimed a specific individual might be a different matter. Under the Fourth Amendment, a “reasonable suspicion” that a person is involved is a fugitive, or committing a crime, or unlawfully present is enough to permit law enforcement to approach, and perhaps eventually search. That requirement—“reasonable suspicion”—is the protection Americans have against warrantless searches and seizures. Police can often detain (“seize”) and search without a warrant—if they have seen something that would lead a reasonable officer to think there’s a violation of law or evidence of crime to be found.

What they can’t do, as a general rule, is just stop or search everyone in a given area on the chance that one of them will be a criminal. The Supreme Court wrote in 2001 of its longstanding “general prohibition against nonconsensual, warrantless, and suspicionless searches.” In the case of the JFK search, CBP said that the object of the ID check was a specific named individual. (This individual was not on the flight.)

If so, why would it be “reasonable” to check everyone on the plane—a population that was probably half male and half female, ranged in age from to 8 months to 80 years, and was ethnically diverse? Could they really not know the individual’s size, sex, age, and ethnicity? If they did, but thought it was more convenient to require everyone to show papers, they were violating the Fourth Amendment—convenience is not a “special circumstance” permitting a warrantless search.

And note that the search was, according to CBP, for a documented alien who had been ordered deported. Deportation is a civil, not a criminal, proceeding. It’s hard to understand why a civil order, however important, justifies an exception to the Fourth Amendment.

An international airport, a number of correspondents pointed out, is considered in Fourth Amendment law to be the “functional equivalent of the border,” even if it is located hundreds of miles from the physical border. Officers can of course check passports and identities at a border crossing, and search any possessions of travelers, even without reasonable suspicion.

The “functional equivalent” doctrine was unveiled as an aside in a 1972 Supreme Court case called Almeida-Sanchez v. United States: “a search of the passengers and cargo of an airplane arriving at a St. Louis airport after a nonstop flight from Mexico City would clearly be the functional equivalent of a border search.”

The Supreme Court didn’t explain exactly what the words mean; but as far as I can tell, every circuit that has considered it has concluded that (as the Fourth Circuit held in a case called United States v. Laughman), “there cannot be an Almeida-Sanchez border search without some degree of probability that the vessel has crossed a border; i.e., the officials must possess some articulable facts tending to show that the vessel has recently crossed an international border.” If a passenger has just gotten off an international flight, and hasn’t gotten into the regular population yet, then a warrantless “border search” is fine; ditto when a passenger is boarding a flight out of the U.S.

But Delta Flight 1583 was not an international flight. It took off in San Francisco and landed in New York. And even if some of the passengers had entered the country just before boarding 1583, the “functional equivalent” exception applies only to their original point of entry. In fact, the CBP doesn’t allege that even the object of the search had crossed an international border. Whoever it was already had documents allowing presence in the country, and so had been admitted already.

So the “functional equivalent” doctrine doesn’t apply.

Others pointed out that airline passengers are screened by Transportation Security Officers, who look at ID and can demand to open luggage. Thus, the idea goes, anyone in the secure area has generally agreed to any kind of search or stop until they complete their flight and leave the destination airport.

TSA searches—which fall into a category called “administrative searches”––are constitutionally tolerable, the courts have said, because passengers can refuse them. Passengers have notice before they get to the airport that the searches will be conducted, and if they don’t want to furnish ID or put a bag through the magnetometer, they can go home or travel by land. In addition, finally, TSA checks are also limited to the purpose for which they are authorized by law—aviation safety. In a 1989 case called United States v. $124,570 U.S. Currency, the Ninth Circuit explained, “While narrowly defined searches for guns and explosives are constitutional as justified by the need for air traffic safety, a generalized law enforcement search of all passengers as a condition for boarding a commercial aircraft would plainly be unconstitutional.” A passenger already on a plane has no ability to turn back; and according to CBP’s account, the search had no relation to aviation safety.

Finally, people point to Supreme Court cases permitting permanent, marked, fixed checkpoints near the border, where CBP agents ask each person in passing cars whether he or she is a citizen—and direct some to “secondary screening” areas where their documents may be checked, and, if probable cause is found, the cars can be searched. According to the immigration statutes, this kind of search can be made within a “reasonable distance” of the border. The Border Patrol has interpreted that phrase as meaning within 100 miles.

But the caselaw doesn’t say that the Border Patrol can conduct any kind of search it wants at any time and any place within a “reasonable distance.” A 1975 case called United States v. Brignoni-Ponce rejected, 9-0,“roving patrols,” in which officers in cars would flag down motorists near the border and investigate the occupants at the roadside. Allowing the Patrol to randomly stop cars in those circumstances, the court majority said, would submit people near the border “to potentially unlimited interference with their use of the highways, solely at the discretion of Border Patrol officers.” The sudden, unexpected appearance of CBP agents at a domestic jetway seems to me a lot more like a “roving patrol” stop on a dark highway than a brightly lit, well established checkpoint.

To clarify again: Of course law enforcement can ask for cooperation. And they can do more than that—they can detain and search individuals if there is “reasonable suspicion” about them in particular.

What they can’t do, I think, is begin randomly demanding papers of everyone on a flight, and detaining those who refuse.

A number of scenarios have been suggested. If, for example, law enforcement had a credible tip that “somebody” on a domestic flight had a bomb or was an immediate threat, then perhaps a court would find what is called “exigent circumstances” or “special circumstances” permitting a quick check of every passenger.

But that’s not what was happening at JFK, according to CBP. The agents were searching for one particular passenger—who was wanted because he was subject to an order of deportation, not, apparently, because of immediate danger of terrorism or criminal activity. Deportation orders are civil matters—hardly the stuff of “exigent circumstances.”

Under these circumstances, I can’t see any legal precedent or authority that would permit agents to bar exit from a plane. Passengers should be free to refuse to cooperate “voluntarily.”

That’s not to say that if someone does refuse, the agents won’t arrest him or her, or take them to “secondary screening.” I think that would violate the law, but we’ve all read about the new, “unshackled” immigration enforcement policies of DHS generally. In the current climate, some federal judge might decide that “show me your papers” is permissible at airports. But so far none has; and it would be a radical and alarming change in the law if one did.