How to keep a tax-loss-harvesting agent from voiding a loss in an IRA

A split illustration of two brokerage account panels, one labeled taxable and one labeled IRA, connected by a dotted line showing an automated trade crossing between them while a tax-rule gate flags the move.

Automated harvesting agents optimize the one account they can see, but the wash-sale rule is computed across every account a household holds. When the offsetting buy lands in an IRA, the disallowed loss is not deferred, it is gone for good. Here is how to wire the agent so that never happens.

TLDR

An automated tax-loss-harvesting agent optimizes the one account it is plugged into, but the wash-sale rule is computed across every account a household controls. When the offsetting purchase of a substantially identical fund lands inside a tax-sheltered retirement account (an IRA or a 401(k)), the disallowed loss is not deferred into future basis, it is forfeited permanently under Section 1091(d) of the tax code. The decision that matters is not which agent to use, it is which accounts the agent can see.

This month Interactive Brokers wired Claude directly into client accounts. The agent drafts a trade, the client approves it in an AI Instructions tab, and it goes to market. Robinhood and a handful of others opened similar bring-your-own-agent rails the same week. The feature that follows close behind, on every one of these platforms, is automated tax-loss harvesting: let the agent sell the losers, book the loss against gains, and hold the same market exposure through a near-identical fund. It is a genuinely useful chore to hand off. The question worth asking before we hand it off is narrow and expensive: does the agent see all of our accounts, or only the one it is wired into?


How fast an automated harvesting agent acts

The rails are real and they are fast. As FinTech Global reported this month:

"Interactive Brokers, an automated global brokerage operating across more than 170 markets worldwide... clients can generate trading instructions for equities and ETFs using market and limit orders, with further asset classes expected to be added within a week."

FinTech Global, June 2026

That speed is the point and also the hazard. A harvesting agent is built to act the moment a position goes red, and it acts inside whichever account holds the API connection. Meanwhile the rule it has to respect spans a wider perimeter than its own login. 24/7 Wall St walked through a clean version last month: a retiree sold roughly $300,000 of a total-market fund at a $90,000 loss, and two weeks later a scheduled dividend reinvestment inside her IRA quietly bought about $9,000 of the same fund. That single automatic purchase disallowed $9,000 of the loss, 10% of the harvest, costing her $2,430 in real tax at a 27% combined rate. No agent was even involved. A dividend setting did it.

The wash-sale rule spans every account, not one login

Here is the part most harvesting pitches skip. The wash-sale rule disallows a loss if a substantially identical security is bought within 30 days before or 30 days after the sale, a 61-day window, and the Internal Revenue Service computes that across every account one taxpayer controls: taxable, IRA, 401(k), and a spouse’s accounts too. An agent watching one account is structurally blind to a buy in an account it never connected to.

The sting is what happens next, and it splits two ways.

Same wash sale, two very different outcomes
Where the replacement buy landsWhat happens to the disallowed loss
Another taxable accountDeferred. Added to the new lot's cost basis, recovered later.
A retirement account (IRA or 401(k))Forfeited. No basis add-back under Section 1091(d). Gone.

In a taxable-to-taxable collision the loss only goes to sleep: it rides along as extra basis on the replacement shares and comes back when those shares are sold. But the IRS settled in Revenue Ruling 2008-5 that when the offsetting buy happens inside a retirement account, Section 1091(d) refuses to raise the IRA’s basis, because a tax-sheltered account has no basis to raise. The loss is not deferred. It is destroyed.

Key Insight

The comfort of "my tool checks for wash sales" is only as wide as the accounts the tool is wired into. The most expensive version of the mistake is silent and permanent, because it happens in the retirement account the agent was never connected to.

What to do before letting an agent harvest

  1. Inventory the whole household first

    List every account under one tax return: taxable, every IRA, the 401(k), and a spouse's accounts. The wash-sale perimeter is the list, not the login.

  2. Kill automatic reinvestment in any account you harvest in

    Turn off dividend reinvestment on funds being harvested, in every account. A scheduled reinvestment is an automated buy the agent cannot see.

  3. Confirm the agent's actual scope

    Read what the connection can see. A single-account agent does not know your IRA exists, so it cannot warn you about a collision there.

  4. Keep a 31-day no-buy list

    When a loss is harvested, the same fund and any substantially identical fund are off-limits across all accounts for 31 days, including auto-rebalancing.

  5. Never let the replacement land in a retirement account

    If a near-identical fund must be repurchased, route it to a taxable account, where a collision only defers the loss instead of voiding it.

  6. Reconcile in January, before filing

    Cross-check realized losses against every account's January activity. The disallowed slice shows up on the broker's sales-reporting form only for the account that sold, never the one that bought.

The agent is good at the part it can see and oblivious to the part it cannot. That is not a reason to avoid it. It is a reason to draw the perimeter ourselves before we let it start selling.

This is editorial analysis, not investment advice. Cerevisor does not hold or recommend the named positions, and information here can become stale within hours of publication.

Sources

  1. Interactive Brokers launches agentic trading via Claude - FinTech Global, 2026-06-02
  2. The Tax-Loss Harvest That Cost a 66-Year-Old Retiree $2,400 in Wash-Sale Penalties She Never Saw Coming - 24/7 Wall St., 2026-05-18
  3. Part I Section 1091. Loss from Wash Sales of Stock or Securities (Revenue Ruling 2008-5) - Internal Revenue Service, 2008-01-14
  4. Direct Indexing: Tax-Loss Harvesting Across Accounts - Mezzi, 2026-02-02

Back to all insights