A wild move but the principles are correct

David Davis's decision to resign his seat in Parliament to contest a byelection on the issue of civil liberties has been portrayed variously as eccentricity, disloyalty and heroism. It is a combination of all three.

In crude party political terms, Mr Davis's adventure is a challenge to David Cameron. The former shadow Home Secretary competed with Mr Cameron for the leadership and has a large following in the party. While the trigger for his action was Parliament's backing for government plans to allow detention of terror suspects for up to 42 days without charge, his resignation speech covered broader terrain: ID cards, CCTV, the police DNA database, the law against incitement to religious hatred and more.

Mr Cameron might agree with Mr Davis that each of those things is offensive - in combination, they certainly represent an erosion of freedom - but he would have preferred to campaign on them at a time and in a manner of his choosing. The usurpation of that agenda by an erstwhile rival clearly compromises the Tory leader's authority.

The Labour party would like the byelection campaign to turn into a parade of attention-seeking opportunists. They might reasonably calculate that their interests are best served by not fielding a candidate, even if it means weathering charges of cowardice. Should Labour find a candidate of sufficient calibre and conviction to front a credible campaign, it would still struggle to recover its moral authority over 42-day detention. Mr Davis is right when he asserts that the opposition won last week's debate despite losing the final vote.

The government prevailed not by the deployment of brilliant arguments, but by desperate haggling with Labour rebels and Ulster Unionists involving concessions and sweeteners unrelated to the threat of terrorism. The detail of what was offered remains secret and Gordon Brown repeatedly denied last week that his slim majority was bought. But he failed to dispel the impression that an ancient right of citizens in a democracy - not to be held capriciously captive by the state - was grubbily bartered away.

Opinion polls show broad public support for the government's position on 42 days. Mr Davis hopes, and it is a decent aspiration, that a byelection campaign will change minds more effectively than parliamentary debate. But, meanwhile, the business of passing or rejecting this bad law falls to the Lords. They must heed the principled arguments that should have defeated the government in the Commons last week.