But the ideas amount to a tacit acknowledgment by Democrats that, even as they criticize Mr. Trump’s tactics and demands in the shutdown fight, they have largely allowed him to define the terms of the debate on border security, and that they must be more effective in articulating their own position on the issue.

“People want to make sure that it’s clear that the Democrats do stand for border security, and not allow the president to determine how we talk about it,” said Representative Ro Khanna, Democrat of California. “We can’t cave to his vision for a wall, because of everything that it represents, but we also want to show that we’re for something.”

The issue came up in a meeting of the Democratic caucus this week as Ms. Pelosi was briefing rank-and-file lawmakers about her latest broadside against Mr. Trump over the shutdown: her letter requesting that he delay or cancel his State of the Union address this month in light of the security measures that would have to be provided by federal workers who are working without pay. Mr. Trump’s response was to prevent Ms. Pelosi from taking her trip on a military plane.

His letter to Ms. Pelosi announcing that step also disclosed her itinerary, which was secret given that Afghanistan was her destination. Official congressional trips are kept confidential for security reasons, particularly when they involve travel to war zones and high-ranking leaders like the speaker, who is second in line to the presidency.

“You never give advance notice of going into a battle area — you just never do,” Ms. Pelosi told reporters at the Capitol, adding that Mr. Trump may not have understood that because of his inexperience.

“The people around him, though, should have known that,” she said. “That’s very dangerous.”

After Ms. Pelosi rushed to salvage the trip by making alternative travel arrangements to fly commercial instead, people close to Mr. Trump who had been briefed revealed the speaker’s plans to reporters late Thursday. By dawn on Friday, said Drew Hammill, her deputy chief of staff, facing a heightened State Department threat assessment and amid concern that the administration’s leaks had further compromised the safety of those involved, Ms. Pelosi canceled the trip.

A White House official on Friday denied the charge, saying that there was no way for Ms. Pelosi to have kept her trip a secret and that any suggestion of a leak “is a flat-out lie.”