It's called the Vienna Convention on Consular Relations and the most important article in it pertaining to individuals is Article 36 which says:
1. Consular officers are free to communicate with their nationals and vice versa in a foreign country.
If you are a German visiting Canada, you have the right to talk to your consulate and the German consulate has the right to talk to you without interference from the Canadian government.
2. When a foreign national is arrested or detained, the local authorities in that country will notify his consulate that he is in their custody. That foreign national also has the right to communicate with his consulate and any messages he wants to send must be forwarded "without delay" to his consulate.
A Frenchman arrested in the UK has the right to send a message to the French consulate and the UK authorities are required to pass the message along. The UK also has an obligation to inform the French consulate that they have one of their nationals in custody.
3. The consulate has visitation rights. If one of their nationals is in prison or in police custody they have the right to visit her, talk to her and arrange for representation.
If a Japanese in France goes to jail, he has the right to be visited by someone from the Japanese consulate and the consulate can help him get a lawyer.
Finally, when the foreign national is arrested the local government is required to inform the detained foreign national of the above rights.
This is basic stuff, folks, and frankly, it's not much protection if you get into trouble while traveling or living in another country. The consulate can't get you a "Get Out of Jail Free" card, they can't stop a trial from taking place, and they can't prevent you from going to jail if you are convicted. But it's something. Generally, it is respected because, hey, no country wants to see its nationals abused while abroad. It makes the sending state look weak for one thing - if a state cannot protect its people, what good is it?
Americans might be surprised to learn that there is one modern democratic nation-state, the United States, that not only does not respect this Convention but its own citizens - American citizens - are not necessarily covered under it. This is the "protection" that we are ostensibly paying for through our tax dollars.
Surprised? Me, too.
Some examples: in 1999 Germany brought a case(LeGrand) against the U.S. for breaches of this convention before the International Court of Justice. The U.S. responded and admitted it was at fault:
"Through this inquiry, the United States confirmed that the competent authorities of the State of Arizona did not inform Walter and Karl LaGrand "without delay" that they could request that a German consular post be notified of their arrest and detention, as required by Article 31(1)(b) of the Convention. The United States of America bears responsibility for such non-performance of U.S. obligations under the Convention by Arizona. Accordingly, the United States acknowledges that, as a result of the failure to inform Walter and Karl LaGrand of their right to consular notification, there was a breach of a legal duty owed by the United States to the Federal Republic of Germany under the Vienna Convention."In 2003 Mexico brought a suit before the ICJ - Avena and Other Mexican Nationals - on behalf of 51 of their nationals for breaches of Article 36 and the ICJ ruled in Mexico's favor in 2004.
There have been other cases but they all seem to follow a pattern: local US law enforcement ignores the convention, the foreign country finds out and tries to do something, the US courts and state-level government says "to hell with that," and the US Federal government ends up apologizing. Apply, lather, rinse, repeat.
And if you think "to hell with that" is too strong, consider this: in 2008 the United States Supreme court ruled that the convention is not binding because the US Congress has not passed domestic legislation to implement it. To date Congress has still not done that with the Vienna Convention which means that it isn't enforceable in the United States and by extension it calls into question the right of Americans travelling or living in foreign countries to the consular protection of their government.
And here we go again in 2013. The state of Texas is about to execute a Mr. Tamayo. There doesn't seem to be any argument over the facts - this Mexican national was not informed of his rights under the Vienna Convention. Furthermore, the ICJ told the US to review the convictions of Mexican nationals in the US following the Avena case which nearly 10 years later, nobody has bothered to do.
All this does not seem to trouble the sleep of homeland American citizens. It should.
First of all it sends a very interesting message to foreign nationals living in or visiting the United States. Their rights under this international agreement that the US signed will not necessarily be respected. It says that the US doesn't take that convention seriously. Something everyone outside the US should think about before buying a plane ticket to Austin, Texas or Tampa, Florida.
And second, it sends a message to other countries where American citizens visit or live. If the US doesn't take this convention seriously then why should they? Do Americans really want to live in a world where they go off for a nice vacation or take a job abroad, end up in some sort of trouble (yes, it happens) and the local authorities refuse to allow them to contact the local US Embassy? The United States of America has its own "hostages to fortune" - about 6 million Americans citizens living outside the U.S. - and quite a few of them live in Mexico.
And I can hear the chorus starting up: "Do the crime, do the time" and "Why don't these people come back to the US where it's "safe"' (And I could barely type the last words of that sentence with a straight face.) I repeat, it is not about guilt or innocence which is a matter for the local courts to decide. The Vienna Convention is just about access, communication, and representation.
The U.S. Secretary of State John Kerry is well aware of the international repercussions and the potential blowback on American citizens abroad. He has written to the state of Texas asking them to tread carefully as this may impact the State Department's ability to help Americans in other countries. “Our consular visits help ensure U.S. citizens detained overseas have access to food and appropriate medical care, if needed, as well as access to legal representation." This article Who Ya Gonna Call? The Consular Notification Compliance Act by Emily Sharpe is a good summary of just how delicate this matter is and how important it is for Congress to lay this latter to rest once and for all.
Will Texas listen?
I doubt it.
Will the U.S. Congress rectify the situation by passing the necessary legislation to implement the Vienna Convention?
Not any time soon.
Which means, as a practical matter, every American who qualifies should think hard about getting a second passport - it may be the only reliable consular protection you will get if you travel, work or live outside the U.S.
(The Association of Americans Resident Overseas (AARO) has a short and sweet position paper on this matter which ALL Americans abroad should read.)