Recent evidence shows that the collaboration between the NYPD and CIA, which turned the NYPD into one of the most aggressive domestic intelligence agencies, may not have been by the book.

An investigation by the Associated Press has found that the plan to send a veteran agency officer to the NYPD, where he set up a police-spying network, was never approved by the CIA's top lawyer, an action required by a 1981 presidential order. The order, established to make sure the CIA doesn't cross the line into domestic spying, permits the agency to provide specialized equipment, technical knowledge or assistance of expert personnel to local law enforcement but only at when approved by the CIA's general counsel.

AP's investigation found that neither of those things happened when veteran agent Lawrence Sanchez was sent to the NYPD in 2002. Instead, Sanchez was responsible for setting up an extensive spying program in the police department that was used to gather intelligence on Muslim communities in the city.

The presence of the CIA at NYPD headquarters was confirmed last August by Kelly, who said the agent was there to advise the department on trade craft issues, or espionage techniques.