Trade-war tensions have been ratcheted up in recent days, and investors are scrambling for safe-haven assets in a broad risk-off market move.

A key relationship between the yields of Treasurys is doing something not seen since 2007, before the depths of the latest financial crisis.

The relationship is nearing a level that has historically flashed ahead of economic recessions.

If you want evidence of how President Donald Trump's trade war is affecting investor nerves, look no further than the widespread damage inflicted upon US stocks in recent days.

Beyond that, if you're looking for a hint as to what the future holds, an even more ominous signal is forming in the Treasury market.

The metric in question is the spread between two- and 10-year Treasury yields, which has fallen to its lowest level since 2007 — the period immediately preceding the most recent financial crisis.

While short-term interest rates are almost always lower than their long-term counterparts, the difference between the two tends to tighten when investors are paying more for near-term protection. That flight to safety would seem to match the spike in investor nervousness seen as trade-war fears have escalated.

This dynamic is reflected in the chart above, which shows the so-called yield curve is not only flattening but nearing negative territory. If the two-year were to start yielding more than the 10-year — a rare occurrence known as inversion — it would signal that a recession is near, according to historical precedent.

This cautious behavior from investors would seem to match the recent adjustments made to forecasts across Wall Street.

Late last week, Morgan Stanley said 10-year Treasury yields peaked for the year when they hit 3.12% in mid-May, going as far as to recommend that investors buy 10-year notes at 2.9%. This conflicts with the widespread expectation that yields will climb well above the key 3% level by the end of 2018. Note that bullish trades on Treasurys are actually wagers that their yields will fall.

And while Morgan Stanley still stands mostly alone in its view, JPMorgan followed suit somewhat, recently trimming its year-end forecast for 10-year Treasury yields to 3.2% from 3.3%. The actions of both firms reflect the degree to which risk-off sentiment is dictating investor behavior.

Recession warnings ringing loud

The possibility of an inverted yield curve may be the recession indicator of the moment for investors, but strategists across Wall Street have long been sounding the alarm on an impending economic meltdown.

Last week, Joseph Song, the senior US economist at Bank of America Merrill Lynch, calculated the negative effect a full-on trade war would have on US gross domestic product. He found that the annualized growth rate of real GDP would decline by 0.3 to 0.4 percentage points relative to the baseline in the first year and then shave an additional 0.5 to 0.6 percentage points off in the second year.

Elsewhere, experts have been crying foul on what they say is an exorbitant amount of leverage being built up in the market by the likes of private-equity firms. In their mind, cash-rich professional investors are being afflicted by a need build out their portfolios, even if those opportunities may not be as appealing under normal circumstances.

That matches recent comments made by John Normand, JPMorgan's head of cross-asset fundamental strategy. He recently argued the record levels of debt in the US were a clear late-cycle indicator, meaning a reckoning was on the horizon.

Of course, another hallmark of a late-cycle environment is the stubborn insistence by some market participants that robust returns will last forever. That's why popular positions are able to get extended to the point that they're vulnerable to a painful downturn.

It's all part of a massive puzzle investors and experts are trying to piece together. At this point, only one thing is for sure: The cries for a recession are getting louder, and risk-off behavior is getting more pronounced.

What happens next is anyone's guess.