After weeks of wrangling, Energy Secretary Bill Richardson agreed yesterday to a Republican proposal to create a semiautonomous agency to run the vast complex of laboratories and plants that research, assemble and maintain America's nuclear weapons.

The establishment of the Agency for Nuclear Stewardship (ANS) inside the Department of Energy would be the most significant change produced so far by more than a year of controversy over allegations of Chinese espionage and lax security at the weapons labs.

The new agency also would represent the first major reorganization of the nuclear weapons complex in more than two decades, since the Department of Energy was formed in 1976-77.

Until this week, Richardson had vigorously opposed the notion of a semiautonomous nuclear agency, calling it "a fiefdom within a fiefdom." He said yesterday that he would accept the Republican proposal as long as the ANS remained inside the Energy Department and clearly under his control.

"I'm ready to move on it," Richardson said, adding that he had directed his staff to "work with Congress on details to craft a bipartisan package." He noted that he already has a team looking for candidates with "a strong national security background" for the new position of undersecretary of energy for nuclear stewardship.

The reorganization was first proposed last month by three Republican senators -- Pete V. Domenici (R-N.M.), Jon Kyl (R-Ariz.) and Frank H. Murkowski (R-Alaska) -- as a way to tighten security in the wake of a bipartisan congressional report on Chinese espionage by a select committee headed by Rep. Christopher Cox (R-Calif.).

The proposal subsequently was endorsed by a panel of the President's Foreign Intelligence Advisory Board headed by former senator Warren B. Rudman (R-N.H.). Rudman's panel said that many of the Cox committee's conclusions about Chinese espionage were overblown, but it also excoriated the Energy Department as "a dysfunctional bureaucracy that has proven it is incapable of reforming itself."

Rudman predicted yesterday that Richardson's support would ensure quick Senate passage of the reorganization, since the White House already backs it. Rudman cautioned, however, that the reaction in the House of Representatives is uncertain. Some members of the House favor the Senate approach, but others want to create a fully autonomous nuclear agency or transfer authority over the nuclear complex to the Pentagon.

As Richardson and Congress have argued over ways to tighten security, morale has been slipping among the more than 30,000 employees within the nuclear weapons complex, and particularly at the nation's three main nuclear laboratories. Last weekend, Richardson created a storm when he said the GOP plan could result in the loss of 900 jobs in New Mexico, a claim Domenici quickly denied.

During sessions at Sandia and Los Alamos national laboratories last month, Richardson was peppered with complaints about a new policy of administering polygraph tests to all employees with access to current nuclear secrets. When researchers at Los Alamos asked him whether he would take the so-called lie detector exam himself, he said he "might." Later that day, at Sandia, he said he had already volunteered.

Richardson also told the employees that he instituted the exams "to send a signal that we take security seriously." But, he added, "I don't see them as permanent."

Richardson went to the labs partly to offer support to Asian Americans working in the nuclear complex, since two Chinese American scientists have been identified as suspected spies and another has pleaded guilty to unauthorized passing of classified information.

"I sense that Asian Americans feel their patriotism is being questioned . . . and [worry that the] careers of Asian Americans will suffer," he told a gathering at Los Alamos. "The alleged actions of one doesn't reflect on the rest."

The proposed Agency for Nuclear Stewardship would run the Los Alamos, Sandia and Lawrence Livermore national laboratories as well as the Nevada nuclear test site, nuclear materials production facilities and weapons assembly plants. It would also manage the naval reactor program, which supplies nuclear propulsion systems to the Navy, and various programs promoting safe storage and nuclear nonproliferation.

As late as last week, Richardson argued that a new agency was unnecessary because he had already taken significant steps to tighten security, including the appointment of retired Gen. Eugene E. Habiger as the Energy Department's "security czar."

When Congress recessed for the Fourth of July holiday, there was fear of a deadlock. Rudman helped to resolve it by circulating a memo stating that even after the creation of the ANS, the energy secretary still would be "responsible for developing and promulgating Energy-wide policy" on security, counterintelligence and other "vital organization functions."

Republican senators also overcame some of Richardson's objections by writing into the legislation that the chiefs of counterintelligence and security in the new ANS shall "implement the . . . policies" set by the energy secretary and undersecretary.