DETROIT (AP) — A federal appeals court on Wednesday said the FBI acted properly in refusing to release records that could reveal the use of race and ethnicity in investigations.

The FBI won’t give up certain information to the American Civil Liberties Union, saying it might harm ongoing probes. The ACLU is concerned the FBI in Michigan could be targeting ethnic groups and violating civil rights through racial profiling.

In a 3-0 decision, the 6th U.S. Circuit Court of Appeals said the FBI legally invoked an exception in public records law in declining to release certain records. The ACLU’s Michigan chapter sued in 2011 after getting redacted pages and denials from the government.

The ACLU said the information shouldn’t interfere with investigations because it doesn’t want to know the names of any targets or witnesses. The court said that wasn’t a good argument.

“All but data in the rawest form will alert criminal and terrorist elements to how the FBI uses demographic information in its investigations, allowing such groups to avoid the FBI investigations,” said judges Danny Boggs, David McKeague and Sandra Beckwith.

The ACLU may be treading into matters of national security “to which the agency is owed deference,” the court said of the FBI.

ACLU attorney Nusrat Choudhury said the ruling was a disappointment.

“The court’s decision to uphold FBI secrecy undermines the very purpose of the Freedom of Information Act,” she said.

The court said it makes no difference that FBI offices in New Jersey and San Francisco may have released some demographic information. The ACLU has legal challenges pending in those jurisdictions, too.

“If we adopted the ACLU’s reasoning that disclosure of some information requires disclosure of all similar information, agencies would be discouraged from making a good-faith effort to disclose as many responsive documents as possible,” the court said.