Just as Edward Snowden was preparing to leave Geneva and a job as a CIA technician in 2009, his supervisor wrote a derogatory report in his personnel file, noting a distinct change in the young man's behaviour and work habits, as well as a troubling suspicion.
The CIA suspected that Snowden was trying to break into classified computer files and decided to send him home, according to two senior US officials.
But the red flags went unheeded. Snowden left the CIA to become a contractor for the National Security Agency, and four years later he leaked thousands of classified documents.
The supervisor's cautionary note and the CIA's suspicions were never forwarded to the NSA or its contractors and surfaced only after US federal investigators began scrutinising Snowden's record once the documents began spilling out.
"It slipped through the cracks," one veteran law enforcement official said.
Spokesmen for the CIA, NSA and FBI all declined to comment on the precise nature of the warning and why it was not forwarded, citing the investigation into Snowden's activities.
"The weakness of the system was if derogatory information came in, he could still keep his security clearance and move to another job, and the information wasn't passed on," said a Republican lawmaker who has been briefed on Snowden's activities.
Snowden now lives in Moscow, where he surfaced this week for the first time since receiving temporary asylum from the Russian government over the summer. On Wednesday night he met four US whistle-blowers who have championed his case in the United States and who presented him with an award they said was given annually by a group of retired CIA officers to members of the intelligence community "who exhibit integrity in intelligence".
It is difficult to tell what would have happened had NSA supervisors been made aware of the CIA warning.
Intelligence and law enforcement officials say the report could have affected the assignments Snowden was given, first as an NSA contractor with the computer company Dell in Japan and later with Booz Allen Hamilton in Hawaii, as well as the level of supervision he received.
The electronic systems the CIA and NSA use to manage the security clearances for its full-time and contracted employees are designed to track major rule-based infractions, not less serious complaints about personal behaviour, a senior law enforcement official said.
Thus, lesser derogatory information about Snowden was unlikely to have been given to the NSA unless it was requested. As a result of Snowden's case, two law enforcement officials said, that flaw had been corrected and such information was now being pushed forward.
The revelation of the CIA's derogatory report comes as Congress is examining the process of granting security clearances, particularly by USIS, a company that has performed 700,000 yearly security checks for the government.