SAN FRANCISCO — When law enforcement agents show up in the right place at the right time, defense lawyers get suspicious.

And the past year’s headlines about secret government surveillance programs have given the defense bar a host of new reasons to question the tactics used to nab their clients. Media reports have offered glimpses of just how sophisticated the government’s toolkit has gotten: Metadata from the National Security Agency. A DEA database of calls that reaches back even further. Stingray devices that mimic cellphone towers to scoop up data.