WASHINGTON—President Trump is considering as many as five candidates as his new attorney general on the assumption that Jeff Sessions will leave his post later this year, according to White House officials and outside advisers.

The potential candidates include Health and Human Services Secretary Alex Azar, Transportation Department general counsel Steven Bradbury, former Attorney General Bill Barr, Deputy Secretary of State John Sullivan and Janice Rogers Brown, a retired appeals court judge from the District of Columbia Circuit, the people said.

The five either didn’t return calls seeking comment or declined to comment.

The president has spoken openly, and often sharply, about his desire to replace Mr. Sessions and his regret over installing the former Alabama senator as the nation’s top lawyer. While Mr. Trump has spent more than a year undercutting his attorney general, he has rarely spoken about successors, according to White House officials and people familiar with his thinking.

His discussion of these candidates represents a shift, signaling for the first time that Mr. Trump is envisioning what his administration might look like without Mr. Sessions in the cabinet.