Valerie Wilson may be the best known former intelligence operative in recent history, but a federal judge in New York ruled Wednesday that she was not allowed to say how long she worked for the Central Intelligence Agency in the memoir she plans to publish this fall.

Although the fact that Ms. Wilson worked for the C.I.A. from 1985 to 2006 has been published in the Congressional Record and elsewhere, the judge, Barbara S. Jones of Federal District Court in Manhattan, said Ms. Wilson was not free to say so.

“The information at issue was properly classified, was never declassified and has not been officially acknowledged by the C.I.A.,” Judge Jones wrote.

Asked whether the ruling would affect the book’s scheduled publication date in October, Adam Rothberg, a spokesman for Ms. Wilson’s publisher, Simon & Schuster, said only that the book would appear “this fall,” suggesting that revisions required by the decision may cause a slight delay. David B. Smallman, a lawyer who represented Ms. Wilson and Simon & Schuster in the suit they had filed to include the information, said his clients had not decided whether to appeal.