Let's get this straight: the people who will change Iran for the better are the Iranians. The words of an American president at the UN general assembly in New York can't do that. European talks and sanctions can't do that. Israeli bombs on Iran's nuclear installations certainly won't do that. But the Iranian people: yes, they can.

This is what millions of Iranians set out to do, in mass demonstrations this summer; and that is what some of them are still trying to do, despite beatings, killings, torture, rape, the continued arrest of thousands of activists, and a grotesque show trial of leading reformists. There are acute limits to what democracies and democrats outside Iran can do to help Iran's "green movement" directly, but the first imperative of our policy must be to do nothing that makes their struggle for peaceful change more difficult. Be Hippocratic: first, do no harm.

President Barack Obama is right to instruct his officials to negotiate "without preconditions" on the nuclear issue. The US should have done that long ago. But European powers have been negotiating with Tehran for years, and it has not got us anywhere. While stringing us along, with the negotiating tactics of the Tehran bazaar, the Islamic Republic has been spinning ever more centrifuges – bringing itself closer to the threshold where it can decide whether or not to go for a nuclear weapon.

Negotiations should continue, but for the sake of a few more slippery promises of nuclear restraint the US and Europe must not do anything that would give a jot more legitimacy to a fraudulently elected president, Mahmoud Ahmadinejad, who celebrated last week's "Jerusalem Day" by saying that "the pretext" for the creation of Israel – that is, the Holocaust – "is false ... It is a lie based on an unprovable and mythical claim."

A textbook example of what democracies should not do was provided last year by a joint venture between Siemens and Nokia, called Nokia Siemens Networks. It sold the Iranian regime a sophisticated system with which they can monitor the internet, including emails, internet phone calls and social-networking sites such as Facebook and Twitter, much used by Iranian protesters. In today's politics of people power, that is the equivalent of selling a dictator tanks or poison gas.

So, to be clear: a German company, Siemens, which used slave labour during the Third Reich, sold a Holocaust-denying president the instruments with which he can persecute young Iranians risking their lives for freedom. Think of that every time you buy something made by Siemens.

Analysts of Iran sometimes use the image of a race between two clocks: the nuclear clock and the democracy clock. The Iranian regime has got the nuclear clock ticking faster than many in the west anticipated, despite all the negotiations and western sanctions; but the Iranian people have now set the democracy clock going in a way most western diplomats never believed they would. Many thousands of opposition supporters again turned out last Friday, together with the three most prominent reformist leaders still at liberty. More protests are to be expected when the universities reopen later this week.

This is not just a bunch of angry young people with green headbands. The Islamic regime is divided at the top, and the authority of the Supreme Leader is being questioned as never before. Pillars of the Islamic establishment such as Ayatollah Hashemi Rafsanjani are locked in conflict with Ahmadinejad and the revolutionary guards who have the Supreme Leader's ear.

The phrase "democracy clock" is perhaps misleading. Iran is not going to be a western-style liberal democracy any time soon. (But then, nor is Afghanistan or Iraq.) What is still possible, however, is a mix of reform and revolution – what I have called "refolution" – which strengthens the constitutional republican elements in the strange hybrid political system of the self-styled Islamic Republic, and weakens the Islamist revolutionary ones. At the moment, the opposite is happening. By throwing his theocratic authority behind Ahmadinejad and the revolutionary guards, Ayatollah Khamenei has tipped the scales to the Islamist revolutionary side. The best likely outcome of a "negotiated revolution" in Iran would be a decisive tipping of the scales back in the other direction: more republican, less Islamist.

This would be a better Iran for the Iranians, but would it be a better Iran for the rest of the world? Sceptics say there is little evidence that Iranian reformists would be any less militantly nationalist on the nuclear issue. A spokesman for the green movement, Mohsen Makhmalbaf, issued a statement on Tuesday saying "the Iranian green movement does not want a nuclear bomb". Opposition leaders could usefully be more specific: for example, accepting the idea of neutral international supervision of the fuel cycle in a civilian nuclear programme – on the clear understanding that this international regime would apply to all civil nuclear powers, including the US, and not just to Iran.

There are, I say again, severe limits to what democracies – and especially the US and Britain – can do directly to promote political change inside Iran. All the more important to do the indirect things better. One of these the British government has now done – funding the first-rate BBC Persian television and internet service, which in less than a year has become an indispensable, trusted source of news for Iranians.

But too direct support of the opposition from Washington or London will only give credibility to the claims which the Ahmadinejad camp and the revolutionary guards make anyway, that the reformists and green movement are tools of a plot by the Great Satan (the US) and the Little Satan (Britain) – claims that have some traction with public opinion, partly because there really was a British-American plot to topple the Iranian prime minister Mohammad Mossadeq half a century ago. Obama may have been a shade too hands-off in his reaction to the summer protests, but it was a matter of a few degrees of calibration. At the UN yesterday, he spoke of "the rights of people everywhere to determine their own destiny". Exactly so.

So we must not give any legitimacy to an illegitimate, Holocaust-denying president, for the sake of nuclear negotiations which have not yet gone anywhere. We should not put all our money on the democracy card, but nor should we put it all on the nuclear negotiation card. Every diplomatic move we make should be scrutinised for its possible impact on the fissile political process inside Iran. If tighter nuclear-related sanctions can be targeted specifically to increase pressure on Ahmadinejad and the revolutionary guards, that's a double-benefit; if military action would strengthen hardliners, that's another argument against military action.

It may be that in a year's time we have to acknowledge that the refolution in Iran really has been repressed, at least for now. In that case, we would have to deal as best we could – by negotiation, pressure and containment – with President Ahmadinejad and an Islamist revolutionary regime. But that time is not yet. The contest inside Iran is far from over. Its outcome is not up to us, but at least we must do nothing that helps the wrong side win.