Many undocumented immigrants live in the United States, and it's entirely possible that you know some, perhaps without realizing it. That has led some people to worry that giving one of them a ride, perhaps in a carpool or similar situation, or even was hired as a taxi, Lyft, or Uber driver, could be a crime. We'll look here at whether that's truly an issue.
A federal law does exist that makes it a crime to transport or attempt to transport an undocumented noncitizen within the U.S., but it's meant to cover narrower situations than everyday situations like offering a ride. The law is found within the Immigration and Nationality Act (I.N.A.), at Section 274(a)(1)(A)(ii).
In order to convict someone under this section of the law, the prosecutors would need to show that:
A friend or neighbor who has been driving (transporting) a foreign-born person around, and might not even be entirely sure of their immigration status, doesn't really fit this profile. The classic situation this law is meant to address is that of a driver who picks up unlawful entrants right after they've crossed the U.S. border and takes them closer to civilization, likely motivated by profit.
In fact, not even the act of transporting undocumented workers from one job site to another is considered a crime under this section. (See U.S. v. Moreno, 561 F.2d 1321 (9th Cir. 1977). Similarly, the law is carefully written so as to avoid the possibility that a bus or taxi driver could be prosecuted for unknowingly picking up an undocumented immigrant.
There's no reason to jump to conclusions about someone's immigration status. Even an immigrant who doesn't have a green card (lawful permanent residence) might at least have temporary permission to be in the U.S., along with a work permit. Perhaps they're an applicant for asylum or some other legal status. U.S. government processing backlogs are so long that some people wait years for final decisions on immigration applications, and can in some cases work while they wait.
If, despite this description, you're still worried that the worst might happen if you interact with undocumented immigrants, you probably want to know the possible penalty for this crime. Penalties can include a fine, a prison term of up to five years, or both. That penalty goes up to a possible ten years if the driver was acting for commercial advantage or private gain, and to 20 years to life in prison if anyone is seriously injured or dies as a result of the crime.
Consult a lawyer if you feel you need more information or a personal analysis.