The Treasury Department yesterday followed up President Reagan's imposition of an economic boycott against Libya with regulations warning Americans to leave that country promptly or face up to 10 years in prison.

The sanctions for U.S. citizens who remain in Libya also include fines of up to $50,000 for willful violations.

Reagan announced the severing of almost all business contacts between the two countries at his news conference Tuesday night. He set a Feb. 1 deadline for the estimated 1,000 to 1,500 Americans now in Libya to leave.

After that, it will be, at least technically, a crime for them to buy groceries or pay the rent.

On paper, Reagan's order also applies to spouses and dependents who might hold dual citizenship, but a senior administration official said that exceptions can be granted for humanitarian reasons by the Treasury Department's Office of Foreign Assets Control, overseer of the new rules.

"It's a blunt instrument," a Justice Department official said of the law under which Reagan acted. "Then you get letters from people saying, 'Hey, I've been living in Libya for 29 years -- don't make me a criminal.' "

Despite the apparent sweep of the boycott, there is one major exemption: it does not apply to foreign subsidiaries of American firms, such as the British affiliate of Brown & Root, which is helping build a 1,200-mile-long water pipeline in Libya, a project that Muammar Qaddafi has called "the eighth wonder of the world."

A senior administration official said the British affiliate can go forward with the pipeline if it can get along without American citizens and equipment.

Some Americans in Libya, primarily oil workers employed by state-owned Libyan firms, questioned Reagan's authority to impose sanctions, according to news service accounts, and voiced the belief that they would be found unconstitutional.

However, the Supreme Court has already spoken on the issue. In a 1984 decision involving Cuban travel restrictions, the court supported the president. The 5-to-4 ruling, written by Justice William H. Rehnquist, held that nothing in the Constitution prevents the president from imposing travel bans in the interest of foreign policy. Reagan had adequate authority, Rehnquist wrote, "to curtail the flow of hard currency to Cuba -- currency that could . . . be used in support of Cuban adventurism -- by restricting travel."

The Libyan boycott falls "squarely within" that 1984 ruling, Chuck Sims, an attorney for the American Civil Liberties Union, said yesterday. "I don't see any grounds to challenge it."

The legal foundation for the boycott was laid in 1977 when Congress passed the International Emergency Economic Powers Act (IEEPA), primarily to establish a system of congressional oversight over the president's actions.

"Before that, the president exercised his emergency powers largely under the Trading With the Enemy Act, which goes back to World War I," one government lawyer noted. "But in 1977, Congress took some lessons from the War Powers Act it had passed and laid down requirements" for consultation with Congress, regular reports and periodic follow-ups.

The new law, officials said, also meant that instead of declaring a broad emergency, such as the Cold War or the Depression, and basing its actions over many years on that declaration, the White House had to make its emergency proclamations relevant to what was going on.

The post-Watergate law also said that Congress could vote to terminate the emergency by joint resolution, but that provision is now probably unconstitutional under the Supreme Court's 1983 decision prohibiting legislative vetoes.

The IEEPA law was first used by the Carter administration in 1979 to freeze money the Iranian government had in this country and in British and French branches of American banks where the Iranians had big accounts. The act was invoked again last May to ban most trade with Nicaragua and in September to bar the import of South African Krugerrands and to restrict certain other transactions with South Africa.