Potential perils are in plain sight: An intense and unpredictable tariff battle is alarming businesses across the country. The annual federal deficit is heading toward $1 trillion. Credit card debt is soaring. And the synchronous wave that lifted every world economy at the year’s start has dissipated.

So what?

Such risks have done little to puncture the exuberant optimism that is encouraging American businesses to ramp up hiring and consider new investment.

The confidence is rooted only partly in hard-nosed data, like the rapid pace of growth expected for the second quarter and record low jobless rates. It is also a sign of harder-to-measure sentiment. “Animal spirits are high,” said Tim Ryan, United States chairman of the global accounting and consulting firm PwC, referring to the gut feelings and impulses that can drive economies to elation or despair.

Business leaders who complained that they sometimes felt vilified as engineers of inequality — or greedy exploiters — now say they are pleased to be viewed as part of the solution, creating jobs and wealth. “They feel good about themselves, like they are the good guys,” Mr. Ryan said, describing comments from hundreds of chief executives to his firm over the past quarter. “They are sitting up a little straighter in the chair.”