The Justice Department yesterday became the second federal agency to announce a program to test employes for illegal drugs, even though it has not determined whom to test.

The announcement comes a year and 10 days after President Reagan ordered testing of federal workers for illegal drug use. The Transportation Department, on Sept. 10, led off the government-wide effort.

"In the next several weeks we will announce systematic plans in four bureaus that were given the go-ahead by Congress this summer -- the Federal Bureau of Investigation, the Drug Enforcement Administration, the Immigration and Naturalization Service and the Bureau of Prisons," said Richard Willard, assistant attorney general for the civil division.

Willard said the choice of individuals to be tested has been delegated to the chiefs of each agency. The attorney general must review and approve the plans.

Applicants for jobs within these agencies already have been subject to urinanalysis. The new program will feature random testing similar to that begun in the Transportation Department.

Employes will be tested for cocaine, marijuana, amphetamines, opiates and PCP. Drug users identified in a confirmatory test are subject to discipline, including firing. A drug user caught a second time will be fired, Willard said.

All employes found to be using drugs will be referred to a drug-rehabilitation program.

The remaining employes of the Justice Department cannot be tested until the rest of the government is ready to start and has developed and determined costs for a uniform program.

Willard declined to say whether all FBI agents will be tested or whether all the attorneys in his civil division will be required to submit urine samples. He said there "are some" because they handle top-secret classified information.

The decision about whom to test will be made for much of the department by the assistant attorney general for administration, Harry H. Flickinger, a career civil servant who was sworn in last week.

The Justice Department plan announced yesterday calls for testing workers in certain "sensitive" positions, and said Attorney General Edwin Meese III will take into account whether the worker must carry a gun, has national-security or drug-interdiction responsibilities, has access to classified or other sensitive information, and whether the position requires an employe to pass an FBI full-field background investigation.

Willard said the attorney general and his immediate staff would be subject to the tests because of the sensitive nature of their duties.

He said the cost of each test will be about $15, although the Transportation Department pays $26 per test. The department has not yet signed a contract with a firm to perform the testing. "Compared to the cost of background investigations," he said, it is a "modest incremental cost."