If Ecuador grants Julian Assange asylum at its London embassy, he could be confined far longer than if he went to Sweden to face questioning and possible charges there. South American countries have had a long history of granting political asylum at their embassies.

For much of the continent's history, coup or revolution was the usual path for political change. New rulers preserved their future exit options by allowing safe passage into exile for any ousted leader who made it to a brotherly South American embassy.

Outside South America, there is no similar tradition. Cardinal Mindszenty took refuge at the US legation in Budapest during the 1956 uprising and stayed 15 years in a cramped apartment before being allowed to go into exile. UK authorities are unlikely to allow Assange leave the Ecuadorean Embassy, lest the London embassies become a magnet for would-be fugitives. Scandinavian prisons have a reputation for humaneness – no bars, nice rooms, furloughs and conjugal visits – and Assange might find a short incarceration there preferable to an indefinite stay in what I presume is a relatively cramped Ecuadorian embassy.

Julian Assange's lawyer has said his client is concerned not by the prospect of sex offence charges in Sweden, but that Sweden might extradite him to the United States. There, his lawyer says, he could face the death penalty for espionage and treason. While I am no expert on Swedish and British extradition law, I have never understood why Sweden – a neutral country with a long tradition of harboring American draft dodgers and deserters – would be more likely to extradite Assange than the United Kingdom, a staunch US ally whose laws authorize prosecution of journalists for official secrets violations in a way that is not possible in either the US or Sweden.

In the United States, constitutional protections of freedom of the press are nearly absolute and this makes it almost impossible to prosecute the publisher of classified information. Earlier this month, the New York Times ran articles detailing ongoing US covert operations, including cyber attacks on Iran's nuclear program and targeted killing of al-Qaida operatives. These revelations clearly compromised US national security – presumably, both Iran and al-Qaida will now take defensive measures – but no one is calling for the prosecution of the reporter, David Sanger, or the newspaper. Indeed, Sanger is now feted on national television and his book, based on what he learned of US intelligence activities, is certain to be a bestseller.

Strategic leaking – even of the nation's most sensitive secrets – is a Washington tradition. While Republicans allege these latest leaks were done to make President Obama look good (and indeed, he appears far more aggressive than his predecessor both on Iran and in combating terrorism), the Bush administration was often reckless in its use of intelligence for partisan purposes. To its credit, the Obama administration has been serious about prosecuting leakers. In addition to prosecuting Private Bradley Manning (Assange's alleged source), the administration has launched a criminal investigation of these latest leaks and has been willing to force journalists to testify about their sources.

While the volume of material WikiLeaks released is staggering – millions of pages of classified State Department cables – it contains no intelligence reporting, and very little of what is truly sensitive. (Full disclosure: cables I wrote as ambassador to Croatia were among those leaked.) Ambassadors generally use special channels for policy recommendations, discussion of intelligence activities and for accounts of sensitive meetings with top officials. Private Bradley Manning had no access to cables in these channels, nor to intelligence reporting.

Washington's reaction to WikiLeaks was wildly disproportionate to the actual sensitivity of the material released. While one Republican congressman did call for the death penalty (Republicans have, over the years, proposed the death penalty for almost everything except overdue library books), prosecutions proceed on the basis of the law. Publishing secret documents is not against the law and other suggested criminal charges – such as conspiracy to steal US government property – have never been used against media organizations and would almost certainly fail in a prosecution of Assange.

The WikiLeaks cables cut short several ambassadorial tenures and forced some embarrassing apologies to foreign leaders. The cables also showed American diplomats to be acute observers of the foreign scene, who do not suffer autocrats or kleptocrats gladly (even when from friendly countries). In Tunisia, cables describing corruption in the Ben Ali regime helped fuel the uprising in the country that kicked off the Arab Spring.

Julian Assange may stay in the Ecuadorian embassy or go to Sweden to answer the allegations there. He will not end up in the United States. Much as US officials might want him in jail, the legal and constitutional barriers to a successful prosecution are insurmountable. There is no basis for extradition.

The State Department does, however, have discretion as to who can get a visa. Assange is not likely to get one.

• This article was amended on 28 June 2012 to make clear that Julian Assange has not had charges brought against him in Sweden