Following the September 2012 terrorist attacks against a U.S. diplomatic compound and a CIA satellite base in Benghazi, Libya, that killed U.S. Ambassador Christopher Stevens along with Sean Smith, a communications officer, and Tyrone Woods and Glen Doherty, two CIA contractors, the State Department’s Diplomatic Security Service had to redefine much of what it does.

The Benghazi attack ignited a political firestorm fueled by political partisanship during a presidential election cycle in 2012, and we are watching, this week, an effort to rekindle that furor with the House committee interrogating former Secretary of State Hillary Clinton and her aides.

From muddled talking points to wild accusations, the after-blast of controversy following the tragic events in Libya shows Washington at its worst with all sides equally shameful. Yet Benghazi exposed glaring in-house weaknesses in the State Department’s assessment of dangerous locations where the diplomats who wanted to pursue “business as usual” had to first and foremost comprehend the critical threats of terrorism and political chaos, and prepare to meet them.

Historically—and operationally—the desire by diplomats to shake hands and the prudent need for security often clash as much as they coexist; one of the arguments made by many in the DSS following Benghazi was that the security side of the shop never had a seat at the table in determining threat and making decisions that could override the decisions of diplomats and ambassadors.

One of the most immediate changes to the DSS following Benghazi was the establishment of a new internal directorate that focused on high-threat diplomatic posts overseas where the possibility of terrorist attacks warranted the installation of added physical security measures and demanded that personnel assigned to these locations undergo advanced high-threat tactical training.

Previously, agents sent overseas, even to war zones, often were expected to have the tactical prowess of a Navy SEAL but in reality the job description required that they be program managers and dignitary protection specialists.

The man chosen to lead this new initiative was Special Agent Bill Miller, who already had ample experience with high-threat dangers combating terrorism. Miller had served in war zones before and, in February 1995, Miller and his partner Jeff Riner—two DSS agents assigned to the U.S. Embassy in Islamabad, Pakistan—captured Ramzi Yousef, mastermind of the 1993 World Trade Center bombing. Following a tour in Baghdad, Miller had engineered the first high-threat training course for DSS personnel heading into combat areas. In April 2014, Miller was named the DSS director.

Then, almost three years after the terrorist attack on the ad hoc U.S. diplomatic facility in Benghazi, Libya, the DSS would face one its biggest security challenges ever. The venue would be Kenya, a nation deemed high-threat with good reason, where terrorists from al Qaeda and al-Shabab, and other Islamic extremists already had left their mark many times with audacious, bloody attacks as long ago as 1998, when the U.S. embassy was blown up, killing more than 200 people, and as recently as the massacre at Garissa University College in April that killed 147.

Kenya is one of the 30 countries that the DSS deems high-threat—nations, according to Doug Allison, the DSS assistant director and deputy assistant secretary for the High Threat Programs directorate, that constitute “10 percent of the posts but 90 percent of the problems.”

The occasion this time would be July’s Global Entrepreneurial Summit in Nairobi, to be attended by President Barack Obama, Secretary of Commerce Penny Pritzker, and a slew of State Department undersecretaries, diplomats, and titans of corporate America. Al-Shabab had bragged openly that it would disrupt the event, inflicting carnage and catastrophe.

Securing the conference and its high-threat and highest- profile attendees would constitute a nightmare scenario for security professionals—one hampered by the fact that security, according to the State Department and the White House, was not to become a talking point of the summit. Securing the conference, in a nation that was classified as high-threat, would be a major test of the new protocols put in place following the Benghazi attacks.

For much of the spring—and into the summer months—a steady stream of Diplomatic Security special agents filed through Nairobi’s Jomo Kenyatta International Airport. At first the men and women who entered the country on diplomatic passports, their credentials and side arms on their hips, wore business suits. These were the “special agents in charge” and supervisors who reported directly to State Department leadership and who had to plan and coordinate one the largest American-led security operations in the history of the African continent.

The flow of American manpower and material continued, but now there were more personnel wearing polo shirts and khakis, working with Kenyan security commanders and counterterrorist unit heads as they brought in blast- and bullet-resistant armored vehicles and Mk. 18 assault rifles.

The special agents spent countless hours on advance details checking out hotels, routes to and from the airport, and traffic patterns that might provide terrorists with an ideal kill zone to detonate IEDs or launch an attack involving suicide bombers and active shooters. And, on one breezy morning, the most combat capable group of the American contingent was involved in a lifelike training class meant to make sure that if all the preparations and all the planning failed, as first responders they would be able to react to the catastrophic reality of a mass casualty event.

The subject for the morning’s class, conducted inside a secluded and heavily fortified police base northeast of Nairobi, was tactical medicine—the life-saving techniques that operators in the field could employ to stop the ravages of a gaping chest wound, or a limb sheered off by shrapnel.

The curriculum was gory and not designed for the faint of heart, but the men in the room had all seen their share of bloodshed before: U.S. federal agents, members of the elite DSS special operations unit known as the Mobile Security Deployments, or MSD, and Kenyan operators from the Recce Squad Commandos of the General Service Unit, the paramilitary wing in the National Police Service of Kenya.

The American contingent in recent memory had been rushed to places like Kabul, Karachi, Sana’a and Baghdad. They knew all about the heart-thumping, chest-pounding adrenaline rush of running a protective detail through terrorist-control terrain. Kenya’s Recce Squad Commandos, veterans of a growingly vicious terrorist war against Somali jihadists, were no strangers to battle themselves. Drills conducted with gunfire and simulated explosions were choreographed for realism and dire urgency.

The American agents spearheaded the training. Adorned in the latest tactical gear, tattoos on their arms and biceps shaped by endless hours in the gym, the MSD operators all looked like they had been selected for the mission straight out of Hollywood central casting. One of their Kenyan counterparts, they couldn’t help but notice, wore camouflage fatigues and flip-flops. Throughout the class, as instructors showed the latest techniques for applying a tourniquet and stabilizing a victim critically burned by a bomb blast, the eyes kept going back to the flip-flops.

The Kenyan officer noticed, and as the discussion moved from training to real-world experiences, he lifted up his pant leg to show the grenade shrapnel scars he received at Garissa University when it was attacked by al-Shabab last spring. That explained why he wasn’t wearing combat boots.

“I was lucky,” he said. “One comrade was killed in the attack. Many more were wounded in the exchange with the terrorists.”

The DSS officers took note.

The 2,000 men and women of the State Department’s Diplomatic Security Service constitute one of the smallest of the federal government’s numerous law enforcement agencies—there are, by comparison nearly 14,000 FBI agents and 4,400 Secret Service agents who serve exclusively inside the United States. Yet the DSS mission is global and diverse.

Domestically, the DSS is responsible for the protection of visiting foreign non-head-of state dignitaries, as well as myriad other activities including international investigations, threat analysis, counterterrorism, security technology, cybersecurity, and protection of people, property, and information; just as the U.S. Secret Service, responsible for protecting past, present and potential future presidents, as well as visiting heads of state, also investigates currency and credit card counterfeiting, DSS agents, in eight different domestic field offices (and 16 resident offices) investigate passport and visa fraud cases.

Overseas, DSS agents are deployed to 160 nations and based out of 275 American embassies and consulates around the world to administer security programs at these diplomatic posts and to protect the ambassador and all U.S. diplomatic personnel. The DSS agent in charge of security at an embassy is called the Regional Security Officer, or RSO, is both sheriff on post and manager of a endless array of security protocols, including supervising the U.S. Marine Security Guards tasked with securing classified material and protecting persons at these locations.

The DSS, in one shape or form, has existed since 1916, when it was known mysteriously as the Bureau of Secret Intelligence. But in 1985 the organization—then known as SY—underwent a revolutionary change in its mission and size when, following Hezbollah’s suicide bombing of the U.S. embassy in Beirut in April 1983, a panel chaired by Admiral Bobby Inman reviewed security deficiencies in how the State Department allocated resources—man and material—to protect American diplomatic posts overseas.

The SY became the DSS, but the agency was still small, numbering fewer than 700 agents. Then, following the Nairobi and Dar-es-Salaam embassy bombings of 1998, the ranks of the DSS grew to about 1,200 agents. It swelled to 2,000 agents in the wake of the 2001 attacks that provoked the U.S. Global War on Terror that evolved into nation building, in conjunction with massive security operations, emanating from new, huge embassies in Kabul and Baghdad.

The DSS recruits young men and women who are able to adapt to any overseas environment—from a cocktail party on Embassy Row in London to the evacuation of an embassy in Sana’a. But after Benghazi, as noted earlier, all DSS agents being deployed to a high-threat post are required to take an intensive 10-week High Threat Operation Course (HTOC)—a paramilitary regimen that prepares agents to operate in the highest-threat environments around the world.

The High-Threat Directorate “was created to concentrate, with pinpoint laser-like focus, on the highest threat and high risk posts around the world,” says Andy Koropeckyj, the director of the Office of High-Threat Programs. “The training focuses on hard skills, weapons and tactics, advanced emergency medical care.”

Koropeckyj ran down the list of skills to be honed: tactical communications; firearms proficiency; medical (emergency trauma care); high-speed maneuvers (all types of vehicles); communications; helicopter operations; land navigation (with and without vehicles); small-unit tactics; leadership and planning; movement security and static security and securing venues and VIP movement (from individual skills to broader team action). Much of this training is conducted with live fire.

Agents that were tagged to deploy to Nairobi were rushed to shooting ranges throughout the Beltway in preparation. (Remarkably, the DSS does not have its own dedicated training center. Plans to build an indigenous State Department training center at Fort Pickett near Richmond, Virginia, have been in the works for years, but breaking ground at the Foreign Affairs Security Training Center, or FASTC, has been halted by congressional quicksand.) Agents also perfected their evasive driving skills, performing J-turns under simulated attack with special armored limousines that have the steering wheel on the right-hand side—just like other cars in Kenya.

Much of the preoperational preparation involved the coordination the flow of background and actionable intelligence on Kenya and the al-Shabab threat for the agents responsible for the unobtrusive yet impenetrable ring of security being prepared for the GES. Al-Shabab has a record of picking soft targets like Garissa, or the Westgate Mall in Nairobi, attacked in September 2013: a pointblank orgy of killing where four suicidal gunmen killed 63 victims and wounded nearly 200 more before they were killed by Kenyan security forces. Nothing could be soft about the targets the DSS was protecting.

DSS planners had to meet with their own intelligence departments to review al-Shabab capabilities, and they had to meet with counterparts from the CIA, the FBI, and other facets of America’s intelligence and counterterrorist community. Much of the intel was funneled through the U.S. Embassy in Nairobi: information was shared between the DATT, or Defense Attaché, and his counterparts in Kenyan military intelligence (elements from the Department of Defense and the ever-growing USAFRICOM worked around the clock monitoring threats, as well as terrorist intentions and capabilities. The local CIA Station and the Kenyan National Intelligence Service (NIS) worked side by side disseminating and analyzing the raw intelligence. Virtually all facets of Kenyan law enforcement liaised and coordinated planning with the RSO’s office. Dean Shear, the DSS Special Agent in Charge in Nairobi, was the point man for much of the behind-the-scenes planning.

One of the takeaway lessons from the Benghazi review panels was that there could no longer be a cut-and-paste method for security operations in high-threat nations, where personnel without the required training and without the necessary physical security barriers would be deployed to defend ambassadors or posts on an impromptu and temporary duty, or TDY, basis. Careful planning and the required resources would ensure that each high-threat post had the men and tools to deter or mitigate the kind of swarm assault that the terrorists in Benghazi used to attack the Special Mission Compound on September 11, 2012. The security operation in Nairobi was prepared, planned, and executed to put into practice all the lessons learned since Benghazi.

Boots on the ground would be an essential element in the massive DSS security operation. The special agents that clocked the frequent flier miles back and forth between Nairobi and Dulles, and the special agents who would secure routes to and from the airport, as well as man posts at the many venues and at the hotels, were intended to provide a deterrent wall of sunglass-wearing dignitary-protection specialists who could call upon a friendly and reliable local host government for force-multiplying counterparts.

The tactical specialists from the MSD were to provide multifaceted support for the DSS mission in Nairobi. “The mission in Kenya was something of a hybrid,” MSD Operations Chief Tom Rhodes explained. He had served as an assistant regional security officer in Nairobi years earlier, so he was familiar with the intricacies of working with the Kenyan police; he had also served in Tel Aviv, Lahore, Pakistan, and Harare, Zimbabwe. The MSD operators, with their Mk. 18s, the latest communications gear available, their specially built armored fans to shuttle 300 U.S. government delegates, were supposed to serve as a force multiplier for the Kenyans. The MSD operators, positioned at key locations with Velcro “Federal Agent” patches on their body armor, stood side by side with Kenyan commandos in DPM camouflage fatigues.

The GES would be a challenge for 96 hours—the day before the event began, the two days of the conference, and the wrap when everyone’s guard would be down and “everyone’s nerves would be frayed,” as RSO Shear put it.

DSS agents were posted at the airport, at the conference centers, and at several fully booked hotels where the delegates and support personnel were stationed. The command post at the U.S. Embassy ran at a fever’s pitch monitoring movements and tracking everyone’s positions. The secure radio frequencies hopped with call signs and coded locations. Shift leaders led motorcades in and out of a multitude of venues, coordinating each flashing light and deafening siren with a Kenyan counterpart attached to their detail.

The operation—seamless and invisible to outside observers—was a brilliant success, which explains why you have not heard much about it. The DSS helped to create a target that was too hard for al-Shabab to consider; the armored ring built around Nairobi for the event deterred and daunted any terrorist intention. “The Kenyan authorities did a marvelous job of clearing traffic and clearing the streets,” said the MSD’s Tom Rhodes. “The usually chaotic Nairobi traffic did not delay or disrupt any of the movements or any of the operations. There were, in fact, no incidents reported at all.”

DSS preparations for the GES constituted tens of thousands of man-hours of planning and in the end everything was disassembled, packed and readied for shipment back to the United States in under 24 hours. As hawkers at the Nairobi peddled Obama T-shirts, the RSO’s office took apart everything that had been so carefully put in place over months. The DSS agents departed Kenya, on connecting flights to points around the world and, primarily, back to their Washington headquarters.

Tom Rhodes made sure his men—and his equipment—were secure and in place for the transatlantic trek back to Dulles. As he sat in his chair, closing his eyes at 30,000 feet over somewhere, he realized that any rest would be limited to a few hours of shuteye high above the Atlantic.

Once the GES ended, the DSS was once again in the middle of planning for what in many ways is the largest security operation in the world—the annual opening ceremony of the United Nations General Assembly in New York City, or UNGA.

“UNGA,” as a retired DSS special agent puts it, “is the Super Bowl, World Series, and World Cup of dignitary protection headaches all wrapped up in two weeks of motorcades and crisscrossing details in the heart of Manhattan.” There are over 160 foreign ministers and other non-head-of-state dignitaries that converge on New York City. Many of the visiting foreign ministers receive a protective detail of DSS special agents; the foreign visitors come with their own protective details, and there is an on-the-ground working relationship that has to be forged by men and women from different countries, who speak different languages, and might very well maintain different tactical protocols.

At UNGA the DSS agents are supported by members of the NYPD’s Intelligence Division, motorcades receive NYPD Highway Patrol escorts, and the high-threat “packages” also warrant coverage from ESU, the NYPD’s elite SWAT and rescue Emergency Service Unit. Each of the foreign ministers—from allies such as Great Britain and France to smaller republics in Africa—has a frenetic schedule of meetings and appointments; all expect to dine in Manhattan eateries; others want to see a show or dabble in, well, other types of entertainment.

But difficult as UNGA might be, as the largest high-octane security operation of its kind anywhere in the world, the large-scale deployment of manpower and material to Kenya was the kind of precedent the DSS wanted to set. Nothing like it had been done in the 100 years recorded in the State Department security logbook, and no, it was nothing like Benghazi.