The Reagan administration has agreed to free 156 Cuban refugees, detained in the Atlanta federal penitentiary for more than a year, as soon as "suitable" sponsors can be found.

The action comes a day after a federal judge here promised freedom for hundreds of Cubans who have been imprisoned solely because they lack entry papers.

"It appears that these individuals are presently nonviolent, likely to remain nonviolent, and unlikely to commit any criminal offenses following their release," said Immigration and Naturalization Service acting director A.J. Carmichael in a memorandum dated Monday, the day of U.S. District Court Judge Marvin Shoob's ruling. "We recommend the release of 156 once suitable sponsors can be found."

The Cubans are among 1,800 refugees who came to this country in last year's "Freedom Flotilla" and have spent more than a year behind bars while the government figures out what to do with them. Among those are 156 who had been approved for release as long as a year ago, during the Carter administration, but whose release was halted this spring by Attorney General William French Smith pending a policy review.

In a sudden about-face on its Cuban detention policy, the government said it had agreed to free the 156 Cubans, who were among more than 300 Shoob has promised to free Wednesday, as an attempt to show "good faith" that the government has not forgotten the refugees.

"Obviously, we wanted to show the judge there was good faith," said Paul Schmidt, deputy counsel for the INS. He said Shoob's motions to free the Cubans had spurred the government to action, but he said the INS was "well along" with its release recommendations under a new release plan approved last month by the attorney general.

"We wanted to show him the attorney general had developed a fair plan and could move more expeditiously," Schmidt said. "Of course, we might have gotten the list typed up a little more quickly" as a result of Shoob's order.

Dale Schwartz, an Atlanta attorney representing the imprisoned Cubans, said INS' sudden move "would not have happened had Judge Shoob not indicated he would release these men immediately. The government is trying to save itself from terminal embarrassment."

Schmidt said the memorandum, a copy of which was obtained by The Washington Post, would be presented to the judge in court here Wednesday by Justice Department attorneys representing the INS. It was telecopied to the U.S. attorney here today.

The judge had given the government until noon Wednesday to provide reasons why the 156 Cubans should not be freed immediately, along with 181 others being held only for lack of entry papers or whose cases had been favorably adjudicated by an immigration judge.