The cluster of cubicles on the ninth floor of the heavily guarded building outside Washington, D.C., was like many software-development shops. Programmers—mostly men—teased each other, played with Nerf guns and griped about data backups.

But there was one major difference between this outfit and the rest of the tech industry, a former team member told a federal jury last week. These programmers were Central Intelligence Agency employees with top-secret security clearances to develop hacking tools for the CIA to penetrate the...