The IRS generally does not automatically know when you buy gold. Precious metals dealers are not required to report most purchases to the IRS. The main exception involves cash transactions: if you pay more than $10,000 in cash (or certain cash equivalents) for gold, the dealer must file Form 8300 with the IRS, reporting your identity and the transaction amount.
Selling gold is different. When you sell certain gold or silver bullion products back to a dealer, in specific forms and quantities defined by IRS rules, the dealer may be required to file Form 1099-B. This reporting applies to sales, not purchases.
Regardless of reporting requirements, you’re legally obligated to report any taxable gain when you eventually sell gold for a profit, since it’s treated as a collectible under U.S. tax law.