  No robust detection of prompt electromagnetic counterparts to fast radio
bursts (FRBs) has yet been obtained, in spite of several multi-wavelength
searches carried out so far. Specifically, X/gamma-ray counterparts are
predicted by some models. We planned on searching for prompt gamma-ray
counterparts in the Insight-Hard X-ray Modulation Telescope (Insight-HXMT)
data, taking advantage of the unique combination of large effective area in the
keV-MeV energy range and of sub-ms time resolution. We selected 39 FRBs that
were promptly visible from the High-Energy (HE) instrument aboard Insight-HXMT.
After calculating the expected arrival times at the location of the spacecraft,
we searched for a significant excess in both individual and cumulative time
profiles over a wide range of time resolutions, from several seconds down to
sub-ms scales. Using the dispersion measures in excess of the Galactic terms,
we estimated the upper limits on the redshifts. No convincing signal was found
and for each FRB we constrained the gamma-ray isotropic-equivalent luminosity
and the released energy as a function of emission timescale. For the nearest
FRB source, the periodic repeater FRB180916.J0158+65, we find
$L_{\gamma,iso}<5.5\times 10^{47}$ erg/s over 1 s, whereas
$L_{\gamma,iso}<10^{49}-10^{51}$ erg/s for the bulk of FRBs. The same values
scale up by a factor of ~100 for a ms-long emission. Even on a timescale
comparable with that of the radio pulse itself no keV-MeV emission is observed.
A systematic association with either long or short GRBs is ruled out with high
confidence, except for subluminous events, as is the case for core-collapse of
massive stars (long) or binary neutron star mergers (short) viewed off axis.
Only giant flares from extra-galactic magnetars at least ten times more
energetic than Galactic siblings are ruled out for the nearest FRB.
