Many investors see bonds as some of the safest investments they can make. But although bonds issued by the U.S. Treasury may have virtually no default risk, even Treasuries with built-in protection against inflation can lose value. Some believe that a decline for Treasury Inflation-Protected Securities, also known as TIPS, is inevitable.

Making a killing in TIPS
The last two years have been quite lucrative for investors in TIPS, at least by bond-market standards. Although TIPS haven't seen gains anywhere near as high as those of the stock market, they've put up some enviable performance that puts many other types of bonds to shame in this low-rate environment. The iShares Barclays TIPS Bond ETF (NYSE: TIP), which invests solely in TIPS, has gained an average of nearly 7% annually over the past two years. That can't keep up with returns on high-yield junk corporate bonds, but among Treasuries and other high-quality bonds, it's hard to beat what TIPS have done.

Moreover, inflation-protected bonds have become a worldwide hit. The SPDR DB International Government Inflation-Protected Bond ETF (NYSE: WIP), which has a portfolio of TIPS-like bonds from countries around the world, has put up even better numbers, returning 15% annually in the past two years.

What goes up must come down
The concern that some analysts have is that despite the big run-up in TIPS, inflation hasn't really reared its ugly head just yet. At the commodity level, higher prices for raw materials like copper, oil, and grains have raised fears of possible future inflation. But at least for now, those higher prices haven't made their way into the Consumer Price Index, which is up just 1.5% in the past 12 months.

That may sound like good news. But because of the way that TIPS are structured, investors count on their inflation expectations coming true as part of the total income they take from their investment. TIPS investors accept very low interest rates -- in some cases, even negative ones -- in exchange for a bond that rises in value over time in line with reported CPI figures. Right now, rates on 10-year TIPS are barely over 1% -- not much of a margin above inflation, especially if it doesn't turn out to be as high as some expected.

In addition, the spreads between TIPS and regular Treasuries can tell you something about inflation expectations. They've risen sharply in recent months, by nearly a full percentage point since August. Unless the CPI catches up, the disparity between inflation expectations and actual inflation could prove problematic for TIPS. Because their yields are extremely low, either higher overall rates or specific changes to inflation expectations could create a lot of volatility in the TIPS market -- and TIPS could easily give back some of their gains, the same way that regular Treasuries have seen declines recently.

How to protect yourself
The key lesson for investors is that using TIPS as your sole defense against inflation isn't the best strategy. Instead, look at some of the sectors that will benefit the most from potential rising prices. For instance, higher copper prices should boost profits for copper producers Freeport-McMoRan Copper & Gold (NYSE: FCX) and Southern Copper (NYSE: SCCO). Similarly, rising energy costs fall straight to the bottom line for oil and gas stocks, whether it's ExxonMobil (NYSE: XOM) at the top of the food chain or the patchwork of tiny exploration and production companies that trade publicly.

In addition, commodity funds and ETFs are available to give you direct exposure to rising commodity prices. The PowerShares DB Commodity Index ETF (NYSE: DBC), for instance, gives investors exposure to a wide range of commodities, including gold, natural gas, and sugar. More narrowly defined ETFs, such as the SPDR Gold Trust (NYSE: GLD), let you drill down on particular commodities if you believe higher prices won't be scattershot across the economy.

In an uncertain investing world, Treasury bonds and TIPS are an appealing beacon of safety. But investors need to understand that they too can drop when markets turn. If you're counting on TIPS to protect you no matter what happens, you're setting yourself up for a potential rude awakening.

Energy is a great way to play inflation. The energy sector has a massive economic tailwind pushing it upward, and The Motley Fool has identified the The Only Energy Stock You'll Ever Need.

It's been a while since Fool contributor Dan Caplinger has visited Heartbreak Hotel. He owns shares of iShares Barclays TIPS Bond ETF. The Fool owns shares of ExxonMobil. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Fool's disclosure policy has a big heart and a great personality.