Gold prices firmed on Wednesday as investors stayed cautious amid lingering uncertainty over the U.S.-China trade truce and waited for key inflation data for clues into the Federal Reserve's interest rate trajectory.

Spot gold gained 0.4% to $3,336.20 an ounce as of 0946 GMT. U.S. gold futures rose 0.4% to $3,347.

U.S. and Chinese officials said on Tuesday they had agreed on a framework to put their trade truce back on track and remove China's export restrictions on rare earths, but offered little sign of a durable resolution to longstanding trade differences.

In April, the U.S. and China imposed tit-for-tat tariffs on each other, triggering a trade war. After negotiations in Geneva last month, both countries agreed to scale back tariffs from triple-digit levels.

"Markets are well aware that the path towards a trade deal between major economies is not a straightforward affair," said Han Tan, chief market analyst at Exinity Group.

"Gold should remain supported as long as global trade tensions risk escalating further, or even just staying elevated for longer."

The U.S. consumer price index (CPI) report, due at 1230 GMT, could give investors more guidance on the Fed's policy path.

"Markets are expecting an uptick in the CPI prints, which should keep the odds for Fed rate cuts in check," Tan added.

The central bank will keep rates steady for at least another couple of months, according to most economists polled by Reuters, as risks of inflation rebounding due to President Donald Trump's tariff policies loom.

Elsewhere, spot silver fell 0.8% to $36.27 per ounce after hitting a more than 13-year high earlier this week.

"We expect silver to reach $38/oz in the coming months. Market deficit considerations and a weaker USD hold the key for even higher prices - a test of $40/oz is possible," UBS said.

Platinum rose 3.1% to $1,259.63, its highest since May 2021. Palladium added 1.7% to $1,077.89.

(Reporting by Anushree Mukherjee in Bengaluru; Editing by Sumana Nandy and Joe Bavier)