Tom Blanton, the director of the National Security Archive, said the national security argument was “a falsehood” because the Obama-era policy already made such exceptions. His organization is among three that sued the government this week for visitor logs from the White House; the Mar-a-Lago estate in Palm Beach, Fla.; and Trump Tower.

“Their action today shows they were just looking for a way to hide the logs,” Mr. Blanton said. “We went to court because we saw this coming.”

Mr. Trump’s policy is a return to the one followed by presidents who preceded Mr. Obama. During Mr. Bush’s administration, government transparency groups began filing lawsuits demanding information about specific visitors to the White House, only to be stonewalled by the president’s lawyers. The issue had not been resolved by the time Mr. Obama took office, but his administration — which was exclaiming its commitment to transparency — adopted the position that visitor logs would be released with certain exceptions, in line with those recognized under the Freedom of Information Act.

Although a federal court ruled in 2011 that visitor logs could be kept secret, the Obama administration continued to provide them. Lawyers still exercised what they maintained was a right to omit some entries, including in cases of highly sensitive meetings, such as interviews for prospective Supreme Court candidates and those dealing with national security or intelligence matters. And the Obamas routinely left out the names of celebrities and top donors who came to personal events at the White House, such as star-studded birthday celebrations for the president and his wife, drawing criticism for doing so.

The Trump policy effectively means that none of the White House visitor logs will be available for at least five years. Under the Presidential Records Act, the public can gain access to records starting five years after the end of an administration, although the president may seek to keep them secret for up to 12 years.

The issue of the logs recently gained intense attention after the chairman of the House Intelligence Committee, Representative Devin Nunes, Republican of California, confirmed that he was on the White House grounds when he received what he described as evidence that Mr. Trump or his closest associates might have been “incidentally” swept up in foreign surveillance by American spy agencies. Logs recording Mr. Nunes’s visit on March 21 have not been released to the public.

The visitor records, maintained by the Secret Service, list the names of those entering along with which member of the White House staff obtained permission for them to enter, and the name of the person they are to meet.