John Carlin ’99 entered hostile, if not quite enemy, territory when he appeared at a March conference in San Francisco filled with representatives of the tech industry to defend the FBI’s efforts to force Apple to unlock a terror suspect’s iPhone.

Carlin, the soft-spoken assistant attorney general who heads the Justice Department’s National Security Division, sought common ground as he found himself repeatedly cut off by a fellow panelist, a former counterterrorism official turned television talking head, who criticized the FBI’s subpoena.

“With the ingenuity in the room, if we share the same values of [wanting to] ensure public safety and civil liberties in their broadest sense from both government over-intrusion and theft from nation states or terrorist attacks, we can come up with a better system than we are in right now,” Carlin said.

For more than seven years, Carlin has quietly been at the center of the most sensitive counterterrorism cases, which have often involved tricky technological questions—first as an adviser to FBI Director Robert Mueller and then at the National Security Division.

It is not a career path Carlin could have envisioned when he arrived as a student at Harvard Law School, and not just because the National Security Division didn’t exist at the time. Carlin, a Manhattan native who studied English literature and political science at Williams College, admits he didn’t know much about computers. But a career as a federal prosecutor always appealed to him.

Last year saw more terrorism cases than any other time since 9/11, according to Carlin.

So he followed the advice of Professor Philip Heymann ’60, the former deputy attorney general, who told him the Justice Department’s Tax Division was a good place to gain trial experience before seeking work as an AUSA. Carlin was one of the first recipients of the HLS Heyman Fellowship (established by Samuel Heyman ’63), which he said was “incredibly helpful” in making a federal career possible.

It was in the Tax Division that Carlin first developed his expertise in cybercrime while working on an IRS investigation of an online fraud scheme. “I was the youngest guy there,” he said. “They assume you know how to use a computer and how computer stuff works, so suddenly you become the go-to guy.”

He took that interest with him to the U.S. attorney’s office in Washington, where he began a six-year tenure shortly after 9/11, and then on to the FBI, where he helped write one of Director Mueller’s first speeches on cybersecurity.

Heymann says Carlin is well suited to a role advising agencies such as the CIA or the National Security Agency. “It’s a good move to be reasonable and mild-mannered,” he added.

As it happened, Carlin has found familiar faces among his counterparts: The National Security Agency’s former chief lawyer, Rajesh De ’99, was his law school housemate. Another one of their classmates and friends, Adam Szubin ’99, is the acting under secretary of the Treasury for terrorism and financial intelligence. “It’s wonderful to see people you have known for a long time and trust and respect in these roles,” said De, who is now a partner at Mayer Brown.

Carlin has seen firsthand how the nature of online threats has evolved, whether it be from economic espionage, North Korea hacking a movie studio’s computer network in revenge for a movie plot, or lone wolf ISIS sympathizers inspired by social media. “It’s a humbling array of threats,” he said.

Last year saw more terrorism cases than any other time since 9/11, Carlin said. “The only common factor inside the U.S. is social media,” he said, with a third of suspects age 21 or younger and half under 25. “That’s obviously a troubling phenomenon.”

Outreach has become part of Carlin’s job. He has spoken at HLS twice over the past few years. A week before his San ­Francisco appearance, he addressed industry executives from Madison Avenue, Hollywood and Silicon Valley gathered at the Justice Department on the importance of reaching audiences attracted to violent extremist recruitment via social media, according to The New York Times.

Carlin’s tenure atop the National Security Division is likely to end along with the Obama administration, but he is reluctant to talk about what might come next. He quotes his “former boss” Bob Mueller, who liked to say, “You can’t do the job you’re doing if you’re thinking about the next one.”