A military judge refused yesterday to drop eight of the 22 charges against Bradley Manning, the US soldier accused of leaking hundreds of thousands of classified diplomatic cables and army logs to the WikiLeaks website. Earlier the judge had ordered the government to hand over confidential documents outlining its huge damage control exercise.

The overall assessment of harm done was not made public. But the fact that the government was obliged to disclose details represented a small victory for lawyers for the 24-year-old US Army private, at a pre-trial hearing at the Fort Meade, 30 miles north of Washington. A fascinating picture emerged in court of the State Department in crisis mode. According to Rena Bitter, head of its operations centre, one group of 25 officials was set up to get ahead of the crisis, even before WikiLeaks started to publish the material on 28 November 2010. Another team tried to identify people in other countries, among them sensitive State Department and Pentagon contacts, who could be endangered by the leaks.

A third group was told to improve computer security: one of the most striking aspects of the affair has been that a humble private, working as an intelligence analyst in Baghdad, could have access to such a trove of secret material relating to areas in which he had no involvement. Marguerite Coffey, the former head of the State Department's management policy office, told the court that the department's Foreign Affairs manual "didn't contain a word such as 'thumb drive'– but now it does".

Ms Bitter said the first working group operated "24-7" from late November 2010 when it was set up until mid-December when it was disbanded. At that point, the team was still working between 12 and 18 hours a day, and producing twice-daily reports.

The second team, called the "WikiLeaks Persons-at-Risk Working Group" comprised officials from 12 to 15 State Department bureaus, Ms Bitter testified. It was created, she explained, because "it was difficult to find a mechanism that already existed" to deal with the problems generated by the huge leak, the largest of its kind in US history.

In January 2011, the State Department said it had identified "several hundred" people who might be at risk, and that a few had been moved to safer locations. And the danger is not yet over, Catherine Brown, the Deputy Assistant Secretary of State, testified. News of damage from the WikiLeaks affair could continue to surface "for many years to come", she said.

Even so, the defence hopes the assessment will show that the impact of the leaks was not as serious as first thought. That might improve Pte Manning's chances at his full court-martial, scheduled to start in September. If convicted on the most serious count of aiding the enemy – al-Qai'da – he could be jailed for life.