# Wash-Sale & Tax-Aware Execution Auditor

> Audits trading bots and execution pipelines for IRS Section 1091 wash-sale violations and cost-basis errors, and installs a deterministic pre-trade tax gate. Ships a reference engine that passes 7/7 edge-case vectors.

Wash-Sale & Tax-Aware Execution Auditor is a paid AI agent skill on Agensi by Sam3gp8. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $14.99 (one-time purchase)
- Creator: [Sam3gp8](https://www.agensi.io/creators/sam3gp8)
- Version: 1.0.0
- Last updated: 2026-12-05
- Security: scan passed (2026-11-27); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/wash-sale-tax-aware-execution-auditor
- Tags: finance-accounting, trading-investing

## What it does

- Audits trading bots for IRS §1091 wash-sale violations and cost-basis errors
- Installs a deterministic SQLite pre-trade tax gate before orders hit your broker
- Catches 61-day window bugs, lookback blindness, and permanent IRA loss traps
- Verifies wash-sale mechanics offline against 7 bundled IRC §1091 test vectors

## Who it's for

- **Algorithmic & retail bot builders:** A persistent SQLite pre-trade gate that blocks wash-sale orders before they reach your broker API. Try: "Audit my Alpaca rebalancing bot for wash-sale risk and add a pre-trade tax gate."
- **Multi-account & IRA traders:** Cross-account detection that catches permanent loss destruction when a taxable loss is replaced in an IRA. Try: "Scan my execution pipeline for cross-account IRA replacement paths and lookback-window blind spots."
- **Quant & tax-lot engineers:** Exact 61-calendar-day windows, §1091(d) basis carryover, §1223 holding-period tacking, and 7/7 verified test vectors. Try: "Wire wash_sale_engine.py and sqlite-tax-ledger.sql into my order router and run run_test_vectors.py."

## About this skill

**Wash-Sale & Tax-Aware Execution Auditor** turns your agent into a strict financial-systems auditor for U.S. tax-lot compliance (IRC §1091, §1091(d), §1223). It inspects trading codebases, finds tax-blind execution paths, and engineers a deterministic pre-trade gate before orders reach a brokerage API.

**Catches the five failure modes that create phantom tax bills:**
- Missing pre-trade tax gate (buys that never check a realized-loss ledger).
- Calendar-vs-trading-day bugs (bar counts / hardcoded 20–21 day windows instead of exact 61 calendar days).
- FIFO-only lot selection with no Specific Identification.
- Lookback blindness (blocking post-sale rebuys but ignoring the 30 days *before*).
- In-memory loss state that is wiped on restart.

**Enforces the statutory mechanics correctly:** the 61-day calendar window (day 31 is the first safe rebuy), loss-only scope, partial-share proportional disallowance, §1091(d) basis carryover, §1223 holding-period tacking, and the cross-account **IRA trap** (a loss replaced inside an IRA/Roth is *permanently* destroyed, not deferred).

**Ships verifiable, not aspirational:**
- `wash_sale_engine.py` — a dependency-free reference implementation of the §1091 mechanics.
- `run_test_vectors.py` — runs it against every bundled edge-case vector; it ships green (**7/7 passed**).
- A production SQLite lot-level ledger schema (both the backward and forward 30-day window edges) and deterministic test vectors covering boundary, straddle, lookback, partial-match, and IRA cases.

Enforces technical §1091 engineering mechanics; it is **not** legal, tax, or CPA advice.

## Requires

- Python 3.9+
- SQLite 3.35+

## Known limitations

Audits code and computes the §1091 engineering mechanics; it does not file taxes, connect to your broker, or replace a CPA. It enforces technical wash-sale mechanics and does NOT constitute legal, tax, accounting, or financial advice — verify all tax positions with a qualified professional. Spot crypto is treated as property (configurable via a feature flag), pending legislation.

## Technical details

Built for Claude Code, Cursor, ChatGPT, and MCP-compatible coding agents targeting Python 3.9+ and SQLite 3.35+.

Bundled assets:
• references/wash_sale_engine.py — Dependency-free Python reference implementation enforcing IRC §1091, §1091(d) basis carryover, §1223 holding-period tacking, partial-share disallowance, and cross-account IRA checks.
• references/sqlite-tax-ledger.sql — Production SQLite lot-level ledger schema covering both backward and forward 30-day window edges (persists across bot restarts).
• references/wash-sale-test-vectors.json — Deterministic edge-case suite covering boundary days (day 30 vs. day 31), straddles, lookback windows, partial matches, and IRA traps.
• scripts/run_test_vectors.py — Offline CLI test runner that validates the engine against all 7 bundled vectors.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Wash-Sale & Tax-Aware Execution Auditor skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What does Wash-Sale & Tax-Aware Execution Auditor do?

Audits trading bots and execution pipelines for IRS Section 1091 wash-sale violations and cost-basis errors, and installs a deterministic pre-trade tax gate. Ships a reference engine that passes 7/7 edge-case vectors.

### Which AI agents support Wash-Sale & Tax-Aware Execution Auditor?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use Wash-Sale & Tax-Aware Execution Auditor?

Connect your AI agent to Agensi through MCP, then ask it to use Wash-Sale & Tax-Aware Execution Auditor on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
