What goes into protecting Prince William and Princess Kate as they visit the US?

Months before Prince William and Catherine, princess of Wales, were set to visit Boston -- their first trip to the U.S. since 2014 -- one little-known American government agency sprang into action.

The royal couple on Wednesday begins a three-day swing in Massachusetts culminating in an awards ceremony Friday night.

Agents from the Diplomatic Security Service (DSS) -- diplomats with badges and guns -- make up their protective detail, according to two senior DSS officials who spoke with ABC News.

"We are the law enforcement and security arm of the U.S. Department of State and we protect the secretary of state, foreign dignitaries who are visiting the United States foreign ministers, former heads of state, members of the royal family, in this case, as well as U.S. citizens, athletes, corporate sponsors," Andrew Wroblewski the deputy assistant secretary and assistant director of the U.S. Department of State’s Diplomatic Security Service (DSS) for domestic operations said.

Wroblewski, who served on various protective details himself during his tenure at the agency, said they have been working with the United Kingdom to get the schedule and protection strategy firmed up.

PHOTO: In this July 8, 2011, file photo, a Supervisory Special Agent keeps an eye on the media as the Duke and Duchess of Cambridge arrive at Los Angeles International Airport. (U.S. Department of State)
PHOTO: In this July 8, 2011, file photo, a Supervisory Special Agent keeps an eye on the media as the Duke and Duchess of Cambridge arrive at Los Angeles International Airport. (U.S. Department of State)

MORE: Prince William, Kate head to Boston: Everything to know about the couple's 1st US trip in 8 years

"So, whenever the Diplomatic Security Service has a visiting foreign dignitary, what we do is we assess the threat against that dignitary in the United States," he explained without getting into specifics about the royal couple's visit. "We have our Threat Investigations and Analysis Directorate, they'll actually look at all source reporting from open source to classified intelligence. And we'll make it a determination on whether or not we need to protect that person and at what level we need to provide protection."

PHOTO: In this July 8, 2011, file photo, Prince William, Duke of Cambridge and Catherine, Duchess of Cambridge are arrive at LAX Airport in Los Angeles. (John Shearer/WireImage via Getty Images)
PHOTO: In this July 8, 2011, file photo, Prince William, Duke of Cambridge and Catherine, Duchess of Cambridge are arrive at LAX Airport in Los Angeles. (John Shearer/WireImage via Getty Images)

MORE: Buckingham Palace releases new image of Royals future

Matthew O'Brien, the assistant special agent in charge of the Boston DSS field office, the lead office for the visit, told ABC News preparations started in September, and have involved 11 law enforcement agencies -- from local police to state police and the federal government.

PHOTO: In a photo posted to the Twitter account of the Department of Diplomatic Security Service, D.S.S. federal agent is shown. (State Department DSS/Twitter)
PHOTO: In a photo posted to the Twitter account of the Department of Diplomatic Security Service, D.S.S. federal agent is shown. (State Department DSS/Twitter)

https://abcnews.go.com/2020/Royal_Wedding/slideshow/prince-william-kate-middletons-young-love-st-andrews-13350518/image-13351205

"I'm confident in the plan we've we've built," he said. "I will say that we cannot do anything without our state and local partners."

The Boston field office is one of the 33 different offices in the United States. Where the agency's presence is really felt is in the 170 countries the agency is in.

They are also protecting the U.S. Men's National Soccer team at the 2022 World Cup, according to the officials.

The movements of the royal couple are "choreographed down to the minute" and the same goes for the security plan, O'Brien said.

What goes into protecting Prince William and Princess Kate as they visit the US? originally appeared on abcnews.go.com