An Iraqi Shia fighter fires his weapon during clashes with militants from the Islamic State group in Jurf al-Sakhar, Iraq, on 18 August 2014. Photograph: Hadi Mizban/AP

With a general election only months away, an inevitable question applies: why is this politician saying this now? In the past 48 hours, David Cameron has made two statements to which the question applies. The first, in a Sunday newspaper article and repeated on Monday, was to thunder a “generational” warning about the danger to Britain from Islamic State (Isis). The second, in a speech to the Relationships Alliance, was to promise a “family test” at the heart of every domestic policy.

In both cases, the question invites a similar response: that part of what Mr Cameron was doing was positioning himself against Ed Miliband for a May 2015 election in which credibility as prime minister will be a central theme. In both cases, however, it is important not to be too easily beguiled. If, for example, relationships are so important that a family test should be applied to every policy, why has Mr Cameron decided to say so only now, when he has had more than four legislative years to really prove his concern? Warm words are the easy part. It is what you actually do that counts.

This applies even more to the much more serious question of British policy on Iraq. Mr Cameron’s Sunday Telegraph article was full of robust talk about clear dangers and rising to generational challenges. But it raised many more questions than it supplied answers. Mr Cameron is right to see that Iraqi instability and the rise of a barbaric form of Islamism pose an enduring and multifarious danger at home and abroad, not least to Islam itself. He is right to speak for the humanitarian obligation towards the victims of Isis, and to offer appropriate military support to Isis’s opponents. He is right to set this in the context of the Iraqi state’s instability, the regional implications and the global terrorist threat.

Yet, once again, the warm words are the easy part. Uniting them into a coherent and consistent policy which balances what Britain can credibly do, or might dream of doing, is more problematic. Here Mr Cameron is vague and even contradictory. As such, he reflects British public opinion, which is torn between the fear that nothing in this arena seems to work and the instinct that nevertheless something must be done. That ambivalence is framed by the humiliating experience in Iraq after 2003 and came to a head most recently in the reluctance to engage in Syria just 12 months ago.

A timely ComRes/ITN poll on Monday underscores the conflicted mood. By a large majority, the public recognises a moral obligation on Britain and the US to put right in Iraq what they did so wrong in 2003. Yet the public cannot agree on what this might mean. Opinion is divided over arming the Kurds and opposed to Iraqi refugees of any faith finding refuge in Britain. Only 30% say Britain “should not get involved and leave the situation to run its course”; but the opposing majority is divided between helping to defeat Isis in its entirety and trying to stop it making further gains.

As an election nears, opinion polls matter more than ever to politicians, especially in a tight race. So this public ambivalence about Iraq will register. For the moment, Mr Cameron is doing some right things: humanitarian aid to refugees, readiness to help arm the Kurds, support for US air attacks which do not threaten civilians, helping to mobilise the regional powers and working through the UN; there may also be a role for special forces operations that observe legal norms. One big danger is that, amid uncertainty, politicians will talk a bigger game than they can play. Another is that they will channel public anxiety into illiberalism at home (popular with many voters) and away from even limited engagement abroad (unpopular with many voters).

Mr Cameron and his rivals need to recognise the seriousness of both the immediate and the long-term crises in Iraq. But they need to do this while simultaneously avoiding Tony Blair’s hubris in 2003 and Mr Cameron’s own miscalculations in 2013. The situation in Iraq is very threatening. But Britain is only one of many countries under threat. We should speak very carefully and carry a proportionate stick.