After separate investigations led by Democrats and Republicans documented failures in federal oversight of Boeing, Congress has passed bipartisan legislation meant to prevent the company and Federal Aviation Administration from repeating deadly mistakes that contributed to two 737 Max crashes.

The FAA reform provisions, the subject of months of debate and legislative wrangling, finally cleared the House and Senate as part of the sprawling relief and government funding bill passed overnight Monday. Investigators found the FAA had been far too deferential with the aerospace giant, which was given broad authority over its own safety certification.

Among the provisions designed to rectify spotty oversight are new whistleblower protections for employees of manufacturers such as Boeing, so workers can freely share safety problems they see with the FAA; additional spending, totaling tens of millions per year, for the FAA to recruit and retain engineers and other experts; and new civil penalties if employees at Boeing or other companies interfere with oversight work or fail to disclose all safety-critical information to the FAA, airlines and pilots.

“We had a captive regulator. FAA was kowtowing to the demands of Boeing managers, who were under orders from the highest levels to get this plane out the door no matter what,” said Rep. Peter A. DeFazio (D-Ore.), chairman of the House Transportation Committee, which led a far-reaching investigation and found a “horrific culmination” of errors by Boeing and the FAA.

DeFazio said new prohibitions barring FAA managers from arbitrarily overruling their technical experts at the behest of a manufacturer, together with the other reforms, “will prevent another horrible, preventable tragedy like these two.”

Michael Stumo, who lost his daughter Samya on the Ethiopian Airlines flight that crashed shortly after takeoff in March 2019, said he was heartened by the reforms’ passage.

“This legislation was nearly dead several times this fall, and we family members, crash family members, kept it going,” Stumo said.

Stumo called it a “great bill” that incorporates many of the families’ priorities, including giving federal regulators more direct oversight of the certification process. Even so, he said, families have concerns about the current leadership of the FAA, including administrator Stephen Dickson. Stumo and others argue that the FAA should not have ungrounded the 737 Max last month.

“Dickson was supposed to be a new start,” Stumo said. But by letting the Max back up in the air now, Dickson is “aiding and abetting” a flawed recertification process, he said.

The FAA declined to comment on the provisions passed by Congress, saying in an emailed statement that the “FAA does not comment on pending legislation.” A spokesman pointed to an earlier videotaped statement from Dickson expressing confidence in the Max after a comprehensive, 20-month recertification process and his own piloting of the aircraft. “I can tell you now that I am 100 percent comfortable with my family flying on it,” Dickson said.

A Boeing spokesman referred questions on the changes to the FAA, “as they will be implementing the legislation.”

The FAA also said it had no further comment on a blistering report released Friday by the Senate Committee on Commerce, Science and Transportation, which is chaired by Sen. Roger Wicker (R-Miss.) and found “significant examples of lapses in aviation safety oversight and failed leadership in the FAA.”

The agency had earlier noted its commitment to “continuous advancement of aviation safety and improving our organization, processes, and culture.”

Before the two Max crashes, federal regulators were not provided, and in some cases did not seek, critical safety information or review key safety assertions made by Boeing, according to investigators. The manufacturer downplayed changes it made to flight controls and sought to prevent costly training for pilots, and the FAA missed vital danger signs.

First in Indonesia, in October 2018, and later in Ethiopia the following March, pilots were unable to save their planes when a Boeing system repeatedly forced the noses of their aircraft down, killing 346 people. Faulty information from an external sensor led to the problems with the system, known as the Maneuvering Characteristics Augmentation System, or MCAS.

The legislation, known as the Aircraft Certification, Safety and Accountability Act, also reverses a host of provisions passed by Congress in 2018 that gave Boeing more power to oversee the safety of its own planes.

And it requires the FAA to analyze the cumulative effects of changes in airplane designs over time, something the FAA did not do “at an aircraft level, which led to FAA misunderstanding how the MCAS system would operate,” according to the office of Sen. Maria Cantwell (D-Wash.).

Cantwell pointed to a provision meant to build expertise on Capitol Hill and elsewhere in government in the highly technical realm of aviation certification, something she worked on with Sen. Roy Blunt (R-Mo.).

“We’re building up the tools that Congress can use, and we’re building that infrastructure into the FAA process” to better oversee fast-changing technologies with greater authority, Cantwell said. “It’s hard to change a culture, but we’re darn sure going to try to put the rules in place that say that this is the way we expect the FAA to operate.”