The Section 864(b) trading safe harbor for foreign investors is a provision of the Internal Revenue Code that lets a nonresident individual or foreign corporation trade U.S. stocks, securities, and qualifying commodities without being treated as engaged in a U.S. trade or business. Qualifying matters because a foreign person classified as engaged in a U.S. trade or business owes federal income tax on all profits connected to that business at graduated rates reaching 37 percent for individuals and 21 percent for corporations.1Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026 The safe harbor removes that risk for portfolio trading, no matter how frequent or aggressive.
What the Safe Harbor Prevents
A foreign investor who is not engaged in a U.S. trade or business generally owes no federal tax on capital gains from selling U.S. stocks and securities. Section 871(a) still imposes a flat 30 percent tax on certain U.S.-source income like dividends and interest, but capital gains are left alone for nonresident aliens who spend fewer than 183 days in the country during the tax year.2Office of the Law Revision Counsel. 26 USC 871 – Tax on Nonresident Alien Individuals
Without the safe harbor, a foreign fund running hundreds of daily trades through a U.S. broker could be characterized as doing business in the country, which would collapse the capital gains exemption and expose all connected profits to graduated rates. Section 864(b) draws a bright line: meet its requirements and you are not engaged in a U.S. trade or business, regardless of trading volume or intensity.3Office of the Law Revision Counsel. 26 USC 864 – Definitions and Special Rules Two separate pathways get you there.
Trading Through an Independent Agent
The first pathway covers foreign investors who route orders through a U.S. broker, custodian, or similar agent. Under Section 864(b)(2)(A)(i) for stocks and securities and Section 864(b)(2)(B)(i) for commodities, those transactions fall outside the definition of a U.S. trade or business as long as the agent is genuinely independent.3Office of the Law Revision Counsel. 26 USC 864 – Definitions and Special Rules Independence means the broker operates in the ordinary course of its own business, serves multiple clients, and is not acting as the investor’s exclusive representative.
This pathway carries one significant restriction. The foreign investor cannot have an office or fixed place of business in the United States through which the trades are directed. A U.S. office calling the shots defeats the protection even when a domestic broker physically executes the orders. The premise of this clause is that you are relying on a domestic professional to handle market activity while directing it from abroad.
Trading for Your Own Account
The second pathway is broader and is the one most large foreign funds rely on. Under Section 864(b)(2)(A)(ii) for stocks and securities and Section 864(b)(2)(B)(ii) for commodities, a foreign person who trades for their own account is not engaged in a U.S. trade or business. The provision applies even when the investor’s own employees or discretionary agents located in the United States make the trading decisions.3Office of the Law Revision Counsel. 26 USC 864 – Definitions and Special Rules
Unlike the independent-agent route, this clause has no restriction on maintaining a U.S. office. A foreign hedge fund can hire portfolio managers in New York, give them full discretion to buy and sell, and still qualify. The only condition is that the fund is trading for its own investment portfolio and not acting as a dealer.
Before 1997, foreign corporations faced a much tighter version. The statute denied the safe harbor to any corporation whose principal business was trading stocks or securities if its principal office was in the United States. The Taxpayer Relief Act of 1997 repealed that principal-office requirement effective for tax years beginning after December 31, 1997.4GovInfo. Taxpayer Relief Act of 1997 – Public Law 105-34 A foreign corporation can now station its entire investment team domestically without losing safe harbor treatment. The dealer line is what still matters.
Extra Rules for Commodities
Both pathways cover commodities, but commodities face a two-part test under Section 864(b)(2)(B)(iii). The commodity must be of a kind customarily traded on an organized commodity exchange, and the transaction itself must be of a kind customarily consummated at such an exchange.3Office of the Law Revision Counsel. 26 USC 864 – Definitions and Special Rules
Standardized futures and exchange-traded options on agricultural products, metals, and energy satisfy both prongs. Physical commodities can also qualify if they are of the type traded on exchanges and the transaction follows exchange-style practices. A private contract for a non-standard commodity that has never been standardized for exchange trading falls outside the safe harbor, and the IRS would evaluate it under general facts-and-circumstances principles.
Digital assets sit in a gray zone. Cryptocurrencies that trade on CFTC-regulated exchanges, such as Bitcoin and Ethereum futures, have a stronger argument for meeting the commodities test. Tokens traded only on unregulated platforms, or that might be classified as securities rather than commodities, are murkier. The statute predates digital assets, and the IRS has not issued definitive guidance on how they fit within Section 864(b).
The Dealer Exclusion
Both pathways contain the same carve-out: the safe harbor does not apply to a dealer in stocks, securities, or commodities. Treasury Regulations define a dealer as a merchant with an established place of business who regularly buys securities and sells them to customers for a profit. People who buy and sell for investment or speculation, however active, are not dealers merely because of that activity.5eCFR. 26 CFR 1.864-2 – Trade or Business Within the United States
The distinction turns on customers. A trader profits from price movements in their own portfolio. A dealer profits from the spread between what they pay for a security and what they charge a buyer. Market-making, running a brokerage desk, and underwriting securities for distribution are dealer activities. Managing your own capital, with no one buying securities from you at a markup, is trading.
Being reclassified as a dealer is expensive. Trading income becomes effectively connected income, taxed at graduated rates up to 37 percent for individuals or 21 percent for corporations.6Office of the Law Revision Counsel. 26 USC 11 – Tax Imposed Foreign corporations also face a 30 percent branch profits tax on the dividend equivalent amount, layered on top of the regular corporate tax.7Office of the Law Revision Counsel. 26 USC 884 – Branch Profits Tax What would have been tax-free capital gains becomes fully taxable ordinary income.
Investing Through Partnerships
Many foreign investors access U.S. markets through fund structures organized as partnerships. A partnership that qualifies under Section 864(b) for its own trading activity passes that protection through to its foreign partners. But any activity beyond protected trading can turn a foreign partner’s share into effectively connected income, even if the partner had no involvement in the non-trading operations.
Selling a partnership interest triggers a separate rule. Under Section 864(c)(8), when a foreign person sells an interest in a partnership engaged in a U.S. trade or business, the gain is treated as effectively connected income to the extent the partnership’s underlying assets would have generated effectively connected gain if sold at fair market value.3Office of the Law Revision Counsel. 26 USC 864 – Definitions and Special Rules The buyer must withhold 10 percent of the amount realized.8Office of the Law Revision Counsel. 26 USC 1446 – Withholding of Tax on Foreign Partners Share of Effectively Connected Income
For ongoing operations, partnerships with foreign partners face mandatory withholding under Section 1446. The partnership withholds tax on each foreign partner’s share of effectively connected taxable income at the highest individual rate for non-corporate partners or the 21 percent corporate rate for corporate partners.8Office of the Law Revision Counsel. 26 USC 1446 – Withholding of Tax on Foreign Partners Share of Effectively Connected Income Trading that qualifies entirely under the safe harbor produces no effectively connected income, so there is nothing to withhold on. Any slippage outside the safe harbor’s scope activates the obligation.
Filing a Protective Return
This is where planning matters most. If the IRS later determines that your trading activity did constitute a U.S. trade or business, you need to have filed a return to claim deductions against that income. A foreign corporation that fails to file loses the right to deduct expenses against effectively connected income entirely.9Office of the Law Revision Counsel. 26 USC 882 – Tax on Income of Foreign Corporations You would owe tax on gross income, with no offset for trading costs, management fees, or other expenses.
The solution is a protective return. A foreign corporation files Form 1120-F with the “Protective return” box checked at the top of page 1. The return includes identifying information but reports no effectively connected income, because the filer’s position is that the safe harbor applies. If the IRS never challenges that position, the return sits quietly in the system. If the IRS reclassifies the activity, the return preserves the corporation’s right to take deductions and credits.10Internal Revenue Service. Instructions for Form 1120-F
Timing is strict. To preserve deductions, Form 1120-F must generally be filed no later than 18 months after the due date of the return for that tax year. Missing that window can permanently forfeit the right to deductions, though the IRS may grant a waiver in limited circumstances where the corporation acted reasonably and in good faith.10Internal Revenue Service. Instructions for Form 1120-F A corporation also claiming treaty exemption because it has no permanent establishment should attach Form 8833.
Nonresident alien individuals face the parallel issue. If you rely on the safe harbor and file nothing, then the IRS later disagrees, you would need to file Form 1040-NR and demonstrate that deductions should still be allowed.11Internal Revenue Service. About Form 1040-NR, U.S. Nonresident Alien Income Tax Return A protective 1040-NR follows the same logic: report no effectively connected income, but preserve the ability to claim deductions if the safe harbor position is rejected.
What the Safe Harbor Does Not Cover
Qualifying under Section 864(b) does not mean no U.S. tax. The safe harbor only prevents trading from being classified as a U.S. trade or business. It does nothing about the flat 30 percent withholding tax that applies to certain categories of U.S.-source income regardless of business status.
Under Section 871(a) for individuals and Section 881 for corporations, the United States imposes a 30 percent tax on U.S.-source dividends, interest, rents, and other fixed or determinable periodic income received by foreign persons.2Office of the Law Revision Counsel. 26 USC 871 – Tax on Nonresident Alien Individuals Dividends on U.S. stocks in a brokerage account face withholding at 30 percent, or a lower treaty rate, even when your trading gains are entirely exempt. Interest on most portfolio debt has its own statutory exception, but dividends, rental income, and royalties do not.
Capital gains carry a further wrinkle. A nonresident alien present in the United States for 183 days or more during the tax year owes a flat 30 percent tax on net capital gains from U.S. sources, even without being engaged in a trade or business.2Office of the Law Revision Counsel. 26 USC 871 – Tax on Nonresident Alien Individuals The safe harbor does not override the 183-day rule. Foreign investors who spend meaningful time in the country need to track their days, because the capital gains exemption depends on physical presence, not just Section 864(b) qualification.
Treaty benefits can reduce or eliminate some of these taxes, but they require proper documentation and, in many cases, claiming the treaty position on a return or withholding form. The safe harbor and treaty relief are separate tools that work alongside each other.