The government's top lawyer has warned that publishing his advice to ministers might leave them in the dark about the legal pitfalls of going to war.
The attorney general stands by his view that the war was lawful
Attorney General Lord Goldsmith, whose advice about the Iraq war was eventually leaked, said lawyers had to be able to talk frankly to ministers.
He was speaking to peers examining whether prime ministers should be able to go to war without Parliament voting.
Other ministers told the peers it would be unwise to give MPs a veto in law.
The House of Lords constitution committee's inquiry follows calls led by former Cabinet minister Clare Short for a new law to ensure Parliament approves troop operations in advance.
Her proposals would allow governments to go to war in emergencies without a debate in Parliament - but there would have to be a vote soon afterwards.
Lord Goldsmith's legal advice proved controversial in the run up to the Iraq conflict as anti-war campaigners questioned the legality of going to war without a new United Nations resolution.
Ministers said they were following precedent in refusing to publish his advice to the Cabinet and military commanders.
Lord Goldsmith told the committee the leak had been damaging to the "public interest", but stressed that it had not surfaced before troops were engaged.
If legal advice on war or other issues was published, there was real risk that government lawyers would be concerned not to express themselves "freely and frankly" to those they were advising, he warned.
"There is a risk they will not be told all the risks, all the dangers, all the questions that there might be, that they might want to know before taking their decisions," he said.
Lord Goldsmith said the armed forces did not want long legal advice before they went "over the top" but needed a clear yes or no answer on whether military action was lawful.
On Ms Short's law plans, Lord Goldsmith warned it would be difficult to determine which decisions were emergencies.
The courts might be brought into areas they had traditionally tried to avoid, he suggested.
Chancellor Gordon Brown has said that in the wake of the votes on the Iraq war people will expect such decisions to go before Parliament - apart from in exceptional circumstances.
But Lord Chancellor Lord Falconer told the committee Mr Brown was not advocating a new convention or law.
Lord Falconer mounted a staunch defence of the current arrangements, saying formal mechanisms would not work in the reality of military operations.
But Parliament was not powerless as it could scrutinise, question and debate decisions.
"You could not possibly go to war with Parliament against you because it is the embodiment of the people," said Lord Falconer.
He stressed that Parliament had been fully involved in the run-up to the Iraq war, including having a vote, but there had still been disagreements.
General Sir Michael Rose, who commanded UN troops in Bosnia, has suggested soldiers do not want to sacrifice themselves for a cause not fully supported by Parliament.
But Armed Forces Minister Adam Ingram told the peers troop morale was decided by whether they felt they had the right equipment, mandate and leadership.
"Soldiers will be focused on what the task in hand is," he said.