Skip to main content
“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

ScenarioLLM HallucinationQWED 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 500k=500k = 31,000”BLOCKED (Limit is 176k/ 176k / ~ 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:
CategoryGuardsJurisdiction
PayrollPayrollGuard, WithholdingGuard, ReciprocityGuardUS
Worker classificationClassificationGuard (IRS Common Law + ABC Test)US
Sales taxNexusGuardUS
1099 filingForm1099GuardUS
Crypto/VDACryptoTaxGuardIndia
TradingInvestmentGuard, SpeculationGuard, CapitalGainsGuardIndia
GST/APGSTGuard, InputCreditGuard, TDSGuardIndia
CorporateRelatedPartyGuard, ValuationGuardIndia
BankingDepositRateGuardIndia
Set-off matrixInterHeadAdjustmentGuardIndia
Cross-borderRemittanceGuard, DTAAGuard, TransferPricingGuard, PoEMGuardInternational
AddressAddressGuardUS

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 \rightarrow Is this transaction legal? (e.g., RelatedPartyGuard blocks illegal loans before rate checks).
  • Step 2: Limit Check \rightarrow Is it within quota? (e.g., RemittanceGuard checks LRS limit before TCS).
  • Step 3: Calculation \rightarrow 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 (US or INDIA) 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.
This means QWED-Tax does not just check rules — it formally proves that the AI’s tax logic is consistent.

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 with Decimal precision to prevent floating-point errors in financial calculations.

Installation

pip install qwed-tax