“Death, Taxes, and Deterministic Verification.”QWED-Tax is the deterministic verification layer for Agentic Finance. It protects AI Agents from making costly tax errors by proofing inputs against IRS (US) and CBDT (India) rules before any transaction is executed.
The problem
AI agents (LLMs) are handling payroll and tax, but they are largely illiterate in tax law. They hallucinate rates, misclassify workers, and ignore nexus thresholds.Real world failures
| Scenario | LLM Hallucination | QWED Verdict |
|---|---|---|
| Worker Hire | ”Hiring contractor (1099) who uses my laptop” | BLOCKED (Misclassification Risk) |
| Sales Tax | ”No tax in NY for $600k sales” | BLOCKED (Nexus Violation) |
| Payroll | ”FICA Tax on 31,000” | BLOCKED (Limit is 10k tax) |
| W-4 Exempt | ”Employee claims exempt with $5k liability” | BLOCKED (IRS Pub 505 Violation) |
| Transfer Pricing | ”Charge related party 50% below market” | BLOCKED (Arm’s Length Deviation) |
Guard coverage
QWED-Tax ships with 20+ deterministic guards across three jurisdictions:| Category | Guards | Jurisdiction |
|---|---|---|
| Payroll | PayrollGuard, WithholdingGuard, ReciprocityGuard | US |
| Worker classification | ClassificationGuard (IRS Common Law + ABC Test) | US |
| Sales tax | NexusGuard | US |
| 1099 filing | Form1099Guard | US |
| Crypto/VDA | CryptoTaxGuard | India |
| Trading | InvestmentGuard, SpeculationGuard, CapitalGainsGuard | India |
| GST/AP | GSTGuard, InputCreditGuard, TDSGuard | India |
| Corporate | RelatedPartyGuard, ValuationGuard | India |
| Banking | DepositRateGuard | India |
| Set-off matrix | InterHeadAdjustmentGuard | India |
| Cross-border | RemittanceGuard, DTAAGuard, TransferPricingGuard, PoEMGuard | International |
| Address | AddressGuard | US |
Accounts payable automation
qwed-tax secures the entire “Procure-to-Pay” cycle for AI Agents:
- Validation: Checks GSTIN/VAT ID formats via
InputCreditGuard.verify_gstin_format(). - Compliance: Blocks Input Tax Credit (ITC) on “Personal” categories (Food, Cars, Gifts).
- Withholding: Auto-calculates TDS/Retention amounts before commercial payment via
TDSGuard.
Procedural accuracy (MSLR aligned)
Unlike standard calculators,qwed-tax verifies the procedure, not just the result. This aligns with Multi-Step Legal Reasoning (MSLR) to prevent “Right Answer, Wrong Logic” errors.
- Step 1: Sanction Check Is this transaction legal? (e.g.,
RelatedPartyGuardblocks illegal loans before rate checks). - Step 2: Limit Check Is it within quota? (e.g.,
RemittanceGuardchecks LRS limit before TCS). - Step 3: Calculation Apply math.
Architecture
QWED-Tax acts as the Pre-Flight Middleware between your AI Agent and Fintech APIs (like Gusto, Stripe, or Avalara). The system supports two entry points:TaxPreFlight— Intent-based auditor that runs all applicable guards against an AI agent’s transaction intent.TaxVerifier— Jurisdiction-scoped verifier (USorINDIA) for direct guard access.
Z3 theorem prover integration
Several guards use the Z3 SMT solver for formal verification instead of heuristic rules:- WithholdingGuard — Proves W-4 exempt status validity against IRS Pub 505 rules.
- ReciprocityGuard — Proves correct state withholding under reciprocity agreements.
- ClassificationGuard (ABC Test) — Proves worker classification under CA AB5 / NJ / MA laws.
- InvestmentGuard — Proves correct tax head classification for stock market transactions.
Zero-data leakage
Unlike cloud API checks (Avalara/Vertex),qwed-tax runs 100% locally.
- Privacy first: Your payroll/trading data never leaves your server.
- No API latency: Checks are instant (microseconds).
- GDPR/DPDP compliant: Ideal for sensitive Fintech environments.
Data models
QWED-Tax uses strict Pydantic models withDecimal precision to prevent floating-point errors in financial calculations.