FBI Director James Comey explained Tuesday how top Hillary Clinton aide Cheryl Mills received immunity and was able to sit in on Clinton’s interview with the bureau despite being on her legal team during a Senate Homeland Security Committee hearing.

Sen. Ben Sasse (R., Neb.) asked Comey why Mills was given immunity in return for her laptop as part of the FBI investigation into Clinton’s private email server.

"Director Comey, why was Cheryl Mills granted immunity in the classified data investigation for Secretary Clinton?" he asked.

Comey explained that the type of immunity Mills was given, active production immunity, is meant to safeguard her from criminal prosecution by the Justice Department

"So, it was not personal immunity for her," Comey said. "It was–the immunity was, we will not use, we the Department of Justice, directly against you anything we recover on this laptop. Fairly common tool of criminal investigations, but that’s what it was."

He said the reasoning behind this was that the FBI needed the laptop for its investigation, and Mills’ lawyer negotiated the deal so the bureau could get it.

"The FBI’s judgment was we need to get to that laptop," Comey said. "We need to see what it is. This investigation has been going on for a year, and this was, in the negotiation, a tool that her lawyer asked for that the Department of Justice granted so we could get the laptop."

Sasse asked if Mills was Clinton’s lawyer during her interview with the FBI.

"Is that irregular?" he asked.

"Our understanding was that she was acting as a member of her legal team," Comey responded. "Not irregular."

He said that Mills’ ability to sit in on Clinton’s interview was because the FBI does not "police" who can and cannot observe a voluntary interview.

"Not the FBI’s job to decide who can be in a voluntary interview," he said. "There are ethical canons that govern lawyers, but we don’t police that."

Mills served as Clinton’s chief of staff at the State Department.