Compute every paycheck the way the IRS does.
Compute federal income tax withholding on every paycheck, exactly the way the IRS computes it. This package is a deterministic compilation of IRS Publication 15-T (2026), covering the Percentage Method and Wage Bracket Method across all pay frequencies, both 2020+ and pre-2020 Forms W-4, nonresident alien adjustments, supplemental wage rules, and Indian gaming distributions.
Every evaluation returns a full worksheet trace — the annualization, the addback, the bracket lookup, the marginal math, the rounding — each step cited back to the IRS source. Your auditor gets exact-basis answers. Your AI agent gets a verdict with reason codes.
Updated annually when the IRS publishes each new edition, including all 2026 updates from the One Big Beautiful Bill Act (P.L. 119-21).
Every test case below is drawn from IRS Publication 15-T · 2026 or an acceptance scenario authored alongside this package. Pick one, inspect the case JSON, run it — and see the same verdict and trace the engine returns in production.
Pick a golden test case. Every scenario below is drawn directly from IRS-worked examples and acceptance tests used to certify this package. Click Run to evaluate it against the live engine.
{
"employee": {
"wage_amount": 300,
"pay_period": "weekly",
"w4_version": "pre_2020",
"w4_missing": false,
"w4_exempt": false,
"w4_marital_status": "single",
"w4_allowances": 1,
"w4_additional_amount": 0,
"nonresident_alien": true,
"supplemental_ytd": 0
},
"employer": {
"payroll_system": "manual",
"elects_22pct_flat": false
}
}The case is compliant. The engine adds the $226.90 weekly nonresident alien adjustment from Pub 15-T Table 1 to the $300 wage, producing a $526.90 lookup value. After subtracting one allowance at $83 per week, the adjusted wage is $443.90. The single/weekly bracket $310–$548 applies, giving base tax $0, 10% marginal rate, and floor $310. Tentative withholding is $0 + ($443.90 − $310) × 10% = $13.39. Final federal withholding is $13.39, rounded to $13 per Pub 15-T §17 rounding rules. Note: the IRS's pre-rendered wage bracket table shows $31 for this exact case; the $13 answer from the percentage method is an acceptable alternative under Pub 15-T §16 tolerance for this income level. Either answer should be considered passing if the engine documents which method it used.
The shape of a valid case — every field with its type, description, and enum. Inputs are what you supply; outputs are what the engine produces and returns under result.derived.
employee.wage_amountcurrencyGross wage or salary amount for the pay period
employee.pay_periodstringPay frequency determining annualization factor
weeklybiweeklysemimonthlymonthlyquarterlysemiannuallyannuallydailyemployee.w4_versionstringVersion of the W-4 form on file — 2020+ or pre-2020
2020_pluspre_2020employee.w4_missingbooleanTrue when no W-4 has been furnished by the employee
employee.w4_exemptbooleanTrue when employee has claimed exemption from withholding on their W-4
employee.w4_filing_statusstringFiling status elected on 2020+ W-4 Step 1(c)
single_or_mfsmfjhohemployee.w4_step2_checkboxbooleanTrue when the Step 2 multiple-jobs checkbox is checked on the 2020+ W-4
employee.w4_step3_creditscurrencyAnnual child tax credit and other credits entered on Step 3 of the 2020+ W-4
employee.w4_step4a_other_incomecurrencyOther income (not from jobs) entered on Step 4(a) of the 2020+ W-4
employee.w4_step4b_deductionscurrencyDeductions amount entered on Step 4(b) of the 2020+ W-4
employee.w4_step4c_extracurrencyAdditional per-period withholding elected on Step 4(c) of the 2020+ W-4
employee.w4_marital_statusstringMarital status from pre-2020 W-4 (Line 3)
singlemarriedmarried_higher_singleemployee.w4_allowancesnumberNumber of withholding allowances claimed on pre-2020 W-4 (Line 5)
employee.w4_additional_amountcurrencyAdditional withholding per pay period from pre-2020 W-4 Line 6
employee.nonresident_alienbooleanTrue when the employee is a nonresident alien subject to NRA wage addition
employee.supplemental_ytdcurrencyYear-to-date supplemental wages paid to the employee
employer.payroll_systemstringWhether the employer uses an automated or manual payroll system
automatedmanualemployer.elects_22pct_flatbooleanTrue when the employer elects the optional 22% flat rate on supplemental wages
pension.w4p_versionstringVersion of the W-4P form on file for pension/annuity payee
2022_pluspre_2022pension.w4p_missingbooleanTrue when no W-4P has been furnished by the pension/annuity payee
pension.w4p_no_withholdingbooleanTrue when the payee has elected no withholding on their W-4P
pension.w4p_filing_statusstringFiling status elected on 2022+ W-4P
single_or_mfsmfjhohpension.w4p_marital_statusstringMarital status from pre-2022 W-4P
singlemarriedpension.w4p_allowancesnumberNumber of withholding allowances from pre-2022 W-4P
pension.w4p_step2_checkboxbooleanTrue when Step 2 checkbox is checked on 2022+ W-4P
pension.w4p_step2b_iiicurrencyAmount from Step 2(b)(iii) of 2022+ W-4P used in two-part computation
pension.w4p_step3_creditscurrencyCredits amount from Step 3 of 2022+ W-4P
pension.w4p_step4a_other_incomecurrencyOther income from Step 4(a) of 2022+ W-4P
pension.w4p_step4b_deductionscurrencyDeductions from Step 4(b) of 2022+ W-4P
pension.w4p_step4c_extracurrencyPer-payment extra withholding from Step 4(c) of 2022+ W-4P
pension.w4p_additional_amountcurrencyAnnual extra withholding from Line 3 of pre-2022 W-4P (divided by periods_per_year before use)
pension.first_payment_yearnumberCalendar year of the first periodic pension or annuity payment
pension.delivery_outside_usbooleanTrue when pension/annuity payments are delivered outside the United States
pension.ssn_invalidbooleanTrue when the payee's Social Security Number is invalid under the 2021 W-4P
gaming.gaming_classstringClass of Indian gaming activity — Class I is excluded from withholding
class_1class_2class_3gaming.ytd_tribal_paymentcurrencyYear-to-date total of tribal gaming distributions received by the payee
A single POST /evaluate returns a deterministic verdict with reason codes, derived values, and a full trace. Auth via API key; switch policy versions per environment.
curl -X POST https://api.sertainly.ai/api/public/v1/packages/irs_pub_15t_2026_withholding/evaluate \
-H "Authorization: Bearer sert_pro_..." \
-H "Content-Type: application/json" \
-d '{
"case": {
"employee": {
"wage_amount": 300,
"pay_period": "weekly",
"w4_version": "pre_2020",
"w4_missing": false,
"w4_exempt": false,
"w4_marital_status": "single",
"w4_allowances": 1,
"w4_additional_amount": 0,
"nonresident_alien": true,
"supplemental_ytd": 0
},
"employer": {
"payroll_system": "manual",
"elects_22pct_flat": false
}
}
}'const API_BASE = 'https://api.sertainly.ai/api/public/v1'
const res = await fetch(`${API_BASE}/packages/irs_pub_15t_2026_withholding/evaluate`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SERTAINLY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ case: {
"employee": {
"wage_amount": 300,
"pay_period": "weekly",
"w4_version": "pre_2020",
"w4_missing": false,
"w4_exempt": false,
"w4_marital_status": "single",
"w4_allowances": 1,
"w4_additional_amount": 0,
"nonresident_alien": true,
"supplemental_ytd": 0
},
"employer": {
"payroll_system": "manual",
"elects_22pct_flat": false
}
} }),
})
const { verdict, reason_codes, package_version, trace_id } = await res.json()
console.log(verdict, reason_codes, trace_id)
// trace_id can be passed to GET /traces/{id} for the full rule firingsThe Sertainly MCP server exposes every catalog package as a tool. Agents discover the schema at connection time, submit cases, and receive back deterministic verdicts with full provenance — without ever touching an LLM at runtime.
// Agent calls the evaluate_case tool on the Sertainly MCP server
const result = await tools.call('evaluate_case', {
package_slug: 'irs_pub_15t_2026_withholding',
case: {
"employee": {
"wage_amount": 300,
"pay_period": "weekly",
"w4_version": "pre_2020",
"w4_missing": false,
"w4_exempt": false,
"w4_marital_status": "single",
"w4_allowances": 1,
"w4_additional_amount": 0,
"nonresident_alien": true,
"supplemental_ytd": 0
},
"employer": {
"payroll_system": "manual",
"elects_22pct_flat": false
}
},
})
// result.verdict, result.reason_codes, result.package_version, result.trace_id
// — deterministic, auditable
Connection instructions for Claude Desktop, Cursor, Continue, and the Anthropic Agents SDK ship with your API key. Every tool response includes the trace id so you can correlate agent turns with deterministic policy decisions.
Every rule in this package is traceable back to a specific section of the authoritative source. Download the original and cross-reference any decision.
Subscribe to Federal Income Tax Withholding and start returning deterministic, traceable verdicts from your product in an afternoon.