Midsize business optimism is riding high -- but maybe not for long. 

Roughly nine in 10 middle-market company leaders are optimistic about their business's prospects over the next six months, according to JPMorgan Chase's July Business Leaders Outlook Pulse survey. (Middle market is defined as companies with annual revenues between $20 million and $500 million.) At 88 percent, sentiment is up from 56 percent a year ago and represents the bank's highest tally in 11 years of conducting the survey.

The enthusiasm is driving growth plans: Just under half of those surveyed said they plan to increase capital expenditures, up from 18 percent a year ago. And well over a third anticipate higher credit needs for the rest of 2021.

Of course, there are headwinds. The recent surge in Covid-19 cases prompted by the Delta variant offer to dampen the mood, and ongoing supply-chain issues and a tight labor market threaten to throttle growth for the foreseeable future. 

What's more, recent ransomware attacks are fueling anxieties. About a third of those polled report being directly affected by cyberattack or fraud since March 2020. Among the companies withstanding attacks, 79 percent said employee education and training has been the most helpful mitigation tactic. Another 56 percent said prophylactic countermeasures, including using new tools and services, have helped. 

Many business leaders also report that economic uncertainty remains one of their most intractable problems. That makes sense, given the recent surge in Covid-19 cases, which is driving employers to rethink their return to work plans and giving officials reason to reinstall safety mandates like indoor masking.

However, should recent economic optimism hold, the main focus should turn to navigating the growing pains to keep up the thrust of the economic recovery, Jim Glassman, head economist at JPMorgan Chase Commercial Banking, said in a statement. "After enduring the challenges of the last year and a half, businesses are feeling overwhelmingly positive about what's ahead," which, he adds, "is comparatively a good problem to have."