The Indonesian government retained Mayer Brown to help in the cases concerning cigarettes and shrimp, said Ni Made Ayu Marthini, attaché for trade and industry at the Indonesian Embassy in Washington. She said no American law firm had been formally retained yet to help in a third case, involving horticultural and animal products.

Mr. Layton, a lawyer in the Washington office of Mayer Brown, said that since 2010 he had led a team from the firm in the clove cigarette dispute. He said Matthew McConkey, another lawyer in the firm’s Washington office, had taken the lead on the shrimp issue until the United States dropped its claims in August. Both cases were underway a year ago when the Australians reported that their surveillance included an American law firm.

Mr. Layton said that if his emails and calls with Indonesian officials had been monitored, the spies would have been bored. “None of this stuff is very sexy,” he said. “It’s just run of the mill.”

He and the other Mayer Brown lawyers do most of their work on the trade issues from Washington, he said. They also make occasional trips to Jakarta, Indonesia’s capital, and Geneva, where the World Trade Organization is based. Mr. Layton said most of his communications with officials in Jakarta had been done through email, while he also talked by phone with officials at the Indonesian Embassy in Washington.

The N.S.A.’s protections for attorney-client conversations are narrowly crafted, said Stephen Gillers, an expert on legal ethics at New York University’s School of Law. The agency is barred from sharing with prosecutors intercepted attorney-client communications involving someone under indictment in the United States, according to previously disclosed N.S.A. rules. But the agency may still use or share the information for intelligence purposes.

Andrew M. Perlman, a Suffolk University law professor who specializes in legal ethics and technology issues, said the growth of surveillance was troubling for lawyers. He helped create the bar association’s ethics code revisions that require lawyers to try to avoid being overheard by eavesdroppers.

“You run out of options very quickly to communicate with someone overseas,” he said. “Given the difficulty of finding anything that is 100 percent secure, lawyers are in a difficult spot to ensure that all of the information remains in confidence.”