John Rentoul: If Ed is a gift to Dave, he's a Trojan horse

The PM should be wary – the new Labour leader could steal his Lib Dem pals and expose the harshness of his cuts

David Cameron's worst-kept secret is that he was delighted by Ed Miliband's election as Labour leader last weekend. Yet politics is a strange business, and he should keep an open mind about the how the new alignment might work out. The PM knows that the way in which the new Leader of the Opposition was elected gives him some easy lines when the House of Commons resumes next week. The younger Miliband lost among Labour MPs and party members, and won the leadership through an expensive campaign by the big trade unions to mobilise their members.

Cameron knows that anyone going into a contest as the heavily fancied favourite has to beware the unexpected. Five years ago, he was taken for granted by the front-runner, David Davis. Like Ed Miliband, he did some pretty opportunistic things to win, notably telling Eurosceptic MPs what they wanted to hear. More recently, he ran into an image problem in his encounters with Gordon Brown at Prime Minister's Questions, the sketch writers calling him a "public school bully" and "Flashman". In the end, Brown managed to bring the contest to a close on more equal terms than most people, including Cameron himself, had expected just six months before.

We know two things about how the general public will view the early clashes between Cameron and Miliband. One is that they know next to nothing about the new Labour leader; the other is that they tend to give a new face the benefit of the doubt. Cameron finds himself in a similar position to that of Tony Blair when, as Prime Minister, he faced his fifth and last Conservative leader.

Cameron's own arrival at the despatch box to which Ed Miliband will step up next Wednesday prompted furious discussion in Blair's office and between Blair and Brown. Blair took a "wait and see" approach, feeling his way to Cameron's weaknesses, sizing up his new opponent. Many Blair advisers, having read books about American politics, knew that it was a priority to "define your opponent before he can define himself", and urged him to paint Cameron as a Thatcherite, Norman Lamont's adviser and a public relations man.

Brown agreed with them. The most vivid image from the House of Commons in those days was of Brown almost pulling at Blair's arm, his body language shouting: "Let me at him!" But Blair understood the danger of seeming too nasty about his untested foil. When Brown got the chance, he called Cameron a "salesman", which came across as elitist, and then tried the "playing fields of Eton", which backfired because people thought Cameron was polite.

One thing most voters do know about Ed Miliband is that he did his brother in. For those of us familiar with the familial story line for longer, the disapproval that this provokes has been unexpected. Even Ed Balls concurred with it last week: "I don't think I would have stood against my brother in the first place." But it is hard to see how Cameron might exploit it, and it is likely to fade quite quickly, possibly leaving behind the residue of a perception that Ed is no pushover.

Similarly, the broken mandate of the younger Miliband's defeat in two of the three parts of Labour's electorate will cease to matter, on the George Bush principle, established after the hanging chads of Florida a decade ago.

Journalists, especially those who attend party conferences, tend to overestimate the importance of leaders' speeches. It was an indifferent speech, but carried a simple message that Labour was moving on from the past. More important, perhaps, was Miliband's long interview with Jeremy Paxman on Wednesday night, not because many people were watching but because it showed that he can sail through that kind of media test with the kind of unrufflable charm that helped get Cameron where he is today.

Where Ed Miliband is vulnerable is on competence. Cameron needs to expose the uncosted economics of the "living wage" policy, for example, rather than accuse him of being the unions' stooge. It should not be too difficult for Miliband to shake off the "prisoner of the unions" tag – witness his call to the BBC unions to keep the plugs in the sockets this week – while retaining a basic posture of being on the side of people who are worried about their jobs.

Miliband has already shown the kind of opportunism that could make him a threat to the coalition as it finally starts to enter the upper atmosphere of the public spending cuts story. We are still in the phoney-war phase of knowing that really serious stuff is about to happen, but meanwhile interest rates are low, tax rises have hardly been noticed and most of the population is better off than ever. The past two years have not been great for the 800,000 people added to the unemployment total, but the rest of us have never had it so good while feeling so bad.

Even the Comprehensive Spending Review, 17 days away, will consist of more announcements of big decisions to take effect later. Not until January, when VAT goes up, and April, the start of the first financial year of deep cuts, will the real story begin.

Then the test for Miliband begins. As one Cabinet minister told me, "If we falter he won't say, 'Cutting's really difficult; anyone could have got it wrong.' The forces of Balls will be unleashed against us."

Who is to say that a Labour leader with a basically leftish tilt, against a coalition finally making deep cuts, is going to be unpopular? Who is to say that he doesn't face a strategic opportunity at the next election, when that coalition includes the Liberal Democrats, who have an "itch to switch" to working with Labour? Not just because they feel an ideological closeness but because they want to stay independent by avoiding being glued to one party for too long.

One of the most intriguing things about Cameron's speech this week is how he will deal with Ed Miliband, a box marked Handle With Care.

Follow John Rentoul on Twitter: