The Supreme Court agreed yesterday to decide whether a citizen claiming violation of basic rights by a federal official can sue for damages in any of the 20 states.

The justices will hear argument in a case arising from a secret Central Intelligence Agency project in which 215,000 private letters to and from the Soviet Union were opened, read and circulated from 1953 to 1973.

They also will hear argument in a case arising from a grand jury investigation of the Vietnam Veterans Against the War in Tallahassee, Fla., in 1972.

The CIA case began in 1975 when five persons who said they represented "tens of thousands" of victims of illegal mail openings filed a class action in U.S. District Court in Rhode Island, where one of them, Rodney D. Driver, lives.

They sought more than $1 billion in damages -- $20,000 for each opened letter, $100,000 for each calsss member -- from 25 present and former high officials of the CIA, the Federal Bureau of Investigation, and the Postal Service, which ahd conducted the mail intercept in New York City.

Some of the defendants never had set foot in Rhode Island. With the exception of a former CIA official who lived in the state, all said that the suit was barred by a 1962 law that authorizes citizen suits in any judicial district where the target federal official lives, owns property, or purportedly infringed constitutional rights.

Last May, the 1st U.S. Circuit Court of Appeals held that the law exempted defendats who when the suit was filed either had left the government or were werving it in a capacity unrelated to the mail intercept.

At the same time, however, the court declined to exempt former CIA Director William E. Colby, former CIA deputy director Vernon A. Walters and possibly others who at the time of the suit were in the same jobs they'd held during the period of the mail openings.

Such federal officers differ from private defendants "because they can anticipate that their official acts may affect people in every part of the United States," Chief Judge Frank M. Coffin wrote. Besides, he said, a trial judge can transfer a case when that is "in the interest of justice."

Yesterday, the Supreme Court granted a petition by Cloby and Walters for review of the ruling. They contended that it denies due process of law by forcing them to defend themselves in a jurisdiction to which they have no ties, and to travel to a distant court to do so.

At the same time, the high court declined to grant two other petitions, including one by palintiff Driver for review of the exemption of former officials who are now either private citizens or with other government departments, such as former CIA directors Richard Helms and James R. Schlesinger.

In New York City, Melvin L. Wulf, a lawyer for Driver, told a reporter that it wasn't clear to him whether the high court had intended to leave standing the portion of the ruling that would seem to exclude an official such as Helms, who left the CIA to become ambassador to Iran.

The Florida case arose from the discovery that an informer had been planted in the defense camp when a grand jury was investigating the Vietnam Veterans Against the War.

The veterans sued for damages, charging that Guy Goodwin, a Justice Department roving prosecutor, had conspired with U.S. Attorney William H. Stafford Jr., Assistant U.S. Attorney Stuart J. Carrouth, and FBI Agent Claude Meadow.

Last June, the court let stand a ruling that Goodwin wasn't protected by the usual absolute prosecutorial immunity. Now it will review a ruling by the U.S. Court of Appeals for the District of Columbia that Stafford, who became a federal judge in Tallahassee, Carrouth, who is in private practice, and Meadow all can be sued here.