THE DEPARTMENT of Justice is taking a bold step in attempting to appeal a pretrial order by Judge Aubrey Robinson in a perjury case involving an official of the International Telephone and Telegraph Corporation. Appellate courts rarely look with favor on appeals until a trial is completed. But the department's action is justified. It focuses attention on a question that is critical not only in this case but in many others: Is there a way to protect legitimate government secrets in a criminal trial that must be conducted in public?

The question is not a new one. It has been lurking around for half a century, ever since the government began accumulating large amounts of secret information. But it was rarely discussed in public until three or four years ago because the government almost routinely decided there was no effective way to protect its secrets. The result was that dozens of cases in which prosecutions could have been brought - on charges ranging from leaks of classified information to espionage and murder - were quietly forgotten.

The evil of that situation is obvious now in light of the disclosures of wrongdoing in the past by officials of the CIA and FBI. It was a way of saying that government officials or others who knew a great deal about intelligence operations could commit certain crimes without fear of prosecution. And it meant that others who were accused of certain crimes could get the charges dropped by threatening to expose government secrets during their trials. That latter process, known as "graymail," involves subpoenaing classified documents or secret agents as part of a defendant's defense.

Part of the problem in the current case is that the government fears defense attorneys for ITT official Robert Berrellez will uncover and make public during his trial some still secret CIA relationships in Latin American. It thinks those relationships are irrelevant to the trial and wants that issue decided before the evidence about them is presented in court. Normal judicial proceedings call for a ruling on relevancy to be made after the evidence is produced in open court.

A recent study by the Senate Intelligence Committee recommended substantial changes in court procedure to cope with this problem (as well as others that arise in "graymail" cases) by permitting wider use of secret hearings. The change sought by the Department of Justice is in line with that committee's recommendations. While it does raise some of the possibilities that the Constitution's guarantee of a "public" trial was designed to avoid, the issue is so important that the appeals court should deal with it under the unusual procedure that is being invoked.