WASHINGTON — A former top White House foreign policy adviser told House impeachment investigators this week that she viewed Gordon D. Sondland, the United States ambassador to the European Union, as a potential national security risk because he was so unprepared for his job, according to two people familiar with her private testimony.

The adviser, Fiona Hill, did not accuse Mr. Sondland of acting maliciously or intentionally putting the country at risk. But she described Mr. Sondland, a hotelier and Trump donor-turned-ambassador, as metaphorically driving in an unfamiliar place with no guardrails and no GPS, according to the people, who were not authorized to publicly discuss a deposition that took place behind closed doors.

Ms. Hill, the former senior director for European and Russian affairs at the White House, also said that she raised her concerns with intelligence officials inside the White House, one of the people said.

Mr. Sondland’s lawyer declined to comment.

In her testimony, Ms. Hill described her fears that Mr. Sondland represented a counterintelligence risk because his actions made him vulnerable to foreign governments who could exploit his inexperience. She said Mr. Sondland extensively used a personal cellphone for official diplomatic business and repeatedly told foreign officials they were welcome to come to the White House whenever they liked.