The stock market had a good week, with the S&P 500 (SNPINDEX:^GSPC) rising 0.7% on the heels of continued optimism about the U.S. economy and overall positive earnings results from many of the most influential companies in the market. Yet more surprising than the S&P's continued moves to new all-time record highs was the fact that bonds bounced convincingly after huge declines over the past couple of months. Unfortunately, anyone who gets into bonds now for anything but a short-term bounce is running the risk of much worse losses down the road.

The reasons behind the gains
After such a huge move down, bond prices were bound to react favorably at some point, and this tuned out to be the week when bonds made their move. Treasuries performed quite well, with the iShares Barclays 20+ Year Treasury ETF (NASDAQ:TLT) picking up 1.4% on the week. Shorter-term bonds posted less impressive gains, but several subsectors of the bond market also did well. In the high-yield corporate market, the SPDR Barclays High Yield Bond ETF (NYSEMKT:JNK) managed to match the Treasury ETF's move, while in the international arena, emerging-market bonds jumped even more strongly, as iShares JPMorgan USD Emerging Markets Bond (NYSEMKT: EMB) climbed 3.3% as investors got more comfortable with the prospects for economic growth in the developing world.

Yet behind all these gains, you'll still find the same fundamental arguments against bonds. With the Federal Reserve clearly signaling an exit from its bond purchases, the bond market will see more than $1 trillion per year in bond purchasing slowly disappear in the next year or two, and the removal of that demand should lead to higher interest rates. Even though the damage in the bond market has already been severe, 10-year rates at 2.5% are still well below their ordinary levels, and a rise back to the 3% to 5% range that prevailed throughout much of the bull market in stocks from 2003 to early 2008 would produce substantial capital losses.

Lastly but perhaps most significantly, the bankruptcy of the city of Detroit could put further pressure on the entire bond market. Although the immediate damage will be limited to a select group of municipal bonds, what happens in Detroit's bankruptcy proceedings could determine how much bondholders can rely on getting repaid in the event of municipal default. Anything to undermine creditors' rights could have dramatic implications on the muni market, as we've seen in the declines in the iShares S&P National AMT-Free Muni Bond ETF (NYSEMKT:MUB), and that could spill over into the rest of the bond market as well.

Beware the future of bonds
It's entirely possible that in the short run, we'll get a respite from the declines we've seen in the bond market recently. But longer-term, as long as the economy continues to improve, it's hard to see most bonds producing the returns that investors would want to see. Investors need to be cautious before taking this week's gains as a sign that the carnage in the bond market is over for good.