Ali Kourani was picking up coffee in a Starbucks in Queens one day two and a half years ago, when an F.B.I. agent flashed his badge and said he wanted to talk. He escorted Mr. Kourani to a nearby McDonald’s, where two other agents waited.

The agents said they knew Mr. Kourani had “an affiliation with Hezbollah,” the Lebanese-based terrorism group, and during repeated meetings in 2016, they said they wanted to recruit him as an informant, Mr. Kourani later testified.

“Nobody will suspect that you are working for the F.B.I.,” he said one agent told him, and they handed him a “burner” phone so they could reach him securely.

Mr. Kourani told the agents they had the wrong guy.

What happened next provides a glimpse into the often fraught and sometimes duplicitous negotiations between would-be informants and federal law enforcement, a dangerous and delicate dance full of pitfalls for people like Mr. Kourani, who seek to trade information for leniency or other favors.