“Annuity” is considered a dirty word by many investors because of the trickiness and complexity of many of these insurance contracts. So annuity providers introduce versions that seem more attractive and understandable. Among the most popular now is the fixed-index annuity (FIA). The pitch: You enjoy a portion of the stock market’s gains if stocks rise, and for safety, you won’t lose any of your original investment even if the stock market plunges.

That’s an intriguing offer at a time when many investors fear the nine-year-old bull market may end before long. Fixed-index annuity sales hit $58 billion in 2017, up 70% since 2012. Problem: The hidden costs and restrictions of these annuities mean that they often fall short of their big promises.

How FIAs work: You pay a lump sum to the insurance firm that provides the annuity. Your annual return is determined by a formula linked to a stock index such as the S&P 500. For example, you might earn 60% of the index’s annual gain. And if the index’s return is negative, your return for the year will be 0%, so your principal will remain safe.

The reality isn’t nearly as good as the sales pitch for FIAs, which earn agents among the highest commissions in the annuity industry and tend to be mediocre investments. For starters, the formula used to calculate returns ignores stock dividends—it looks only at stock price gains. That can hurt. For the period from 1930 to 2017, dividend income contributed more than 40% of total S&P 500 returns, on average. In addition, FIAs typically cap annual returns in a range of 3% to 6%. So in 2017, when the S&P 500 returned 22%, your annuity account might have been credited with a 6% gain or less. Many FIAs lock up most of your money for 10 years, allowing you to withdraw no more than 10% of your account annually without penalty.

Finally, all withdrawals are taxed at your ordinary income tax rate, which may be higher than the capital gains rate you would pay on profits from investing in stocks directly.

In the past, the long-term returns of FIAs have been in the 3.5%-to-5% range. They may appeal to some investors who cannot stomach any annual stock losses. But you could get better results with only incrementally more risk with a portfolio of bank CDs (recently paying as high as a 3.39% annual yield for a seven-year term) and a small ­exposure to an S&P 500 exchange-traded fund (ETF).