THE United States has been narrowly saved from lethal terrorist plots in recent years — or so it has seemed. A would-be suicide bomber was intercepted on his way to the Capitol; a scheme to bomb synagogues and shoot Stinger missiles at military aircraft was developed by men in Newburgh, N.Y.; and a fanciful idea to fly explosive-laden model planes into the Pentagon and the Capitol was hatched in Massachusetts.


But all these dramas were facilitated by the F.B.I., whose undercover agents and informers posed as terrorists offering a dummy missile, fake C-4 explosives, a disarmed suicide vest and rudimentary training. Suspects naïvely played their parts until they were arrested.


When an Oregon college student, Mohamed Osman Mohamud, thought of using a car bomb to attack a festive Christmas-tree lighting ceremony in Portland, the F.B.I. provided a van loaded with six 55-gallon drums of “inert material,” harmless blasting caps, a detonator cord and a gallon of diesel fuel to make the van smell flammable. An undercover F.B.I. agent even did the driving, with Mr. Mohamud in the passenger seat. To trigger the bomb the student punched a number into a cellphone and got no boom, only a bust.


This is legal, but is it legitimate? Without the F.B.I., would the culprits commit violence on their own? Is cultivating potential terrorists the best use of the manpower designed to find the real ones? Judging by their official answers, the F.B.I. and the Justice Department are sure of themselves — too sure, perhaps.


Carefully orchestrated sting operations usually hold up in court. Defendants invariably claim entrapment and almost always lose, because the law requires that they show no predisposition to commit the crime, even when induced by government agents. To underscore their predisposition, many suspects are “warned about the seriousness of their plots and given opportunities to back out,” said Dean Boyd, a Justice Department spokesman. But not always, recorded conversations show. Sometimes they are coaxed to continue.


Undercover operations, long practiced by the F.B.I., have become a mainstay of counterterrorism, and they have changed in response to the post-9/11 focus on prevention. “Prior to 9/11 it would be very unusual for the F.B.I. to present a crime opportunity that wasn’t in the scope of the activities that a person was already involved in,” said Mike German of the American Civil Liberties Union, a lawyer and former F.B.I. agent who infiltrated white supremacist groups. An alleged drug dealer would be set up to sell drugs to an undercover agent, an arms trafficker to sell weapons. That still happens routinely, but less so in counterterrorism, and for good reason.


“There isn’t a business of terrorism in the United States, thank God,” a former federal prosecutor, David Raskin, explained.


“You’re not going to be able to go to a street corner and find somebody who’s already blown something up,” he said. Therefore, the usual goal is not “to find somebody who’s already engaged in terrorism but find somebody who would jump at the opportunity if a real terrorist showed up in town.”


And that’s the gray area. Who is susceptible? Anyone who plays along with the agents, apparently. Once the snare is set, law enforcement sees no choice. “Ignoring such threats is not an option,” Mr. Boyd argued, “given the possibility that the suspect could act alone at any time or find someone else willing to help him.”


Typically, the stings initially target suspects for pure speech — comments to an informer outside a mosque, angry postings on Web sites, e-mails with radicals overseas — then woo them into relationships with informers, who are often convicted felons working in exchange for leniency, or with F.B.I. agents posing as members of Al Qaeda or other groups.


Some targets have previous involvement in more than idle talk: for example, Waad Ramadan Alwan, an Iraqi in Kentucky, whose fingerprints were found on an unexploded roadside bomb near Bayji, Iraq, and Raja Khan of Chicago, who had sent funds to an Al Qaeda leader in Pakistan.