As they see it, global warming stands to make corporate security as high-stakes in the 21st century as it was in the 19th.

The Pinkertons wanted me to picture myself in a scene of absolute devastation. “A hurricane just wipes out everything, and you need to feed your children,” Andres Paz Larach said. The power grid is down, shipments of food are cut off, the water is no longer potable — how do you get what you need to survive? What risks do you take? It was a hot early morning in March, and we were driving through a pine forest high in the mountains surrounding Santa Ana Jilotzingo, 25 miles northwest of Mexico City. Our Suburban, equipped with bulletproof windows and reinforced doors, labored slowly over the dirt road, which appeared to have been washed out by a recent thunderstorm.

For much of the previous hour, Paz Larach and two other executives from Pinkerton, Carlos Manuel López Portillo Maltos and Paul Rakov, had been explaining the company’s philosophy of risk management. Now over 150 years old, having long outlived its reputation as Andrew Carnegie’s personal militia, the agency has evolved into a modern security firm. Over the last decade or so, Pinkerton began noticing a growing set of anxieties among its corporate clients about distinctly contemporary plagues — active shooters, political unrest, climate disasters — and in response began offering data-driven risk analysis, in addition to what they’re more traditionally known for. Dressed in an untucked powder blue oxford and round, rimless sunglasses, Paz Larach, the firm’s senior vice president in charge of the Americas, paused before affecting a look of brutal candor. “You’re going to turn to desperate measures,” he said. Everybody will. The other Pinkertons nodded.

I was seated in the rear row next to Rakov, a marketing officer who, at 51, had recently shifted his career from more traditional P.R. to Pinkerton. He was now fully fluent in the language of tactical response. He chimed in to observe that preparing for a disaster can carry its own risks. He gave the example of a drought. “If a client has food and water and all the other stuff,” he said, “then they become a target.” López Portillo and Paz Larach uttered small words of consensus in Spanish, while scanning through email on their phones. “And if and when desperate people discovered that cache of water and food,” he continued, it was the Pinkertons’ job to protect it at whatever cost.

Pinkerton instructors competing in weapons training. Dina Litovsky/Redux, for The New York Times

[Read about how Wall Street is hedging against the apocalypse.]

Our destination that morning was a shooting range called Club de Tiro Jaribú, which Pinkerton sometimes uses for agent and client trainings. The idea had been to demonstrate what Pinkerton agents go through before they are deployed to disaster zones. López Portillo had also lately fielded several inquiries from corporate clients, asking for lessons in tactical skills like evasive driving and extraction from disaster zones, both for themselves and sometimes hundreds or more of their employees. “Someone who works in corporate — say, as an attorney or salesperson,” he said, “they find it something completely new and useful.”

At the range, which was made up of seven terraced target areas bulldozed into a steep ridge, we were greeted by our instructor, Reynold Castro Róman. A former Mexican military officer, he wore black fatigues with the Pinkerton all-seeing-eye logo emblazoned on either shoulder. A kaffiyeh hid a long scar along his neck. During an intel mission 16 years ago, Castro Róman was flying over marijuana fields when the plane went down — from what Castro Róman suspected was narco fire — killing the three others on board. Since then, he has dedicated himself almost exclusively to private-sector urban-combat training, often for Pinkerton.

Over the next three hours, Castro Róman worked us steadily through various readiness drills, including quick-draw methods, accuracy competitions and timed reloading under pressure. We shot nine-millimeter pistols and Israeli assault rifles. Considering all the firearms, the atmosphere was relaxed and sporting. Nearby, a man grilled chorizo and carne asada. A cooler and makeshift bar was stocked with beer, wine and mezcal.

Pinkerton agents setting up targets for rifle training. Dina Litovsky/Redux, for The New York Times

The scene was a stark contrast to the big-data wonkery I was pitched in the car ride over. But Paz Larach explained that their statistical and tactical approaches were fundamentally connected. All businesses exposed themselves to risk, which had to be mitigated, insured or, more relevantly, defended against. Even if the Pinkertons couldn’t predict the specific risks of the future, they had a general sense of what it might look like — and what opportunities they might avail themselves of as it materialized. According to the World Bank, by 2050 some 140 million people may be displaced by sea-level rise and extreme weather, driving escalations in crime, political unrest and resource conflict. Even if the most conservative predictions about our climate future prove overstated, a 1.5-degree Celsius rise in temperature during the next century will almost certainly provoke chaos, in what experts call climate change’s “threat multiplier”: Displacement begets desperation begets disorder. Reading these projections from the relative comforts of the C-suite, it wasn’t difficult to see why a company might consider enhancing its security protocols.

For Pinkerton, the bet is twofold: first, that there’s no real material difference between climate change and any other conflict — as the world grows more predictably dangerous, tactical know-how will simply be more in demand than ever. And second, that by adding data analytics, Pinkerton stands to compete more directly with traditional consulting firms like Deloitte, which offer pre- and postdisaster services (supply-chain monitoring, damage documentation, etc.), but which cannot, say, dispatch a helicopter full of armed guards to Guatemala in an afternoon. In theory, Pinkerton can do both — a fully militarized managerial class at corporate disposal.

Later, after Paz Larach took his turn on the range — during which he emptied a Galil ACE assault rifle into a human-shaped cardboard cutout, then quickly drew his nine-millimeter, grouping four shots in the chest-cavity bull’s-eye — he offered the example of Hurricane Maria. On the day the Category 4 hurricane made landfall in Puerto Rico in 2017, he received more than 30 calls from American businesses and multinationals. He wouldn’t go into detail but explained that many chief executives felt blind to the situation and effectively tendered a blank check if Pinkerton could provide security. Over the next few days, as the company deployed hundreds of agents to the island, some of them, Paz Larach claimed, reported seeing firearms brandished at gas stations. “We had to escort the cargo with real agents, have cars chase the main truck,” he said. “Those who did not have protection were having their cargo hijacked.”

Reynold Castro Róman, a Pinkerton weapons instructor. Dina Litovsky/Redux, for The New York Times

Aware that he might end up sounding vampiric, Paz Larach hesitated, then eventually confessed what he’d wanted to say in the first place: The future looked pretty good for Pinkerton.

You could be forgiven for assuming that the Pinkertons were relics of the past. Like the stage coaches the company once protected, the name Pinkerton summons up sepia-tinted images of the American West — black-hatted detectives pursuing train robbers, or rooting out labor agitators from coal mines. And indeed, Allan Pinkerton organized his agency in response to the lawlessness of the frontier. When he first began offering his services in the early 1850s, a majority of the territories west of the Mississippi remained ungoverned; few towns offered policing, and fewer still had the means to investigate crimes after the fact. Overnight, Pinkerton’s novel methods of “crime detection,” which included infiltrating gangs and developing networks of informants, became the standards of investigation, and his company became a sort of de facto national police force. According to some historians, by the late 19th century, the Pinkerton National Detective Agency numbered more men than the United States Army.

In the intervening years, the Pinkertons have survived in no small part because of their ability to adapt to the changing landscapes of crime. To differentiate his agency from common bounty hunters, Pinkerton worked to professionalize his ranks with formal attire, pay and badges and created what probably was the first national criminal database. In the following years, as railroads opened up the frontier and settlement brought with it the rule of law, Pinkerton turned to what he saw as the “riotous element” growing in company towns. Between 1877 and 1892, Pinkertons were dispatched to break up some 70 labor strikes — either by going undercover to provide intel, or through brute force.

Pinkerton agents running an executive through a simulated hijacking. Dina Litovsky/Redux, for The New York Times

[Read David Leonhardt on the economics of climate change.]

It was only after a particularly lethal clash during a strike in Homestead, Pa., in 1892 that the public began to wonder if the threat of the Pinkertons eclipsed those they supposedly protected against. In the years since the frontier closed, antitrust sentiment had grown, and demand for the Pinkertons lessened — in part because the government was more able to enforce its laws. In the aftermath of Homestead, Congress and 23 states passed “anti-Pinkerton” acts, banning government bodies from hiring mercenaries as strikebreakers.

In the decades since, the Pinkertons have undertaken several rebrandings, each aimed at lowering their public profile, though through it all they never gave up the lucrative specter of their name: the Pinkerton Agency, Pinkerton’s Inc., Pinkerton. During the first half of the 20th century, the company protected wartime factories and later began to seek out new markets in parts of the world, like India and China, where authority could still be outsourced. In 1999, the Swedish security giant Securitas AB absorbed the agency, buying it for a reported $384 million, and the company underwent rebranding once again, this time as a boutique risk-management firm. It began diversifying into intellectual-property services and cybersecurity. Among their most popular new services is the Pinkerton Dedicated Professional, in which agents join a client’s company like any other new hire, allowing them to provide intel on employees. By 2018, the agency said it could count among its clients about 80 percent of Fortune 1,000 companies.

The best outcome for these new data-driven Pinkertons is that this century lapses into the kind of lawlessness and disorder that makes it look more like the 19th — which many scientists and economists think it could. Since 1980, a period that includes all 20 of the warmest years in recorded history and 18 of the 20 most intense hurricane seasons in the satellite era, losses in the United States from storms, wildfires and droughts topped $1.6 trillion — nearly a third of which occurred in just the last five years. And this exponential destruction is just the beginning of what David Wallace-Wells, in his book “The Uninhabitable Earth,” calls the Great Dying: a worldwide economic decline, sharply deteriorated living conditions, disruption to basic government functions and widespread hunger. Looking deeper still into the future, the predictions are even more dire. Over the next century, 3.7 degrees of warming could contribute to an additional 22,000 murders and 1.3 million burglaries in the United States.

A global threat monitor displaying earthquakes and volcanoes in Pinkertons’ Global Intelligence Center. Dina Litovsky/Redux, for The New York Times

Whatever the exact costs of climate change, it is Pinkerton’s job to read between the numbers looking for the potential for violence. If you’re suffering only one hurricane every 20 years or so, shelling out $1 million to Pinkerton isn’t such a big deal, Paz Larach explained; you bake it into your risk. “But if there’s a disaster every year, which is happening more and more, it makes more sense to have dedicated staff on standby.” A Pinkerton on standby doesn’t mean protection for just your insurable risks but also for the uninsurable risks — business interruptions, theft of trade secrets, pandemics. And with the environment increasingly weaponized against the poor, to borrow Wallace-Wells’s phrase, the sectors that rely on cheap labor will face more unrest among workers; the state will struggle to keep up with crime; and in the aftermath of storms, with landslides blocking first responders, regional offices will be cut off.

And this, of course, is exactly the sort of environment in which the Pinkertons thrive.

The morning after weapons training, I found myself once again in the back of an armored Suburban. Paz Larach was talking on the phone beside me as we made our way to the Autódromo Hermanos Rodríguez, a racetrack where we were scheduled to learn evasive driving. Throughout my visit, the Pinkertons had insisted on providing me a full security detail, which included the armored car and two escorting agents, as a way of simulating executive protection. The two agents were clad in black suits and earpieces and shadowed me to dinner, interviews and an outing to the Templo Mayor Museum; rarely during the three days could I get either to chat with me. They treated the job, however farcical it seemed, gravely.

Like people, companies could become habituated to modernity’s relative safety, Paz Larach said. But it was his job to shock them out of such thinking, whether through exercises or data. For much of the last century, the traditional form of defense for businesses has been insurance compensation — pay a premium up front, recover later. But one of the many byproducts of this model of subsidized recovery, according to economists, has been unfettered growth along floodplains, hurricane-impact zones and other high-risk areas. After Hurricane Harvey, Pinkerton found clients were frustrated and open to alternatives. “Most clients were not prepared enough,” Paz Larach said. “An insurance policy is just a piece of paper.”

An 1884 newspaper sketch of Pinkertons escorting workmen during a mining strike. Alamy

[Read about new legal strategies to make the world’s biggest polluters pay for climate change.]

Paz Larach rattled off a suite of services that were not, strictly speaking, covered by that piece of paper: armed warehouse defense, executive extraction, 24-hour surveillance, chartered helicopters and planes, escorted cargo shipments. “If you abandon your property, you’re kind of just blindfolding yourself,” he said — checking news, hoping for the best. “We’re your eyes and ears on the ground.” During the 2017 hurricane season, the Pinkertons chartered half a dozen planes across the Caribbean, each of them full of food and under armed escort, to the tune of around $100,000 each. Ordinarily, Pinkerton bills on a relatively cheap hourly basis, but during a state of emergency, the rate soars, something Paz Larach compared to Uber’s surge pricing. By the end of the season, after Maria, Harvey and Irma, Paz Larach told me the company billed tens of millions of dollars.

However bankable and flashy, tactical work is by its nature highly reactive, which has left Pinkerton vulnerable to steep fluctuations in revenue. At the same time, Paz Larach found himself increasingly frustrated by how few businesses took even the simplest of precautions — generators, stores of water, cameras to prove damage to adjusters. But as he brought these ideas to businesses, he discovered an unexpected drawback to the Pinkerton name: Companies didn’t tend to call for advice; they called because they needed “a guy for a job,” as Paz Larach put it. So over the last five years, as the company watched the demand for incident response skyrocket, it began to pour resources into building three data-and-information-gathering centers: one each in Seattle and The Hague, which focus mainly on crunching big data to predict crime trends worldwide, and a “Global Intelligence Center” in Mexico City, which is geared more toward the operational response to those trends.

The Mexico City Global Intelligence Center occupies a large wing on the fourth floor of an angular glass building in the neighborhood of Jardines del Pedregal. At the entrance, through double glass doors, I was greeted by an enormous black rendering of the Pinkerton logo and slogan — “We never sleep” — along with framed prints of documents and photographs from the agency’s early days, among them one of Allan Pinkerton standing with President Lincoln, another the rap sheet for Butch Cassidy. The center of the space was dominated by a long white desk, at which several employees, all in black Pinkerton jackets, sat at computers. Behind a biometric scanner lay the operational nerve center of the office, which appeared surprisingly empty. From our conversations, I’d expected a hive of analysts hunched over intricate software displays. But nearly every surface was eerily immaculate, free of any visible sign of stress; at their computers, a handful of analysts browsed Associated Press stories and pecked numbers into Excel. CNN was on. The whole office felt somehow incomplete, as if the company had staged the place in haste.

Allan Pinkerton, founder of the Pinkerton Agency, in 1862, during the American Civil War. Universal History Archive/UIG, via Getty Images

Paz Larach and I were met there by David Valenzuela, a former Mexican police officer who looked to still be adjusting to corporate life: He sported a deep blue fatigue shirt, which he’d tucked into his slacks. Valenzuela was in charge of overseeing the analysts who worked there. After scanning into the nerve center, he stood by a screen on the wall, which flashed up a GPS readout of our location. Several separate, smaller frames within the larger one then displayed ticking feeds: Twitter, a news wire, Doppler radar, quick links to police and fire. This was the Pinkerton “threat monitor” — quite literally, a monitor.

Many of the Pinkertons’ tools, including the threat monitor, were originally developed only for internal use — for an agent tracking a C.E.O. through disputed cartel territory, or keeping an eye on a tanker in waters known for piracy. But over the last few hurricane and wildfire seasons, when storms and blazes began to overtake industrial corridors throughout the Eastern Seaboard and California, the company found that C.E.O.s wanted access to these tools. To sweeten the deal, Pinkerton built out packaged services, including storehouses of food, a threat dashboard for C-suite computers and daily intelligence briefings. Excited by the implications, the company began rolling out an entire conceptual framework around what it called “applied risk science.”

Listening to Paz Larach pitch the agency’s future — all of it rendered in the gauzy language of consulting — I was struck by its relative simplicity, which belied, in part, just how far most companies and governments are from accepting the reality of climate change. Even if Pinkerton’s core competency still lies in tactical response, the means of preparation are not exactly the province of big data: Put food in a warehouse, aggregate news, consult the latest open-source modeling. Pinkerton doesn’t even see this strategy as climate-related, per se. The company doesn’t have a dedicated climate division, nor climate experts; from its perspective, that would be redundant. Pinkerton sells safety, or its pretense, in the face of catastrophe, and the only real differences between the catastrophes of this century and the 19th, on some level, will be rate and severity. As Jack Zahran, the president of Pinkerton, put it to me, Pinkerton is a 150-year-old start-up, still pitching the same basic vision: You aren’t prepared enough, and the government is too clumsy to save you.

Later, at the racetrack, we watched three young men suit up in ski masks to shoot paintballs at our S.U.V. Even among my Pinkerton handlers, the theater of exercise seemed to strain the reasonable connections between tactical response and climate change. Throughout my visit, I wondered whether I had caught Pinkerton in the midst of an awkward organizational transition, or if the company stood merely to capitalize on the world’s growing panic — and if the difference really mattered. They had, after all, taken me to fire automatic weapons, ostensibly as a training exercise against desperate, disaster-ravaged people. It was impossible to experience that and not project it into a future in which, in the absence of true climate policy or mitigation, capital felt free to protect itself from outside risks — whatever form they may take.

During one of the long meals that Paz Larach, Rakov, López Portillo and I shared, the novelty of my being there had faded just enough for them to reflect personally on climate change. The relentless pragmatism of trying to respond to disasters and analyze their occurrence had seemed to leave the men with little space for the existential dread that marks so much of the modern condition. But for whatever reason, on this night, as we picked at a plate of escamoles — a central-Mexican delicacy of ant larvae — they spoke about their anxieties.

López Portillo, who until then had been jovial if diplomatic in answering my questions, turned solemn, his eyes glancing around the vaulted ceiling. He said he worried about his children, and what sort of world he might be leaving them. But his fear, he clarified, wasn’t exactly that they wouldn’t learn to adapt; it was that he, their father, didn’t know what adaptation would look like. He said that he feared variables he didn’t know how to calculate, variables he couldn’t conceive of yet.

When López Portillo finished, Paz Larach admitted that thinking that far out was still difficult for him. He was 33 and just married. What the most immediate future held for him was a new home in Miami, where he and his wife had just bought an apartment on the water. It had always been their dream. When I asked him about sea-level rise — something with which Miami is practically synonymous — he paused for a moment, then said, “We know it’s a risk, but we looked at it and decided it was worth it.” And anyway, the apartment wouldn’t be ready until 2021. They’d deal with it then.