WASHINGTON — In the months after President Trump was elected, Reality Leigh Winner frequently expressed outraged political views about him on social media, in between photos of her cats and favorite quotations. But on the afternoon of May 9, she posted an unusually anodyne message on Facebook, noting that she would be teaching two yoga classes that evening.

She was harboring a secret, prosecutors say. Hours earlier, Ms. Winner, a 25-year-old former Air Force linguist who in February took a contractor job at a National Security Agency eavesdropping center in Georgia, printed out a top-secret intelligence report detailing Russian meddling in the American election and ferreted it out of the secure complex.

Days later, she would mail the file to a reporter at the national-security news outlet The Intercept. By the time the site published the document on Monday, Ms. Winner was already under arrest — undone by a trail of clues that quickly led investigators to her. Ms. Winner, who the F.B.I. said confessed when confronted, is now the defendant in the first criminal leak case of the Trump era.

Her case was a reminder of the vast universe of people who have access to government secrets, largely because of the expansion of security agencies in the years since the Sept. 11 attacks. About four million people, both government employees and contractors, hold security clearances, including 1.3 million with top secret clearances like Ms. Winner’s.