AI trading bots are legal in the United States. You can build one, buy one, or run one on your own brokerage account without asking permission. What you cannot do is use the bot to break any rule that would apply if you were placing the same orders by hand. Federal securities and commodities laws make no exception for automated systems, brokerages impose their own contractual limits, and the tax code treats a bot’s trades the same as yours. The real question is not whether bots are allowed but whether the way you plan to use one keeps you on the right side of four separate rulebooks.
Trading Conduct That Is Illegal Whether a Human or a Bot Does It
Automated execution does not create new crimes. It makes old ones easier to commit at scale, which is exactly why regulators watch algorithmic activity closely. Three patterns bring most bot operators into trouble.
Spoofing
Spoofing means placing bids or offers you intend to cancel before they execute, to trick other traders into reacting to demand or supply that is not real. The Commodity Exchange Act explicitly bans “bidding or offering with the intent to cancel the bid or offer before execution.”1Office of the Law Revision Counsel. 7 USC 6c – Prohibited Transactions It is a federal felony carrying up to $1 million in fines and 10 years in prison per violation.2Office of the Law Revision Counsel. 7 USC 13 – Violations Generally, Punishment, Costs of Prosecution Bots are effective spoofing tools because they can place and cancel thousands of orders per second. The CFTC runs a dedicated whistleblower program for reporting it.3Commodity Futures Trading Commission. CFTC Whistleblower Alert – Spoofing in Commodities and Derivatives Markets
Wash Trading
Wash trading means buying and selling the same instrument to create the illusion of market activity without any real change in ownership. The Commodity Exchange Act bans transactions “of the character of, or commonly known to the trade as, a ‘wash sale.'”1Office of the Law Revision Counsel. 7 USC 6c – Prohibited Transactions The Securities Exchange Act separately prohibits trades that involve no change in beneficial ownership and are intended to create a false appearance of active trading.4Office of the Law Revision Counsel. 15 USC 78i – Manipulation of Security Prices A bot running across multiple accounts or exchanges can create wash trades inadvertently by buying on one venue and selling on another in the same asset within a tight window. Intent matters, but regulators look at the pattern first and ask questions later.
Front-Running
Front-running means trading ahead of a known pending order to profit from the price move that order will cause. It typically involves a broker or adviser exploiting non-public information about a client’s upcoming trade. It falls under the Securities Exchange Act’s broad prohibition on any “manipulative or deceptive device” in connection with buying or selling securities.5Office of the Law Revision Counsel. 15 USC 78j – Manipulative and Deceptive Devices A bot that ingests order flow data and trades ahead of customer orders creates exactly the kind of liability that draws SEC enforcement.
What the Penalties Look Like
Beyond the CEA’s spoofing-specific penalties, federal securities and commodities fraud carries up to 25 years in prison under the general fraud statute.6Office of the Law Revision Counsel. 18 USC 1348 – Securities and Commodities Fraud Regulators can also force disgorgement of profits and impose civil monetary penalties. The fact that an algorithm executed the trades does not shift liability away from the person who designed, deployed, or controlled it.
When Selling or Sharing a Bot Triggers Registration
Running a bot for your own portfolio does not require any special registration. The calculus changes the moment you offer that bot to other people for a fee. The Investment Advisers Act of 1940 defines an “investment adviser” as anyone who, for compensation, engages in the business of advising others about securities.7Office of the Law Revision Counsel. 15 USC 80b-2 – Definitions A bot that picks securities, times entries and exits, or allocates across a portfolio is doing exactly that.
All three elements have to be present: you receive some form of compensation, you do it as a regular business activity, and the advice concerns securities. A bot that only trades commodity futures may fall outside the Advisers Act, though CFTC registration categories can still apply.
Where you register depends on assets under management. Advisers between $25 million and $100 million generally register with their home state’s securities regulator. Those managing $100 million or more register with the SEC.8Office of the Law Revision Counsel. 15 USC 80b-3a – State and Federal Responsibilities Below $25 million, you are prohibited from SEC registration and must register at the state level unless an exemption applies.9eCFR. 17 CFR 275.203A-1 – Eligibility for SEC Registration
Registration brings real obligations. You file Form ADV disclosing your business, fees, disciplinary history, and conflicts of interest. You owe a fiduciary duty to clients, meaning their interests come before yours in every decision the bot makes. You keep books and records, and you should expect to disclose that investment decisions are made by an algorithm rather than a human. Some operators assume the rules don’t apply because they are selling a “software product,” but the SEC has been clear that the nature of the advice, not the delivery method, determines whether you are an adviser.
Your Brokerage or Exchange Has Its Own Rules
Federal law sets the floor. Your platform sets the ceiling. Terms of service and API agreements almost always add restrictions on top of the statutes, and violating them can end your account even when nothing you did was illegal.
Common contractual restrictions include prohibitions on sharing API credentials, reverse-engineering the platform’s software, using market data for purposes not authorized in the agreement, and exceeding order rate limits. Some platforms restrict certain order types or require pre-approval for algorithmic strategies. Consequences for violations tend to be immediate: account suspension, permanent bans, and forced liquidation of any positions open at the time.
There is a regulatory reason your bot may hit blocks that seem overly cautious. SEC Rule 15c3-5 requires broker-dealers providing market access to maintain pre-trade credit and capital thresholds, block erroneous orders based on price and size parameters, restrict access to pre-approved persons and accounts, and conduct post-trade surveillance for potential manipulation.10eCFR. 17 CFR 240.15c3-5 – Risk Management Controls for Brokers or Dealers With Market Access The brokerage is protecting itself from regulatory liability that your orders could create.
Crypto Bots Sit in a Live Enforcement Zone
Crypto bot operators face the same anti-fraud and anti-manipulation rules as everyone else, but the framework around them is still moving. The SEC treats cryptocurrencies that qualify as securities under existing law the same as any other security. The CFTC has asserted jurisdiction over crypto derivatives, futures, and certain spot transactions, and the two agencies have issued joint statements on how their authorities apply.11Commodity Futures Trading Commission. CFTC Joins SEC to Clarify the Application of Federal Securities Laws to Crypto Assets12Commodity Futures Trading Commission. CFTC and SEC Staff Issue Joint Statement on Trading of Certain Spot Crypto Asset Products
Enforcement is active. In 2025 the SEC charged operators of three purported crypto trading platforms and four investment clubs that lured investors with fake “AI-generated investment tips.” No actual trading took place.13U.S. Securities and Exchange Commission. SEC Charges Three Purported Crypto Asset Trading Platforms and Four Investment Clubs in Scheme Targeted Labeling a product “AI” does not create a regulatory shield.
Congress is working toward a clearer division of authority. The Digital Asset Market Clarity Act of 2025 passed the House in July 2025 and would give the CFTC exclusive jurisdiction over “digital commodities” traded on registered entities, while the SEC would retain authority over digital assets that are securities.14Congress.gov. H.R.3633 – 119th Congress (2025-2026) – Digital Asset Market Clarity Act of 2025 Until comprehensive legislation is signed, assume either agency may assert jurisdiction depending on the asset.
Crypto businesses also face anti-money laundering obligations under the Bank Secrecy Act, which requires financial institutions to maintain programs designed to combat money laundering and terrorism financing.15Office of the Law Revision Counsel. 31 USC 5311 – Declaration of Purpose If a platform requires identity verification, that requirement traces back to these federal obligations.
The Tax Trap That Can Cost More Than Your Profits
Legal risk with a trading bot is not only regulatory. High-frequency automated strategies create tax problems that catch many operators off guard, sometimes producing a tax bill larger than actual profits.
Wash Sales Compound Fast Under a Bot
If you sell a stock or security at a loss and buy a substantially identical one within 30 days before or after the sale, the IRS disallows the loss deduction.16Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities The disallowed loss is not gone forever. It gets added to the cost basis of the replacement purchase, deferring the deduction. For a bot that trades the same handful of symbols hundreds of times a day, losses can roll forward indefinitely through the year, and you can end up owing taxes on your winners while your losers stay locked in cost basis adjustments you cannot use.
The math can turn ugly. Suppose your bot nets $5,000 in profit across all trades for the year, but $40,000 in gains on winning symbols are fully taxable while $35,000 in losses on losing symbols are disallowed because the bot kept re-entering those positions inside the 30-day window. You owe tax on $40,000, not $5,000. One workaround is stopping the bot from trading losing symbols for at least 31 days before year-end so the accumulated losses can be recognized, though that carries its own risk if the bot resumes those symbols shortly after January 1.
The Mark-to-Market Election
Active traders who qualify as running a trading business for tax purposes can make a Section 475(f) election to use mark-to-market accounting. This treats all positions as if they were sold at fair market value on the last business day of the year, converting all gains and losses to ordinary income and loss. The wash sale rule no longer applies, and losses are fully deductible without the $3,000 annual capital loss limitation.17Internal Revenue Service. Topic No. 429, Traders in Securities
Qualifying is not automatic. The IRS looks at how frequently you trade, how long you hold positions, whether you are trying to profit from daily price movements rather than long-term appreciation, and whether trading is a substantial, continuous activity. The election must be made by the due date of the tax return for the year before it takes effect, so you cannot wait until April to retroactively fix a bad wash sale situation.17Internal Revenue Service. Topic No. 429, Traders in Securities If your bot executes dozens of trades daily, look at this election before your first full tax year of bot trading. The difference between owing taxes on phantom gains and owing taxes on your actual net profit can run into tens of thousands of dollars.
Reporting Every Trade
Every trade the bot makes has to be reported on Form 8949, categorized by holding period and matched with cost basis information. A bot that executes thousands of trades per year generates a real recordkeeping burden. Starting with the 2025 tax year, the IRS introduced separate reporting boxes for digital asset transactions on Form 8949, distinguishing short-term and long-term crypto trades from traditional securities.18Internal Revenue Service. Instructions for Form 8949 Crypto bot operators need recordkeeping that captures those classifications accurately from the first trade.