AT THE start of Donald Trump’s presidency bosses rushed onto his business councils, hoping to influence policies in their favour. Their ardour has cooled. When Mr Trump banned travel from Muslim-majority countries, withdrew from the Paris agreement on climate change and equivocated on racist protesters in Charlottesville, to name but a few occasions, chief executives roared their protest.

“Un-American,” declared Reed Hastings, Netflix’s chief executive, of the immigration ban. Sergey Brin, a co-founder of Google, told a reporter, “I am here because I am a refugee” as he joined protesters against the ban at San Francisco’s airport. “I feel a responsibility to take a stand against intolerance and extremism,” wrote Kenneth Frazier, boss of Merck, a pharma giant, after Charlottesville. “Isolate those who try to separate us,” added Lloyd Blankfein of Goldman Sachs. Other executives have joined lawsuits to overturn Mr Trump’s policies and condemned his actions in memos to staff.

Firms have been sucked into social and political debates before. Anti-apartheid campaigners mounted boycotts against firms that did business with the South African regime, for example. But it is happening more and more often. In 2015 came the news that Indiana was considering a “religious freedom” bill that would allow companies and non-profit organisations to discriminate against gay and transgender individuals. Tim Cook, chief executive of Apple, a technology firm, criticised the law even though Apple itself has little presence in the state. Salesforce.com, another tech firm, applied sterner pressure, threatening to withdraw jobs. State bills discriminating against transgender and gay people have attracted strong opposition from firms headquartered across America, not just in left-leaning California—from Bank of America (North Carolina) to Dow Chemical (Michigan) and ExxonMobil (Texas).

Come halo or high water

The Trump era has made it even harder for executives to stay above the political fray. More than 1,400 companies and investors have signed a pledge to uphold the Paris climate agreement, in defiance of Mr Trump. Visa, a credit-card giant, and 3M, a manufacturing firm, are among those to have cut advertising from Breitbart News, a right-wing news site founded by Stephen Bannon, Mr Trump’s former adviser. One serial investor and director of a tech giant says that fired-up employees have made it extremely difficult to be seen to co-operate with the administration in any way at all.

That is a big shift. In the past companies did their best to remain apolitical. The commercial rationale for caution was best expressed by Michael Jordan, a basketball star, when he quipped that “Republicans buy sneakers too”. Companies believed that their main purpose was to maximise returns for shareholders, not to meddle in politics. “The social responsibility of business is to increase its profits,” wrote Milton Friedman, an economist, in 1970. Lobbyists became increasingly adept at pushing policymakers towards lower taxes and fewer regulations; they said little or nothing about social issues.

No longer. The reactions to Mr Trump are reinforcing a longer-term trend for business to become more outspoken. Multinational companies in particular are more likely to combine their support for globalisation with the espousal of wider societal goals such as protecting the environment, ethnic diversity and gay rights. A small but rising number of firms have committed to a new corporate purpose altogether, declaring their objectives to be broader than mere profits. The past decade has seen the launch of “benefit corporations” which work to meet specific goals for society as well as for their investors; there are more than 2,300 of these around the world, with the greatest number in America.

Such trends are not confined to America. Companies in Europe have long had an expansive view of their social responsibilities; now worries about inequality and the resulting populism are strengthening that stance. Unilever, a giant Anglo-Dutch seller of consumer goods, for example, prides itself on treating staff well and supporting environmental sustainability. But the phenomenon is particularly marked in America, due to the number of giant firms headquartered there and because Mr Trump is so uniquely hard to ignore.

The controversies of Mr Trump’s presidency aside, there are two big structural reasons for firms’ newfound sense of purpose. First, many bosses feel they have little choice but to respond to their staff, who are increasingly vocal on political and on cultural issues. Second, companies’ main shareholders—institutions such as pension funds and asset managers—are themselves paying more attention to social objectives.

Start with the staff. According to a report from Weber Shandwick, a public-relations firm, “CEO Activism in 2017: High Noon in the C-Suite”, 44% of millennial American employees say they would be more loyal to their company if their boss took a public position on a societal issue, compared with 19% who would be less loyal. Weber Shandwick found that, globally, 63% of executives of prominent firms feel the need to have a position on issues such as immigration and climate change.

The real office politics

That position usually, but not always, breaks to the left. Large companies still tend to line up with the Republican party on policies that have a direct impact on their business—a specific regulation, for instance, or a tax provision. But many of America’s biggest companies have their headquarters (and most of their senior staff) in states and in metropolitan areas that voted for Hillary Clinton. Employees of large firms examined by The Economist usually gave more to Democratic candidates than to Republican ones (see chart for selected examples).

So it should come as little surprise that companies increasingly support causes that are traditionally associated with Democrats, including gay rights and environmental sustainability. More than 80% of the firms that opposed Mr Trump’s ban on travel from Muslim countries are based in states that voted for Mrs Clinton, as are the majority of the firms and investors that signed the pledge to uphold the Paris climate agreement. Staying neutral is especially hard for firms in Silicon Valley, where staff are often liberal.

“Heartland” companies, far from the liberal coasts, also face pressure to react to specific political events or to advance a wider agenda. On November 21st Doug McMillon, the boss of Walmart, a ubiquitous retailer, described the expanding expectations from various quarters for his company, such as advancing education. In 2015 Walmart moved to oppose a “religious freedom” bill like that in Indiana in its home state of Arkansas, stopped selling products carrying the Confederate flag after a mass shooting at Charleston and also stopped selling assault-style rifles.

Some firms are wholeheartedly conservative in their views. Charles Koch of Koch Industries, the second-largest private firm in America, for example, has spent hundreds of millions backing right-wing causes. And smaller conservative-leaning businesses have not held back from fighting cultural battles. In 2014 the Supreme Court ruled that “closely-held businesses” such as Hobby Lobby, a chain of crafts stores, could have religious beliefs and thus be exempt from laws that flouted them. As a Christian firm, it had objected to having to pay for insurance coverage for emergency contraception under the Affordable Care Act. Another case now before the Supreme Court—that of a baker who refused to make a wedding cake for a gay couple—might end up exempting businesses from anti-discrimination laws if they violate owners’ spiritual beliefs.

Institutional investors add to the pressure on firms to get involved in political and social issues. In 2006 the United Nations issued principles for responsible investing, urging shareholders to consider environmental, social and governance factors. By 2015, institutions managing about $59trn had endorsed these principles. As pension-fund trustees and mutual-fund investors take social objectives more seriously, asset managers such as BlackRock and Vanguard have tried to woo them by launching new funds and indices focused on well-behaving firms. The assets managed under such criteria jumped to $22.9trn last year, from $13.3trn in 2012.

What does this all mean for companies? One danger lies in doing too little. Hollow posturing about corporate social responsibility is easy enough to expose. Employees and shareholders can hold companies to account using data or by consulting independent monitors such as the Human Rights Campaign, which scrutinises how firms treat gay and transgender employees, or the World Wildlife Fund, which tracks firms’ environmental work.

A second danger lies in alienating people on the other side of an issue, the president among them. Companies that have opposed Mr Trump risk being singled out by him. In August a single tweet from Mr Trump complaining about Amazon’s impact on conventional retailers (and jobs) wiped out $6bn of its market value.

Firms may also displease customers, who can more easily complain about companies and organise boycotts using social media. In 2015 Starbucks, a coffee chain, urged staff to begin conversations about race with customers; the attempt was widely ridiculed. More recently Keurig Green Mountain, a coffee-machine maker, withdrew advertising from a show on Fox News after its host failed to condemn Roy Moore, a Senate candidate accused of dating and assaulting teenagers. Mr Moore’s supporters then posted online videos of themselves smashing their devices.

Rage against the Keurig machine

These risks are not always as extreme as they might seem, however. Despite the occasional misstep Starbucks has thrived; its chairman, Howard Schultz, champions the idea that firms should serve both their shareholders and a broader set of interests, including staff and civil society. Angering Mr Trump, ostensibly the world’s most powerful man, may not have lasting effects, either. Amazon’s stock has more than recovered since his tweet in the summer. When Mr Trump criticised Nordstrom, a department store, its share price rose.

It seems unlikely that companies’ new activism will fade. Ignoring the issues that helped propel Mr Trump into office in the first place is becoming a less plausible option for many bosses. After the global financial crisis it was bankers who attracted most populist ire. Chief executives are still more trusted than politicians, according to a recent survey by Edelman, a public-relations firm—but that trust is eroding quickly.

Big multinationals such as Apple are under increasing pressure to eschew complex manoeuvres that reduce their tax bills. Sky-high executive pay is another focus of populist discontent. Firms are also having to grapple, often unconvincingly, with the question of how to help workers threatened by the spread of technology. Mark Zuckerberg, chief executive of Facebook, is among those to have suggested the idea of a “universal basic income”—an unconditional payment to all citizens—to deal with stagnating wages and automation; critics say that could further disenfranchise the less-skilled.

As companies make their voices heard on social issues, they may start to do so in different ways. Corporate bosses have long given to candidates—Cornelius Vanderbilt, a 19th-century tycoon, for example, showered Ulysses Grant with cash. Firms themselves can now take a more active part in politics, thanks to the Supreme Court’s decision in Citizens United v Federal Election Commission that businesses can spend unlimited amounts in elections (as long as they do not donate directly to a candidate).

They could also change how they lobby. Apple, Google and Amazon, some of the most politically vocal companies of the past year, have each more than quadrupled their annual lobbying spending since 2007. But most of the cash has gone on narrow business issues such as net neutrality, intellectual property and privacy. Aaron Chatterji of Duke University thinks there will be rising pressure, from staff and consumers, for firms in many industries to match their rhetoric with lobbying on specific societal issues in Washington, DC.

Mr Zuckerberg has taken a more direct approach. He has just concluded a tour of 30 states to try and connect with Americans of all backgrounds. Alexis de Tocqueville, in his own journey through America in the 19th century, observed what he called the country’s “self-interest, properly understood”—the idea that an individual’s attention to the common good served himself as well. Companies keen to protect their interests are increasingly taking that observation to heart.