In a heavily guarded federal courtroom, jury selection began today in the trial of Anthony Grandison and three codefendants charged with civil rights violations in the alleged murder-for-hire slayings of two potential witnesses against Grandison in a drug case.

Up to six deputy marshals stood in the courtroom as attorneys and presiding Judge Herbert F. Murray began selecting a jury from a panel of about 100 Maryland residents. Jury selection is expected to take another two days, with the trial lasting several weeks after that.

Federal prosecutors say nearly a dozen of their 35 witnesses have been threatened and are being kept in protective custody at undisclosed locations. In addition, Assistant U.S. Attorney Mark H. Kolman refused to give the names of what he called other "unprotected civilian" witnesses to defense attorneys before the trial, an unusual step that Murray approved today.

Grandison, 30, a convicted heroin and cocaine dealer described by another federal judge as a "cold, calculating, callous character," is charged with masterminding from his jail cell the April 28 assassinations of two suburban motel employes, Scott Piechowicz, 27, and Susan Kennedy, 19.

The two were on duty at the front desk of the Warren House Motor Hotel in Pikesville when an intruder entered and cut them down with a burst from a high-powered Ingram MAC-10 machine gun. Piechowicz and his wife, Cheryl, were to be key witnesses in Grandison's upcoming drug trial, linking him to a room at the motel where a cache of heroin and cocaine had been discovered.

Cheryl Piechowicz had been scheduled to work the front desk along with her husband on the day of the slayings, but Susan Kennedy substituted for her at the last moment, leading prosecutors to believe Kennedy was killed by mistake.

A manhunt by FBI and other agents led to the arrests of Grandison and three other Baltimore area suspects, Vernon L. Evans Jr., 33, Rodney Kelly, 19, and Janet P. Moore, 21, after Charlene Sparrow, an alleged girlfriend of Evans, began cooperating with authorities. The FBI said in affidavits filed in court that Evans visited Grandison in Baltimore City Jail two days before the Piechowicz-Kennedy slayings and that Evans later told Sparrow he would receive $9,000 for "pulling it off." Federal authorities named Evans as the triggerman and Kelly and Moore as coconspirators who facilitated arrangements between Grandison and Evans.

Grandison, an intense, bearded man with a shaved head, was convicted in the drug case last spring and sentenced to 21 years. Now he and the other three face federal charges of witness tampering and conspiracy to violate the civil rights of Scott and Cheryl Piechowicz. They also face state charges of murder in Baltimore County where State's Attorney Sandra A. O'Connor said she will seek the death penalty against Grandison and Evans.

Federal prosecutors lack authority to charge murder since the slayings did not occur on federal property. The defendants, however, could receive maximum sentences of life imprisonment if convicted under the federal civil rights and witness tampering statutes.