Cyber experts with top security clearance at the CIA fought each other with rubber bands, fired foam darts across the office and devised childish pranks to humiliate their colleagues, a court in New York has heard.

In scenes more reminiscent of The Office than Mission: Impossible, CIA employees in the Engineering Development Group – working in a secret building, protected by armed guards while they designed hacking tools including malware that targeted the computers of suspected terrorists – larked around and scrapped with each other.

One man, named only as Michael, told how a rubber band fight escalated into fisticuffs, with the two CIA employees wrecking each other’s desks and punches being thrown.

Another, with the pseudonym Jeremy Weber, told how, when he left his computer open, an email was sent from his account to all his colleagues, confessing to all that he was an idiot.

The revelations have come during the trial of CIA programmer Joshua Schulte, which began on February 3.