Activists on the left in roughly 200 states, counties, and cities have enacted provisions to limit their participation in federal immigration enforcement. Not to be outdone, conservatives have persuaded some states to bar political subdivisions from enforcing selected state or federal firearm laws. What, then, are the constitutional principles that control the relationship between federal, state, and local governments?

Most important, of course, there’s the Tenth Amendment. It provides that the federal government has only those powers specifically enumerated and delegated. All other powers are reserved to the states or to the people. After the Civil War, the Fourteenth Amendment vastly expanded federal authority by allowing federal intervention whenever states violate our rights to due process and equal protection. Additionally, whenever federal and state laws are in conflict, Article VI of the Constitution provides that federal law is supreme and “Judges in every State shall be bound thereby.”

Note, however, that the Supremacy Clause binds judges, not state legislatures. So, can state legislatures nullify federal law? No, they cannot. The Framers assigned that task to the courts, not state legislatures. In Federalist no. 78, Alexander Hamilton wrote that courts have the duty “to declare all acts contrary to the manifest tenor of the constitution void.” James Madison, in his Report of 1800, wrote that state “declarations … are expressions of opinion, [intended only for] exciting reflection. The expositions of the judiciary, on the other hand, are carried into immediate effect.” Three years later, in 1803, Chief Justice John Marshall settled the matter in Marbury v. Madison: “It is emphatically the province and duty of the judicial department to say what the law is.”

Imagine if state nullification were permitted. Chicago’s gun ban would still be in effect. Orval Faubus could have blocked Arkansas school integration. Virginia could bar interracial marriages. Texas might still be jailing gay people for having consensual sex. Plainly, states cannot nullify federal law. But that doesn’t resolve the sanctuary question. We also need to know whether states or localities are required to enforce federal laws or enact matching laws.

The answer on both counts is no. In the 1997 case Printz v. United States, the Supreme Court ruled that the federal government cannot commandeer state law enforcement authorities to conduct background checks on handgun purchasers. In the 1992 case New York v. United States, the Court ruled that Congress cannot force the states to enact specified waste disposal regulations. On the other hand, neither of those holdings meant that a state or locality could impede federal enforcement of federal laws.

The federal government has the authority to enforce its own laws using its own law enforcement personnel. And individuals are not exempt from prosecution by the feds merely because the state or local area where they reside asserts that a law is unwise or even unconstitutional. There is no clause or implied power in either the national or various state constitutions that enables states to prevent federal enforcement.

That raises one final question: If a state, locality, or individual deems a federal law to be invalid, what redress is available? Because the courts have the last word, the proper remedy is a lawsuit challenging the suspect federal rule. Similarly, if an individual believes that his or her rights are violated by a state’s nonenforcement, that individual can sue the state government. Then the courts will determine who is right.

To summarize: First, state officials need not enforce federal laws. Second, Congress cannot mandate that states enact specific laws. (Those two principles are now front and center as some states legalize marijuana despite the federal Controlled Substances Act and some states resist the federal push to expand Medicaid.) Third, states may not block federal officials from enforcing federal law—except when courts have held that the law is unconstitutional.

From a libertarian perspective, sanctuary legislation—even when it’s soundly structured and properly implemented—should operate as a one-way ratchet. States and localities can always protect our rights more rigorously than the federal government, but they cannot compromise rights that are secured under federal law. The U.S. Constitution sets a floor, not a ceiling, on individual liberty.