Pam Bondi, President-elect Donald J. Trump’s choice for attorney general, will head into her confirmation hearing before the Senate Judiciary Committee on Wednesday with a solid reputation as a prosecutor and a critical question looming: Would she stand up to Mr. Trump?

Mr. Trump selected Ms. Bondi, the former Florida attorney general and lobbyist, to replace his first pick, Matt Gaetz, the former Republican representative of Florida who withdrew after a furor over allegations of sexual misconduct, including with an underage girl.

Most Democrats are still likely to oppose Ms. Bondi, 59, but she is a far more conventional, qualified candidate than Mr. Gaetz. That virtually ensures support among Senate Republicans, with the distinct possibility she will pick up a Democrat or two.

If her hearings do not produce much drama, her tenure at the department almost certainly will. An emboldened Mr. Trump, embittered by the two federal prosecutions against him, has made it clear that he wants senior Justice Department officials to execute his policy commands, investigate those who investigated him and perhaps prosecute his political enemies.

“The Department of Justice, the prosecutors will be prosecuted, the bad ones,” she declared on Fox News in 2023, when asked whether it would be appropriate to open cases related to the department’s prosecutions under Jack Smith, the special counsel.

Richard Donoghue, the former Justice Department official who resisted Mr. Trump’s effort to install election-denying loyalists to top department posts after he lost the 2020 election, said the ideal candidate operates above partisanship. “You want, ideally, to ensure that partisan political considerations never play into the department’s decisions and positions when it comes to investigations and prosecutions,” he said.

“There is no fourth branch of government called the Justice Department — you work for the president — but people in power have to understand that they are not the president’s lawyer,” he added.

In fact, Mr. Trump has already selected two of his defense lawyers, Todd Blanche and Emil Bove, who have been communicating with him often, to run the day-to-day operations of the department. Ms. Bondi is likely to bring many senior officials onboard from her Florida team, but her chief of staff — a close ally of a White House power broker, Stephen Miller — will be in place before she arrives.

People who have helped prep her for the hearings said she would affirm her commitment to the rule of law, but would likely invoke Mr. Trump’s right to communicate with the attorney general on nearly any topic of his choice.

Democrats on the Judiciary Committee, with limited expectations of derailing her nomination, plan to pelt Ms. Bondi with questions to scrutinize the extent of her allegiance to Mr. Trump. Senator Richard J. Durbin, the top Democrat on the committee, said she “has a troubling history of unflinching loyalty to the president-elect.”

Mr. Durbin signaled that Ms. Bondi’s nomination would be part of a larger argument over Mr. Trump’s choosing so many of his former lawyers to stock the senior leadership of the Justice Department.

Democrats plan to drag Ms. Bondi into the fight over Mr. Trump’s far more polarizing pick to run the F.B.I., Kash Patel, who will technically report to her through Mr. Blanche.

They will also grill Ms. Bondi on her previous interactions with Mr. Trump. In 2013, she declined to join a multistate lawsuit brought by students at Trump University, around the time her campaign accepted a $25,000 contribution from a nonprofit funded by Mr. Trump.

Ms. Bondi, a Democrat until 2000, emerged from a crowded Republican primary to win the attorney general’s race. She had garnered the support of Sarah Palin, the former Alaska governor and failed 2008 Republican vice-presidential nominee, and pointed to her tough stance on crime during appearances on Fox News.

During her eight-year tenure, Ms. Bondi tried unsuccessfully to overturn and weaken the Affordable Care Act, opposed expanding legal protections for the L.G.B.T.Q. community and cultivated a national reputation by supporting anti-human-trafficking efforts.

She also drew fire for her fund-raising practices — and for persuading the governor at the time, Rick Scott, to postpone an execution in 2013 because it conflicted with a fund-raiser for her re-election campaign. She later apologized.