The Whole Haystack

The N.S.A. claims it needs access to all our phone records. But is that the best way to catch a terrorist?

By Mattathias Schwartz – The NewYorker – January 26, 2015 Issue

Basaaly Moalin was convicted of financing Somali extremists, in the only case where the N.S.A.’s phone-records program was decisive.

Almost every major terrorist attack on Western soil in the past fifteen years has been committed by people who were already known to law enforcement.

One of the gunmen in the attack on Charlie Hebdo, in Paris, had been sent to prison for recruiting jihadist fighters. The other had reportedly studied in Yemen with Umar Farouk Abdulmutallab, the underwear bomber, who was arrested and interrogated by the F.B.I. in 2009. The leader of the 7/7 London suicide bombings, in 2005, had been observed by British intelligence meeting with a suspected terrorist, though MI5 later said that the bombers were “not on our radar.” The men who planned the Mumbai attacks, in 2008, were under electronic surveillance by the United States, the United Kingdom, and India, and one had been an informant for the Drug Enforcement Administration. One of the brothers accused of bombing the Boston Marathon was the subject of an F.B.I. threat assessment and a warning from Russian intelligence.

In each of these cases, the authorities were not wanting for data. What they failed to do was appreciate the significance of the data they already had. Nevertheless, since 9/11, the National Security Agency has sought to acquire every possible scrap of digital information—what General Keith Alexander, the agency’s former head, has called “the whole haystack.” The size of the haystack was revealed in June, 2013, by Edward Snowden. The N.S.A. vacuums up Internet searches, social-media content, and, most controversially, the records (known as metadata) of United States phone calls—who called whom, for how long, and from where. The agency stores the metadata for five years, possibly longer.

The metadata program remains the point of greatest apparent friction between the N.S.A. and the Constitution. It is carried out under Section 215 of the Patriot Act, which allows the government to collect “books, records, papers, documents, and other items” that are “relevant” to “an authorized investigation.” While debating the Patriot Act in 2001, Senator Russ Feingold worried about the government’s powers to collect “the personal records of anyone—perhaps someone who worked with, or lived next door to . . . the target of the investigation.” Snowden revealed that the N.S.A. goes much further. Metadata for every domestic phone call from Verizon and other carriers, hundreds of billions of records in all, are considered “relevant” under Section 215. The N.S.A. collects them on an “ongoing, daily basis.”

The N.S.A. asserts that it uses the metadata to learn whether anyone inside the U.S. is in contact with high-priority terrorism suspects, colloquially referred to as “known bad guys.” Michael Hayden, the former C.I.A. and N.S.A. director, has said, “We kill people based on metadata.” He then added, “But that’s not what we do with this metadata,” referring to Section 215.

Soon after Snowden’s revelations, Alexander said that the N.S.A.’s surveillance programs have stopped “fifty-four different terrorist-related activities.” Most of these were “terrorist plots.” Thirteen involved the United States. Credit for foiling these plots, he continued, was partly due to the metadata program, intended to “find the terrorist that walks among us.”

President Obama also quantified the benefits of the metadata program. That June, in a press conference with Angela Merkel, the German Chancellor, Obama said, “We know of at least fifty threats that have been averted because of this information.” He continued, “Lives have been saved.”

Section 215 is just one of many legal authorities that govern U.S. spy programs. These authorities are jumbled together in a way that makes it difficult to separate their individual efficacy. Early in the metadata debate, the fifty-four cases were sometimes attributed to Section 215, and sometimes to other sections of other laws. At a Senate Judiciary Committee hearing in October, 2013, Senator Patrick Leahy, of Vermont, called the fifty-four-plots statistic “plainly wrong . . . these weren’t all plots, and they weren’t all thwarted.” He cited a statement by Alexander’s deputy that “there’s only really one example of a case where, but for the use of Section 215 bulk phone-records collection, terrorist activity was stopped.” “He’s right,” Alexander said.

The case was that of Basaaly Moalin, a Somali-born U.S. citizen living in San Diego. In July, 2013, Sean Joyce, the F.B.I.’s deputy director at the time, said in Senate-committee testimony that Moalin’s phone number had been in contact with an “Al Qaeda East Africa member” in Somalia. The N.S.A., Joyce said, was able to make this connection and notify the F.B.I. thanks to Section 215. That February, Moalin was found guilty of sending eighty-five hundred dollars to the Shabaab, an extremist Somali militia with ties to Al Qaeda. “Moalin and three other individuals have been convicted,” Joyce continued. “I go back to what we need to remember, what happened in 9/11.” At the same hearing, Senator Dianne Feinstein, of California, talked about “how little information we had” before 9/11. “I support this program,” she said, referring to Section 215. “They will come after us, and I think we need to prevent an attack wherever we can.”

In the thirteen years that have passed since 9/11, the N.S.A. has used Section 215 of the Patriot Act to take in records from hundreds of billions of domestic phone calls. Congress was explicit about why it passed the Patriot Act—despite concerns about potential effects on civil liberties, it believed that the law was necessary to prevent another attack on the scale of 9/11. The government has not shown any instance besides Moalin’s in which the law’s metadata provision has directly led to a conviction in a terrorism case. Is it worth it?

Before 9/11, the intelligence community was already struggling to evolve. The technology of surveillance was changing, from satellites to fibre-optic cable. The targets were also changing, from the embassies and nuclear arsenals of the Cold War era to scattered networks of violent extremists. The law still drew lines between foreign and domestic surveillance, but the increasingly global nature of communications was complicating this distinction.

In Washington, many people blamed 9/11 on a “wall” between intelligence gathering and criminal investigations. In a report on pre-9/11 failures, the Department of Justice criticized the F.B.I.’s San Diego field office for not making counterterrorism a higher priority. Two of the hijackers—Nawaf al-Hazmi and Khalid al-Mihdhar—took flying lessons in San Diego and attended a mosque where the imam, Anwar al-Awlaki, had been the target of an F.B.I. investigation. They lived for a time in an apartment that they rented from an F.B.I. informant, and Mihdhar made phone calls to a known Al Qaeda safe house in Yemen. But the F.B.I. wasn’t solely at fault. The C.I.A. knew that Mihdhar had a visa to travel to the U.S., and that Hazmi had arrived in Los Angeles in January, 2000. The agency failed to forward this information to the F.B.I.

Three years after 9/11, the size of San Diego’s Joint Terrorism Task Force had tripled. In California, hundreds of local police became “terrorism liaison officers,” trained to observe anomalous activity that could presage an attack. The San Diego “fusion center” spent hundreds of thousands of dollars on computers and monitors, including fifty-five flat-screen televisions, which officials said were for “watching the news.” This was one of seventy-seven such centers nationwide, at a cost of several hundred million dollars. The F.B.I. office established a “field-intelligence group,” a special unit that gathered information about domestic terrorism threats.

Of particular interest was San Diego’s growing Somali population. The first Somalis came to San Diego in the late nineteen-eighties and settled in City Heights, a crime-ridden neighborhood of bungalows and strip malls half an hour east of downtown. Cheap housing and nearby social services had attracted immigrants fleeing Vietnam, Cambodia, Honduras, Guatemala, Serbia, Iraq, and Sudan. Most of the Somalis lived with members of their extended families and spoke little English. Many settled in an apartment complex at 3810 Winona Avenue: five gray two-story buildings, at the bottom of a hill beside a dusty ravine, known to the residents as the godka, the Somali word for cave. So many Somalis settled there that the owners changed the name of the complex from Winona Gardens to the Bandar Salaam Apartments.

After the Somali government collapsed, in 1991, the community, which now numbered more than a thousand, spread up Winona toward University Avenue. In 2000, a group of Somalis borrowed half a million dollars to buy an old church at Winona and University and converted it into a mosque, the Masjid Al Ansar. They hired an imam, Mohamed Mohamed Mohamud, also known as Mohamed Khadar, who had spent years studying the Koran in Islamabad, Pakistan. Khadar was a charismatic speaker and one of the leaders of a national council of Somali-American imams. Within two years, he had raised enough money to pay off the mosque’s mortgage. According to one of Khadar’s attorneys, the F.B.I. approached him multiple times. “I think they came to his house and to the mosque,” the attorney told me. “He exercised his right not to talk.” A law-enforcement official familiar with the Masjid Al Ansar told me that a paid informant had said that some of the mosque’s worshippers were recruiting jihadist fighters. This lead “correlated with other information, especially historically, when you look at Anwar al-Awlaki,” the official said. (“I’ve never heard this and it’s not true,” Bashir Hassan, the president of the mosque’s board, said.)

The Somalis were slow to trust people from other clans, let alone F.B.I. agents. Nonetheless, San Diego law enforcement did what it could to keep an eye on the Somalis and on the broader Muslim community. A recent document obtained by the A.C.L.U. shows that the Joint Terrorism Task Force kept a list of forty-two “Somali community leaders.” An F.B.I. document shows that the agency sent an informant to report back on “private conversations” and “areas of concern” at a banquet held at a Holiday Inn by San Diego’s chapter of the Council on American-Islamic Relations. The Joint Terrorism Task Force made twenty-one arrests in San Diego County in the three years after 9/11, which led to several deportations and seven prosecutions for offenses related to terrorism. One of these defendants was Somali; all came from predominantly Muslim countries.

Among the regular worshippers at the Masjid Al Ansar was Basaaly Moalin. Like Mihdhar and Hazmi, he was a recent immigrant whose social life revolved around the mosque. Unlike them, he had put down roots in San Diego. He had arrived in 1996 with his brother, Warsame. His mother soon followed. In 2000, Moalin made one of his periodic trips back to Somalia and married a woman named Maryan, a friend of his family; he had known her since elementary school. He visited Maryan and their five children once or twice a year. Sometimes she needled him about their different circumstances. “I am not like you, who ran away from here,” she once told him.Moalin was born Muse Shekhnor Roble, the sixth of seven children, in 1977, near Guriceel, a country town in central Somalia. His father herded livestock for a living, but had enough money to support three wives. When Moalin was a teen-ager, his family moved to Mogadishu. In 1991, the longtime dictator Siad Barre lost control of the capital, setting off Somalia’s ongoing civil war. During the fighting, a mortar shell struck Moalin’s home. A soldier found him lying on the ground and shot him several times, disfiguring his arm. A neighbor carried him, unconscious, to a hospital. It took three months for the news to reach his family that he was still alive. He spent four years in refugee camps in Somalia and Kenya before the U.S. granted him asylum and, eventually, citizenship.

Upon arriving in the U.S., he changed his last name to Moalin, a Somali honorific meaning “teacher” or “scholar.” Though he had no college degree and was not especially learned about Islam, he liked to talk. He considered himself an authority on matters ranging from politics to health to the best way to cook spaghetti. One San Diego acquaintance called him a “very smart guy,” and recalled Moalin’s desire to become an electrician. He took vocational classes and found work as a technician at a telecommunications company, but his frequent trips to Somalia made it difficult for him to advance. By 2005, he was driving a taxi, trading shifts with Warsame. Among the drivers, Moalin was “an unofficial leader,” another acquaintance said, “a trustworthy individual. He’d come and collect money for a cause.”

As the civil war in Somalia got worse, warlords, some backed by the C.I.A., fought with Islamists for control of Mogadishu. Moalin’s home town, Guriceel, mustered a local militia, which was funded largely by donations from abroad. Moalin became one of the main conduits of money flowing from the U.S. to his home region. He paid for food, housing, and tuition for two orphanages, according to documents obtained by his defense. The region was going through a major drought, and some of the money that Moalin collected went to a committee that trucked water to dry areas. Another part of his earnings went to the construction of a house in Guriceel. He planned to live there with his family one day, a respected and influential man who had stood by his country during its most troubled years. In San Diego, he carried himself as though already living in this future. He dressed like a businessman and worked out regularly at 24 Hour Fitness.

In 2013, foreign remittances to Somalia reached $1.3 billion, which accounts for roughly half of the country’s G.D.P. Most of this money moves through hawalas, informal networks of Islamic money-transfer agents. Some U.S. hawalas are underground; some are affiliated with licensed banks. It’s difficult for authorities to track which hawala transfers buy food and other necessities in Somalia and which might be support for militant groups. But most agree that the current system is preferable to Somali émigrés’ making periodic trips with bundles of cash. “Somehow the money’s going to move,” Carol Beaumier, a former federal bank examiner, said in a recent interview with American Banker.

Moalin was a regular customer at the Shidaal Express, a licensed hawala in City Heights, where he knew one of the employees, Issa Doreh, a college-educated man in his late fifties with a lanky build and a graying beard. Well known in the community, Doreh helped found a charity that gave indigent Somalis a traditional Muslim burial. He ministered to Muslim prisoners and was an informal mentor to young men at the mosque. “He’d say, ‘You should be careful and take advantage of your time,’ ” a young Somali man told me. Most first-generation Somali families steer women toward domestic roles, but Doreh’s eldest daughter was studying for a graduate degree in psychology. He had been planning to open a barbershop, he told me, when the owner of the Shidaal Express, impressed by his strong community ties, recruited him to work as a clerk.

Like Moalin, Doreh worshipped at the Al Ansar mosque. They both lived at 3810 Winona, Doreh with his wife and children and Moalin with a roommate, another working-class Somali. When Moalin sent a money transfer to Somalia, he often phoned Doreh to check on its status. Moalin called Doreh “Sheikh Issa” and sometimes bragged about their relationship.

The F.B.I.’s earliest known contact with Moalin was in 2003. Sean Joyce, the bureau’s former deputy director, has said that it was “based on a tip. We investigated that tip. We found no nexus to terrorism and closed the case.”

Beginning in 2006, many Somali-Americans found their loyalties divided between their old homeland and their new one. A group called the Islamic Courts Union had captured the southern half of Somalia, and pushed the U.S.-backed Transitional Federal Government out of Mogadishu. They imposed a sometimes harsh form of Sharia, and reopened the Mogadishu seaport and airport, which had mostly been closed for fifteen years. Within the Courts coalition was a militant wing, known as the Shabaab, or “youth.” Among the Shabaab were hardened jihadists who had fought in Afghanistan and conspired with Al Qaeda to commit the 1998 Embassy bombings in Dar es Salaam and Nairobi. Yet some Western diplomats, including voices within the State Department, argued in favor of negotiating with the Courts. To the Pentagon, however, the stability that came with the Courts regime seems to have been outweighed by the likelihood that radical jihadists in their ranks could give Al Qaeda a foothold in East Africa.

In late December, 2006, thousands of Ethiopian troops invaded Somalia, with the U.S. providing intelligence support. The Ethiopians sought to defeat the Courts, reclaim territory lost to Somalia during the Cold War, and restore the Transitional Federal Government to power.

The invasion made Guriceel, Basaaly Moalin’s home town, into a battleground. The Ethiopians “threw the fire everywhere,” one witness said. “Innocent people were dying—women and children, elderly people.” She continued, “Everyone took their gun and they fought.” According to Mohamud Uluso, a leader from Moalin’s clan, there were reports of the Ethiopians torturing and killing five of Moalin’s family members.

From Guriceel, the Ethiopians moved east to capture Mogadishu. Most of the Courts’ leadership fled to Eritrea. The Shabaab stayed behind to mount an insurgency. In the U.S., Somali immigrants gathered in front of the White House to protest the Ethiopian invasion. “The perception was that Ethiopia was colonizing the country,” Ahmed Sahid, who runs Somali Family Service, a nonprofit in San Diego, told me. “All kinds of groups were popping up.” “It was hard to call them bad guys,” Abdi Mohamoud, the director of the San Diego nonprofit Horn of Africa, said, speaking of the Courts at the time of the 2006 invasion. At that time, “all they were doing was fighting the Ethiopians. People didn’t see any danger in that.”

Among the Shabaab’s top commanders was Aden Hashi Ayro. He often changed his phone number and used code names. He was believed to be in his thirties, and was one of the youngest Somali guerrillas to have trained with the Taliban in Afghanistan, where some sources allege that he met Osama bin Laden prior to the 9/11 attacks. Ayro’s skill as a fighter made him a hero among Islamist hard-liners and a major target of the United States. David Shinn, who served as the U.S. Ambassador to Ethiopia under President Clinton, has written that the Shabaab, under Ayro’s leadership, “provided protection for three Al Qaeda operatives sought by the U.S.”

Like Moalin, Ayro grew up near Guriceel, which by late 2007 was under the control of a local clan militia. Though Ayro’s Shabaab forces had fought alongside Guriceel’s militia against the Ethiopians, the locals did not accept the Shabaab as their leaders and forced them to make their camp outside the town. Ayro was running out of money for food and ammunition. His profile made it difficult for him to receive patronage from overseas. “We were already in high gear cracking down on terrorist financing,” a senior U.S. diplomat working in the region at that time said. “We certainly were making efforts to restrict the flow of funds.” It appears that these efforts were successful, and that, in response, Ayro got in touch with Basaaly Moalin.

The U.S. had been tracking Ayro for some time, even launching an air strike against him in early 2007. Using Section 215, the N.S.A. told the F.B.I. that a phone number associated with Al Qaeda (apparently Ayro’s) was in what Joyce, the F.B.I.’s former deputy director, has called “indirect” contact with a San Diego phone number. (In 2012, the N.S.A. “tipped” fewer than five hundred numbers to the F.B.I., according to testimony from John Inglis, the agency’s former deputy director.) The F.B.I. determined that the phone belonged to Moalin. It then obtained warrants to tap his phone calls and intercept his e-mail.

By December, 2007, the F.B.I. wiretaps showed that Moalin was in regular contact with a man they believed to be Ayro. The government’s transcripts give the caller’s name as Shikhalow, or “slim limbs.” Early in 2008, an F.B.I. linguist wrote an e-mail saying that he’d heard “Shiqalow might be an aka for Eyrow. Please advise if that’s true.” “That is correct,” the F.B.I.’s lead agent replied. “It is a slurred together version of Sheikh Ayrow.”

SHIKHALOW: We need the sum of two thousand. No, three thousand one hundred and sixty; and it’s needed for Bay and Bakool, as their rations for these ten days.

Basaaly: Okay.

SHIKHALOW: And as of today, we don’t have a penny for them.

Basaaly: Okay.

SHIKHALOW: By any means, get me an immediate answer about that . . . today.

Basaaly: Leave that matter to me, if God wills.

The U.S. continued to watch Ayro closely. “We just heard from another agency that Ayrow tried to make a call to Basaaly,” an internal e-mail from the F.B.I. sent during the Moalin investigation reads. “If you see anything today, can you give us a shout? We’re extremely interested in getting real-time info (location/news) on Ayrow.”

On the phone, Moalin is eager to hear news from the front. He calls the Ethiopians “filthy ones” and “lice-infested.” Talking with another taxi-driver, he says that he was “pleased” to hear a bomb explode in Mogadishu while he was on the phone with his wife. He laughs about “the damage inflicted to those men,” apparently Burundian soldiers working with the U.N., which was conducting relief missions in Somalia.

Shortly after eleven o’clock on the night of December 20, 2007, Doreh’s phone rang. It was Moalin, looking for help with his fund-raising. He wanted to schedule a phone call with the imam, Mohamed Khadar, but Khadar “doesn’t have a phone number.”

Doreh seemed tired. Reading the transcript, it’s unclear whether he intended to comply with Moalin’s instructions or if he merely wanted to get off the phone and back into bed: “Yes . . . okay . . . yes . . . uh-huh . . . we will do our best . . . okay, God willing.” Moalin did not send any money through the Shidaal Express for a week. Then he called Doreh again to prod him. “He doesn’t have a telephone,” Moalin complained, of Khadar. “I did not reach him by phone and I didn’t go to the mosque at noon today.”

Moalin wanted Doreh to find Khadar “this afternoon at the mosque” and ask for money “for the men.” “God willing I’ll tell him if I see him,” Doreh said. It was shortly after four o’clock. By that evening, Moalin had found Khadar’s phone number and was calling him directly. Moalin and Khadar engage in some small talk, but do not mention Doreh. “I will complete the task, which pertains to the men, tomorrow, God willing,” Khadar says.

To the F.B.I. agents listening in at the time, these calls likely had echoes of the Mihdhar case from 9/11: an apparent link between a wanted terrorist and an obscure apartment, talk of bombings and suicide attacks conducted in a foreign language, connections to a money-transfer agency and a mosque.

Two of Moalin’s cousins told me that not all of Moalin’s talk should be taken literally, as he often engaged in fadhi ku dirir, literally “sitting and fighting,” the no-holds-barred bull sessions common among Somali men. But the F.B.I. took Moalin’s words seriously. At one point, an agency linguist fluent in Somali wrote an official assessment of Moalin’s motives. “He tends to exaggerate,” the linguist wrote. “He tries to outshine others in supporting home region.” The F.B.I.’s Field Intelligence Group later wrote that although Moalin was “the most significant al-Shabaab fundraiser in the San Diego area,” he was “not ideologically driven to support al-Shabaab.” Rather, his support for Ayro was a function of “tribal affiliation.” At one point, Moalin appeared to offer Shikhalow the use of his house in Mogadishu as a base of operations.

The Shabaab’s methods angered many Somalis. On January 15th, Moalin received a call from a friend named Abdulkadir, who warned him to be careful about whom he was sending money to:

ABDULKADIR: If today these men’s actions are what I have seen, they became terrorist actions.

Basaaly: Yes .

ABDULKADIR: The capital which you are supporting them with will take you to heaven, or are you asking to go to hell?

Basaaly: Well, that has its problems, but Abdulkadir, let’s look at it from another angle. They are the ones who are firing the most bullets at the enemy.

Less than a month later, Moalin went to the Shidaal Express and sent two thousand dollars to a contact in Dhusa Mareb, the provincial capital and one of Ayro’s main outposts. The money was sent under the name Dhunkaal Warfaa. “Did you receive Dhunkaal’s stuff?” Moalin asked Shikhalow the day after the money was sent.

Moalin called Doreh periodically to check on the status of individual payments. When he called the imam, Mohamed Khadar, Khadar often seemed eager to get Moalin off the phone. Moalin wanted to give Shikhalow a regular stipend; Khadar didn’t want to promise. At one point, Moalin told Khadar to hold back twenty or thirty people “that you trust” after Friday services at the mosque, and ask them for money to give Shikhalow. Khadar is noncommittal. “God willing, it will be all right,” he says. “Don’t worry.” Other times, Khadar criticizes the Shabaab. “They slaughter anyone they capture and that is not good policy to begin with,” he tells Moalin. Khadar tells Moalin to pursue “unity” and “cooperation” among differing groups in the area around Guriceel. “We need to have conditions tied to the support,” one of Moalin’s Guriceel contacts says a few days later. “We need to tell them that we are going to support you but we need a unity.” Moalin appears to agree. “They promise they will not fight with people because they need fund[s] from us,” he says.

Uluso, the clan leader, told me that negotiating with an armed militia from thousands of miles away was a complicated and sometimes frightening business for the diaspora, especially those whose family members still lived in militia-controlled areas. “It’s not that you like or support a certain group,” he said. “You are living in a situation where you don’t have the power to defend yourself.”

In March, 2008, the State Department announced that it had added the Shabaab to its list of foreign terrorist organizations. On the phone, Moalin attributed this action to “the American spy agency.” In April, the drought around Guriceel ended. “All the water tanks are full,” Shikhalow told Moalin. “Now it is the time to finance the jihad.”

Moalin’s answer is ambiguous. “Yes, we humans cannot feed everyone,” he says. “Only God can, you know?” Eleven days later, on April 23rd, he sent another nineteen hundred dollars to Dhusa Mareb.

On May 1st, a Navy ship off the Somali coast fired four Tomahawk missiles that struck a house in Dhusa Mareb, not far from where Moalin was born. A local headmaster counted sixteen corpses scattered around the crater, according to the Washington Post. That day, a Shabaab spokesman announced that “infidel planes” had killed Ayro. Hours after the attack, Moalin called a fund-raising contact in St. Louis who told him about “a rumor that birds targeted the house where Shikhalow, ‘small legs,’ used to stay one hour ago.” Later that evening, he shared the news with Doreh. “That man is gone,” he said. “That news is highly reliable.” Moalin received no more phone calls from Shikhalow. (Moalin’s attorney maintains that the F.B.I. was wrong about the identity of Shikhalow, and that Moalin and Ayro were never in contact.)

The F.B.I. was concerned about what Moalin might do in the immediate aftermath of Ayro’s death. Many in the intelligence community believed that Al Qaeda was expanding its focus from 9/11-style operations to include attacks on “soft targets,” like those which later took place in Mumbai and like the Shabaab’s own assault on the Westgate Mall in Nairobi. “We are keeping our ‘ears’ open for any intelligence of importance,” the F.B.I.’s Somali linguist wrote, in an e-mail to Special Agent Michael Kaiser. “Please let me know if you believe that Basaaly might be thinking about revenge here in the U.S.,” Kaiser responded. “We want to be on the safe side.”

In another e-mail, Kaiser raised the possibility that Moalin might try to replace Ayro among the Shabaab’s leadership. In addition to monitoring his phones, the F.B.I. conducted physical surveillance of Moalin. Over the summer, Moalin started to notice. “We are closely watched,” he said. Apparently referring to another money transfer, he added, “The task we were involved in a few days ago was—it was reported to them.” An associate, he said, was “visited by the men.” (In response to written questions submitted through his lawyer, Moalin later denied that he was aware of any specific surveillance.)

Up until August, 2008, Moalin expressed sympathy for the Shabaab, calling Mukhtar Robow, the group’s spokesman, his “boss.” (According to the defense’s translation, Moalin called Robow “my man.”) Moalin’s St. Louis contact, Mohamud Abdi Yusuf, who was later convicted of material support, considered Moalin to be dangerously indiscreet. “You are not accountable with anything,” he said. “You don’t even know where you are; you talk as you wish, you don’t know what you should hide and what you should not.”

During the course of 2008, the Shabaab’s influence in Somalia grew stronger and its ideology more extreme. Its forces consolidated territory in the southern part of the country, sponsored pirates, used floggings and stonings to enforce their version of Sharia law, and undertook spectacular suicide attacks. Its leaders banned the Somali flag and declared support for Osama bin Laden. In a private letter, bin Laden rebuffed a Shabaab request for a formal alliance, lest “the enemies escalate their anger and mobilize against you.”

Whatever credibility the Shabaab had among mainstream U.S. Somalis evaporated in late 2009, when a suicide bomber killed twenty-five people during a university commencement ceremony in Mogadishu. The elders of San Diego’s Somali community held a meeting to condemn the attacks. Issa Doreh was among them. “Suicide martyrdom is not martyrdom,” Khadar, the imam, said, according to a participant. “All Muslim scholars prohibited this action.”

The young Somali man in San Diego told me that he had once considered joining the fight against the Ethiopians. “I came to Issa Doreh and said I wanted to help,” he said. “He told me, ‘Don’t go fight. Study. Fix yourself.’ ”

The F.B.I. arrested Moalin on the morning of October 31, 2010, at San Diego International Airport, as he was preparing to fly to Somalia. His last allegedly criminal transfer to Somalia was two thousand dollars, sent more than two years earlier to Omer Mataan, a man who was apparently a Somali militant. (It is unclear whether he was affiliated with the Shabaab.)

Across town, at a Department of Homeland Security office in Chula Vista, Mohamed Khadar arrived with his lawyer at what he thought was an interview about a green card. Once he was inside, a group of F.B.I. agents appeared and put him in handcuffs. Doreh was arrested early the next morning, at his home in the Bandar Salaam Apartments, as he was preparing to drive his children to school. The three men and another cabdriver were charged with a variety of crimes, including conspiracy and providing material support for terrorism, a crime that was created in the mid-nineteen-nineties, and whose definition was broadened in 1996 and again with the Patriot Act. Prosecutors used the material-support charge fewer than ten times before 9/11, and have used it successfully more than a hundred and sixty times since, according to Human Rights Watch.

In City Heights, the reaction was shock. Doreh and Khadar were men of high standing who had publicly condemned the Shabaab. “The community knew these people,” Hassan, the president of the mosque’s board, told me. “They don’t believe, even up to now.”

Two years passed before the trial began, in January, 2013. On the first day, the courtroom was filled with the defendants’ Somali supporters, wearing orange ribbons. The judge, Jeffrey Miller, had served as a deputy attorney general in California for nearly twenty years and was known for his coolheadedness and independence. Concerned that the orange ribbons might influence the jury, he told the Somalis in the gallery to take them off. The prosecution’s case began with Shikhalow’s words: “Now is the time to finance the jihad.” A prosecutor said that Aden Hashi Ayro was “a rock star among terrorists in Somalia.”

Both sides labored to explain the meaning of snippets of eavesdropped conversations carried on in a foreign language. They brought in experts who summarized the politics of the region around Guriceel. Acronyms piled up as prosecutors described the Islamic Courts Union, the T.N.G., the T.F.G., Ahlu Sunna Waljama’a, Al Itihaad Al Islamiya, Al Shabaab—and explained which of these myriad groups should be considered terrorists and which of them were moderate. Six Somalis had made a dangerous journey to Djibouti in order to testify by video and vouch for Moalin as a gregarious, hardworking extrovert who devoted himself to his family and the care of his ailing mother. One of them, a local police chief, claimed that he, not Ayro, was the one with the nickname Shikhalow, and said that he had fallen out of touch because, on May 1st, the day of Ayro’s death, the Shabaab turned on the local community and he had to flee. The core of the prosecution’s case was excerpts from seventy-nine phone calls that had been culled from more than eighteen hundred conversations and assembled in white binders for the jury. A few alternative translations were put together by the defense. “I’ve never had an experience like this, where things have come in, rolling in so late,” Judge Miller said, wading through the competing transcripts.

Doreh appears in eight of the transcripts. One contains a Somali proverb repeatedly cited by the prosecution as evidence that he was part of the conspiracy:

BASAALY: We are not less worthy than the guys fighting.

ISSA: Yes, that’s it. It’s said that it takes an equal effort to make a knife; whether one makes the handle part, hammers the iron, or bakes it in the fire.

In other conversations, he makes cryptic references to “books” and “pens” that were to be sent to “the Koran school,” which the government argued were code for Shabaab-related activity.

The jury deliberated for two days before finding all four defendants guilty. More than two hundred Somalis from San Diego and elsewhere wrote to the court, asking for leniency. Hassan, the president of the mosque’s board, said that Moalin’s actions were caused by his anger at the Ethiopian invasion of Guriceel. “His situation is as, if Mexican or Russian troops marched into San Diego and kill our families and friends,” he wrote. “Then our feelings and emotions will rise and we would be compelled to anything to alleviate such hardship.”

But by last summer, a year and a half after the convictions, when I visited San Diego, few Somalis would admit to having more than a passing acquaintance with any of the convicted men. “I saw the outside of his house. I don’t ask anything about what is on the inside,” one of the Somali men who gather in the parking lot outside the Taste of Africa restaurant said, when I asked about Khadar. He said that he had never met Moalin.

One of three family members who turned up for an afternoon conference with Moalin’s attorney, Joshua Dratel, was a cousin who cares for Moalin’s mother while raising two children in a house up the street from the mosque. On the day of our second meeting, she wore a gray hijab. We sat on the couch with another relative while Moalin’s mother, dressed in a black hijab, sat on the floor, leaning against a doorjamb. The cousin went to the basement and hauled up a rolling suitcase that Moalin had with him when he was arrested. Inside were shirts and slacks, still wrapped in the cleaner’s cellophane, and a pair of loafers with shining buckles. “The people who they say he was supporting,” she said, “they don’t wear these kinds of clothes.” She didn’t need to read the transcripts, she said. She knew her cousin was a good person.

A few days later, I met Hassan, the president of the mosque’s board, in a one-room office that he runs a medical-supply company out of. When I first contacted him, he had said that he would try to find Somalis who knew Moalin, Khadar, or Doreh and who would be willing to speak with me. Now he told me, gently, that no one was willing to speak.
Moments later, his cell phone rang. The caller, an F.B.I. agent, told Hassan that he was looking for a woman. Her name sounded Somali:

F.B.I. AGENT: She said she worked for you.

HASSAN: She never worked for us. She filled out an application, with fingerprints. But she never worked.

F.B.I. AGENT: Do you still have her contact information?

HASSAN: Um . . . if I give somebody’s private information, does that violate her privacy?

F.B.I. AGENT: I’m not asking you to do anything that you don’t want to do.

HASSAN: I think I have her number.

F.B.I. AGENT: Great.

Hassan did not have the number on him, he said. He would need to look it up. After he hung up, I asked how often local Somalis got calls like that. “All the time,” he said.

The fact that the Moalin investigation began with the N.S.A. was not revealed until after the conviction. Moalin’s attorney, Dratel, who learned about it through the news, called the timing “outrageous” and filed a motion for a new trial. All four defendants have since appealed, and the case is with the Ninth Circuit Court of Appeals; oral arguments will not likely be heard until late this year. Moalin’s is “the only criminal case in which a defendant has been able to challenge the lawfulness of the 215 program,” Jameel Jaffer, the deputy legal director of the A.C.L.U., told me. Dratel has served as counsel for the Guantánamo detainee David Hicks, the alleged Silk Road operator Ross Ulbricht, and the filmmaker Laura Poitras. He quickly realized that Moalin’s case could set an important precedent for the legality of N.S.A. surveillance. The appeals court could choose to agree with an argument made by Dratel in his filings that bulk metadata collection violates the Fourth Amendment, which requires search warrants to “particularly describ[e] the place to be searched, and the persons or things to be seized.”

At his sentencing, Moalin said that he felt nervous and preferred to deliver his statement seated. He said that he was worried about Maryan, his wife, who had been given a diagnosis of breast cancer, and his five children. “I love America,” he said. He denied any affinity for the Shabaab. “They kill a lot of people, educated, from my people, my tribe,” he said. “I don’t like what they are doing in Somalia.”

Wardens at the federal prisons where Moalin and Doreh are now held denied my requests to interview the men. Khadar declined to talk to me. In a letter that Doreh wrote to me last fall, he said that he was “clueless as to any wrong doing . . . the essential part of faith is to respect others with peace and passion. I also do respect and abide by the laws of the country, and never had intention to break it, directly or indirectly. Is it because I am Muslim why I am being singled out, falsely accused, persecuted, and having my family relations destroyed? . . . Weren’t the United States Laws made with the view of providing equal rights for all?” He repeated something that he said to Moalin in the transcripts: “What’s going to happen will happen. . . . It’s Allah (God) the almighty who decides and determines man’s daily action.”

In November, 2013, Moalin was sentenced to eighteen years in prison, Khadar to thirteen years, Doreh to ten years. At the sentencing hearing, Judge Miller called Doreh “someone who apparently was an upstanding member of the Somali community.” He said that Moalin was “capable of both humanitarian virtue” and of collaborating with terrorists. He said that he understood the defense’s argument that “until we have walked a mile in Mr. Moalin’s shoes . . . what he has been through personally and what his country has been through,” we cannot understand “the choices he has made.”

“I don’t think we need to worry about any of these three gentlemen,” Miller said.

I met General Keith Alexander one morning last spring, in midtown Manhattan. He had retired from the N.S.A. a few weeks earlier and was soon to announce the launch of IronNet Cybersecurity, a new private venture. He told me that the potential impact of Moalin’s arrest should not be underestimated, especially considering his association with Ayro. “You might ask, ‘What’s the best way to figure out who the bad guys are?’ ” he said. “What would you start with? You’d say, ‘Well, I need to know who his network of friends are, because chances are many of them are bad, too.’ ”

It’s possible that Moalin would have been caught without Section 215. His phone number was “a common link among pending F.B.I. investigations,” according to a report from the Privacy and Civil Liberties Oversight Board (PCLOB), an independent agency created in 2004 at the suggestion of the 9/11 Commission, which Obama had tasked with assessing Section 215. Later, in a congressional budget request, the Department of Justice said that the Moalin case was part of a broader investigation into Shabaab funding. Senator Ron Wyden, of Oregon, who, like Leahy, has pressured the N.S.A. to justify bulk surveillance, said, “To suggest that the government needed to spy on millions of law-abiding people in order to catch this individual is simply not true.” He continued, “I still haven’t seen any evidence that the dragnet surveillance of Americans’ personal information has done a single thing to improve U.S. national security.” Representative James Sensenbrenner, of Wisconsin, who introduced the Patriot Act in the House, agreed. “The intelligence community has never made a compelling case that bulk collection stops terrorism,” he told me.

Khalid al-Mihdhar’s phone calls to Yemen months before he helped hijack American Airlines Flight 77, on 9/11, led Obama, Alexander, Feinstein, and others to suggest that Section 215 could have prevented the attacks. “We know that we didn’t stop 9/11,” Alexander told me last spring. “People were trying, but they didn’t have the tools. This tool, we believed, would help them.”

But the PCLOB found that “it was not necessary to collect the entire nation’s calling records” to find Mihdhar. I asked William Gore, who was running the F.B.I.’s San Diego office at the time, if the Patriot Act would have made a difference. “Could we have prevented 9/11? I don’t know,” he said. “You can’t find somebody if you’re not looking for them.”

Last year, as evidence of the fifty-four disrupted plots came apart, many people in Washington shifted their rhetoric on Section 215 away from specific cases and toward hypotheticals and analogies. “I have a fire-insurance policy on my house,” Robert Litt, the general counsel of the Office of the Director of National Intelligence, said. “I don’t determine whether I want to keep that fire-insurance policy by the number of times it’s paid off.” James Clapper, the director of National Intelligence, has called this “the peace-of-mind metric.”

Michael Leiter, who led the National Counterterrorism Center under George W. Bush and Obama, told me that Section 215 was useful but not indispensable: “Could we live without Section 215? Yes. It’s not the most essential piece. But it would increase risk and make some things harder.”

In addition to phone metadata, the N.S.A. has used Section 215 to collect records from hotels, car-rental agencies, state D.M.V.s, landlords, credit-card companies, “and the like,” according to Justice Department reports. Once the N.S.A. has the phone metadata, it can circulate them through a shared database called “the corporate store.”

To some, this sounds less like fire insurance and more like a live-in fire marshal, authorized to root through the sock drawer in search of flammable material. “The open abuse is how they use that data,” Mike German, a former F.B.I. agent and lobbyist for the A.C.L.U., who is now a fellow at the Brennan Center, said. “It’s no longer about investigating a particular suspect.”

In 2013, Le Monde published documents from Edward Snowden’s archive showing that the N.S.A. obtained seventy million French phone-metadata records in one month. It is unknown whether any of these calls could be retrospectively associated with the Paris attacks. “The interesting thing to know would be whether these brothers made phone calls to Yemen in a way that would have been collected by a program like Section 215 or another signals intelligence program,” Leiter told me last week. “I don’t know the answer to that question.”

Philip Mudd, a former C.I.A. and senior F.B.I. official, told me that tallying up individual cases did not capture the full value of Section 215. “Try to imagine a quicker way to understand a human being in 2015,” he said. “Take this woman in Paris. Who is she? How are you going to figure that out? You need historical data on everything she ever touched, to accelerate the investigation. Now, do we want to do that in America? That’s a different question, a political question.”

Documents released by Snowden and published by the Washington Post show that the N.S.A. accounted for $10.5 billion of the $52.6 billion “black budget,” the top-secret budget for U.S. intelligence spending, in 2013. About seventeen billion dollars of the black budget goes to counterterrorism each year, plus billions more through the unclassified budgets of the Pentagon, the State Department, and other agencies, plus a special five-billion-dollar fund proposed by Obama last year to fight the Islamic State in Iraq and al-Sham (ISIS).

The maximalist approach to intelligence is not limited to the N.S.A. or to Section 215. A central terrorist watch list is called the Terrorist Identities Datamart Environment, or TIDE. According to a classified report released by the Web site the Intercept, TIDE, which is kept by the National Counterterrorism Center, lists more than a million people. The C.I.A., the N.S.A., and the F.B.I. can all “nominate” new individuals. In the weeks before the 2013 Chicago Marathon, analysts performed “due diligence” on “all of the records in TIDE of people who held a drivers license in Illinois, Indiana, and Wisconsin.” This was “based on the lessons learned from the Boston Marathon.”

In retrospect, every terrorist attack leaves a data trail that appears to be dotted with missed opportunities. In the case of 9/11, there was Mihdhar’s landlord, the airport clerk who sold Mihdhar his one-way ticket for cash, and the state trooper who pulled over another hijacker on September 9th. In August, 2001, F.B.I. headquarters failed to issue a search warrant for one of the conspirators’ laptops, despite a warning from the Minneapolis field office that he was “engaged in preparing to seize a Boeing 747-400 in commission of a terrorist act.”

There was plenty of material in the haystack. The government had adequate tools to collect even more. The problem was the tendency of intelligence agencies to hoard information, as well as the cognitive difficulty of anticipating a spectacular and unprecedented attack. The 9/11 Commission called this a “failure of the imagination.” Finding needles, the commission wrote in its report, is easy when you’re looking backward, deceptively so. They quoted the historian Roberta Wohlstetter writing about Pearl Harbor:

It is much easier after the event to sort the relevant from the irrelevant signals. After the event, of course, a signal is always crystal clear; we can now see what disaster it was signaling since the disaster has occurred. But before the event it is obscure and pregnant with conflicting meanings.

Before the event, every bit of hay is potentially relevant. “The most dangerous adversaries will be the ones who most successfully disguise their individual transactions to appear normal, reasonable, and legitimate,” Ted Senator, a data scientist who worked on an early post-9/11 program called Total Information Awareness, said, in 2002. Since then, intelligence officials have often referred to “lone-wolf terrorists,” “cells,” and, as Alexander has put it, the “terrorist who walks among us,” as though Al Qaeda were a fifth column, capable of camouflaging itself within civil society. Patrick Skinner, a former C.I.A. case officer who works with the Soufan Group, a security company, told me that this image is wrong. “We knew about these networks,” he said, speaking of the Charlie Hebdo attacks. Mass surveillance, he continued, “gives a false sense of security. It sounds great when you say you’re monitoring every phone call in the United States. You can put that in a PowerPoint. But, actually, you have no idea what’s going on.”

By flooding the system with false positives, big-data approaches to counterterrorism might actually make it harder to identify real terrorists before they act. Two years before the Boston Marathon bombing, Tamerlan Tsarnaev, the older of the two brothers alleged to have committed the attack, was assessed by the city’s Joint Terrorism Task Force. They determined that he was not a threat. This was one of about a thousand assessments that the Boston J.T.T.F. conducted that year, a number that had nearly doubled in the previous two years, according to the Boston F.B.I. As of 2013, the Justice Department has trained nearly three hundred thousand law-enforcement officers in how to file “suspicious-activity reports.” In 2010, a central database held about three thousand of these reports; by 2012 it had grown to almost twenty-eight thousand. “The bigger haystack makes it harder to find the needle,” Sensenbrenner told me. Thomas Drake, a former N.S.A. executive and whistle-blower who has become one of the agency’s most vocal critics, told me, “If you target everything, there’s no target.” Drake favors what he calls “a traditional law-enforcement” approach to terrorism, gathering more intelligence on a smaller set of targets. Decisions about which targets matter, he said, should be driven by human expertise, not by a database.

One alternative to data-driven counterterrorism is already being used by the F.B.I. and other agencies. Known as “countering violent extremism,” this approach bears some resemblance to the community-policing programs of the nineteen-nineties, in which law enforcement builds a listening relationship with local leaders. “The kinds of people you want to look for, someone in the community might have seen them first,” Mudd said. After the Moalin arrests, the U.S. Attorney’s office in San Diego began hosting a bimonthly “Somali roundtable” with representatives from the F.B.I., the Department of Homeland Security, the sheriff’s office, local police, and many Somali organizations. “They’ve done a lot of work to reach out and explain what they’re about,” Abdi Mohamoud, the Somali nonprofit director, who has attended the meetings, said.

Does the Moalin case justify putting the phone records of hundreds of millions of U.S. citizens into the hands of the federal government? “Stopping the money is a big deal,” Joel Brenner, the N.S.A.’s former inspector general, told me. Alexander called Moalin’s actions “the seed of a future terrorist attack or set of attacks.”

But Senator Leahy contends that stopping a few thousand dollars, in one instance, over thirteen years, is a weak track record. The program “invades Americans’ privacy” and “has not been proven to be effective,” he said last week. The Moalin case, he continued, “was not a ‘plot’ but, rather, a material-support prosecution for sending a few thousand dollars to Somalia.”

On June 1st, Section 215 and the “roving wiretap” provision of the Patriot Act will expire. Sensenbrenner told me that he doesn’t expect Congress to renew either unless Section 215 is revised. “If Congress knew in 2001 how the FISA court was going to interpret it, I don’t think the Patriot Act would have passed,” he told me. In 2013, Leahy and Sensenbrenner introduced the U.S.A. Freedom Act, which would scale back the N.S.A.’s powers; the act would grant subpoena power for the PCLOB and create an advocate charged with representing privacy interests before the secret FISA court. The bill was watered down and passed by the House, but it failed to reach the Senate floor. Mitch McConnell, the Senate’s top Republican, said that the N.S.A. needed every available tool for the fight against ISIS. “This is the worst possible time to be tying our hands behind our back,” he said.

The Paris attacks offered yet another opportunity to argue for the value of Section 215. Senator Bob Corker, of Tennessee, said that his priority was “insuring we don’t overly hamstring the N.S.A.’s ability to collect this kind of information.” Senator Chuck Grassley, of Iowa, said, “If it can happen in Paris, it can happen in New York again, or Washington, D.C.” The Senators focussed on attacks that Section 215 had not stopped and imagined attacks that it could theoretically stop. There was no mention of what it had actually stopped, or of Basaaly Moalin.

(*) Mattathias Schwartz , a contributing writer of The New Yorker, lives in New York.