Marcus Brauchli is a managing partner of North Base Media and a former editor of The Washington Post and the Wall Street Journal.

The headlines tell part of this story: Facebook fails to stop wide misuse of user data. Self-driving Uber car kills pedestrian. United Airlines violently removes passenger from overbooked seat. Purdue Pharma is criticized for lax oversight of opioid distribution.

It’s our daily corporate kaleidoscope. Companies fumble their missions and instantly become objects of virally spread public ridicule, political condemnation and sometimes, eventually, government regulation.

For businesses, this social-media-fueled cycle is a modern challenge of the phenomenon known as political risk — the danger that unexpected, external factors can suddenly and dramatically affect a business’s best-laid plans. Political risk is as old as commerce: From its founding in 1600, the East India Company lost its ships to tempests and pirates and its markets to wars. Today’s external factors can be technology glitches or state-sponsored hacks; shifting public attitudes; and unscrupulous managers, employees or customers. And all the while political systems keep changing, crimes keep happening, catastrophes keep occurring.

For the past six years, former secretary of state Condoleezza Rice and fellow Stanford University business professor Amy Zegart have jointly taught a course that explores the ever-shifting nature of political risk and how companies can cope. They have now turned their class into an engaging, practical handbook for thinking about these issues, “Political Risk: How Businesses and Organizations Can Anticipate Global Insecurity.”

Both offer intriguing perspectives. Zegart, a professor of political economy, worked in government and for the business consultancy McKinsey & Co. Rice brings insights not just from the boardrooms of corporate giants she’s served, such as Chevron, Hewlett-Packard and Charles Schwab, but from the Situation Room of the White House, where decisions have profound impacts on companies and people around the world.

Indeed, it’s impossible to read this book without thinking how relevant its advice is for American business leaders in the age of President Trump, whose instinctive misunderstanding of economics rivals his willful ignorance of the world. A spattering of half-baked presidential actions, from tariffs and threats to abandon trade agreements to tweets attacking or praising individual companies and industries, has made planning a slippery exercise for executives.

While Rice and Zegart optimistically view some of Trump’s actions as ephemeral (“It is likely that economic realities will temper these protectionist impulses — after all, globalization is a state of being, not a policy”), the chaos caused by recent pronouncements reinforces the imperative in this era for companies to integrate political-risk planning into their businesses.

Beyond politics, a number of factors Rice and Zegart identify contribute to the complexity that accounts for the need for structured thinking about political risk. Consider some of them:

●Technology and transportation have allowed manufacturers to spider-web their sourcing and manufacturing operations across the globe, seeking out the leanest, most agile partners — not always in Human Rights Watch-friendly countries. Big consumer brands such as Nike and Apple have come under pressure for working conditions in Asian factories that make their products.

●The Internet creates security risks, with unscrupulous operators, hackers and even states ever more able to disrupt a business. Facebook’s failure to stop a British firm from improperly harvesting data from 87 million users for political purposes is but one recent example; a more salacious episode was North Korea’s surgical hack in 2014 and high-impact release of private and work emails from Sony’s movie studio and executives, an action apparently launched to punish the studio for making a (pretty good) comedy mocking North Korean leader Kim Jong Un.

●At the same time, smartphones and social media allow activists to network globally and to launch campaigns that can put serious economic pressure on a business. The U.S. entertainment company SeaWorld was financially crippled by a boycott campaign that followed the release of a compelling documentary on SeaWorld’s treatment of a captive killer whale, or orca, and the company never came up with an effective response.

Rice and Zegart systematically enumerate various types of political risk — from the political and geopolitical, to the legal, regulatory and contractual, to the more contemporary forms of terrorism, climate and cyber. How companies cope with these kinds of challenges, or how they should, is the heart of “Political Risk.”

The book does an excellent job of laying out concisely how to anticipate, assess, respond to and mitigate the impact of political risk. Top of the list is being brutally honest about the risks you face, a tough task for most big organizations. Beyond that, planning is central, given the near-inevitability of political risk. Rice and Zegart cite the example of Anglo-Dutch petroleum giant Shell, which had anticipated the possibility of sharply higher oil prices in the run-up to the 1970s Middle East oil embargo and was able to adjust more rapidly than its global rivals.

“While the probability that a single political risk will affect Company A’s business in a particular city tomorrow may be low, the overall probability that some political risk will significantly affect Company A’s business in any one of its key locations over some period of time is surprisingly high,” Rice and Zegart warn.

One reason is that much political risk doesn’t emanate from actions targeting companies but from actions that sideswipe them. The Trump administration’s pursuit of a border wall with Mexico or a trade showdown with China is driven by political factors, but if you’re doing business in either market, the impact on your business can be large.

This is a book aimed at business practitioners. Throughout, there are handy, end-of-chapter bullet-point summaries of the takeaways. Its chapters are narrowly focused and written for quick reading.

The book also is rich with compelling case studies. Happily for readers, but perhaps less so for many of the companies mentioned, there is no shortage of them. Rice and Zegart draw lessons from obvious disasters such as BP’s Deepwater Horizon Gulf of Mexico oil spill, and from surprising examples such as Danish toymaker Lego — a company that ranks among the world’s “best at managing political risk” — which showed alacrity in changing manufacturing processes after criticism from the environmental group Greenpeace. One of the most impressive companies, according to Rice and Zegart, is Marriott, which had to cope with terrorist bombings in Jakarta, Indonesia.

The authors do not delve deeply into the market benefits of political risk in an open capitalist system. They describe the risk largely from the viewpoint of business operators or owners. That leads them to underappreciate the public-scrutiny benefit, in some cases, from the political risk of social media and political campaigns. Watch “Blackfish,” the documentary that exposed the way SeaWorld mismanaged the killer whale stars of its live shows, or read United CEO Oscar Munoz’s ham-fisted initial response after United forcibly removed a passenger from one of its overbooked planes, and you’ll conclude that any damage to these businesses was self-inflicted. It wasn’t so much that the companies didn’t have political-risk plans in place, it was that they didn’t understand their obligations in the first place.

Rice and Zegart devote too few words to a section called “Risks From Within,” noting that “organizations can hurt themselves by paying too little attention to their own corporate cultures and practices.” They cite as examples the firestorms of criticism Fox News and Uber faced over their treatment of female employees. Those internal issues can rapidly become external crises, and those cultural and business-practice issues are likeliest to trigger social media and political backlash.

In the end, however, the biggest challenge for any company trying to manage political risk is anticipating what may occur and heading it off. It’s hard to get buy-in for that, Rice and Zegart write: “Nobody gets credit for fixing problems that never happened.” True. But this book lays out a useful framework for having the right mind-set, practices and teams in place for when things go badly wrong.

Political Risk

How Businesses and Organizations Can Anticipate Global Insecurity

By Condoleezza Rice and Amy Zegart

Twelve. 321 pp. $30