Architecture Note · Finance & Legal
Deterministic Cross-Border EOR Costing, Misclassification Risk, and Dual-Signed Payroll
Why prompt-based HR calculators misstate statutory employer burdens and worker classification exposure—and how country rule tables, weighted statutory risk tests, and dual HR + CFO locks protect global disbursements.
The Problem: Statutory Surprise, Misclassification Audits, and FX Drift
Hiring full-time Employer of Record (EOR) staff and cross-border contractors across the UK, Germany, France, Canada, Australia, Singapore, Japan, and the US exposes finance and people teams to wide statutory variance. Employer social charges range from roughly 15.0% Class 1 NIC in the UK to 20.8% in Germany and 36.5% URSSAF charges in France, before pensions and leave accruals. Meanwhile, treating full-time, centrally directed workers as independent contractors triggers retroactive tax and penalty exposure—such as up to four years of back social contributions under Germany’s § 7 SGB IV or UK IR35 rules—while spot FX swings can underfund multi-currency treasury wires.
Why Naive AI Payroll Wrappers Fail
Wrapping a general-purpose LLM around international hiring spreadsheets introduces unacceptable legal and financial failure modes:
- Nondeterministic tax and burden math: Language models approximate statutory percentages, conflate employee withholdings with employer social charges, or invent 13th-month and probation rules across jurisdictions.
- Unanchored classification opinions: Asking a model whether a contractor is compliant yields inconsistent prose rather than reproducible scoring tied to local enforcement statutes (IR35,
Scheinselbstständigkeit, URSSAFlien de subordination, CRA Wiebe Door, Fair Works.15AA). - Silent PII and contract leakage: Uploading raw contractor SOWs, tax IDs, and salary rosters to external APIs risks cross-border data-residency violations without retention limits.
- Single-click disbursement risk: Without an enforced separation of duties, an automated pipeline can export unverified gross-to-net bank files or unhedged FX totals without Finance and HR sign-off.
The Deterministic Architecture That Fixes It
A production EOR and contractor payroll engine keeps all statutory math, risk weights, and disbursement locks strictly deterministic in FastAPI and SQLite WAL, reserving optional AI adapters for localized clause summaries.
- Country-parameterized burden engine:
POST /api/eor/cost-estimatevalidates inputs with strict Pydantic v2 rules (rejectingNaN,Infinity, non-positive salaries, and unsupported markets) and applies explicit jurisdiction tables across all8markets for employer social security, pension/superannuation/CPF (such as3.0%workplace auto-enrolment in the UK or6.2%AGIRC-ARRCO and Mutuelle in France), statutory leave accruals, and estimated employee net take-home pay. - Seven-factor statutory misclassification screener:
POST /api/contractors/classifyscores exclusivity, fixed hours, company equipment, operational control, core integration, lack of substitution right, and indefinite tenure from0to100using country-specific statutory weights. Scores of55or higher automatically trigger mandatory Legal Counsel review—modeling retroactive penalty rates such as28%in the UK,41%in Germany, or48%under France’stravail dissimulérules—while temporary evidence uploads atPOST /api/contractors/uploaduse0600permissions and auto-wipe after3600s, retaining only SHA-256 digests. - Atomic dual HR + CFO disbursement lock: Multi-currency runs model explicit FX lock buffers (
0.00%to+5.00%) and cycle-over-cycle headcount, gross pay, and tax variance (GET /api/payroll/variance) across London, Frankfurt, Paris, Toronto, Sydney, Singapore, Tokyo, and New York.POST /api/payroll/runs/{id}/approveenforces distinct HR Lead and Finance/CFO sign-offs inside SQLiteBEGIN IMMEDIATEtransactions, returningHTTP 409until dual approval is sealed and recorded in an immutable hash-chained audit log before unlocking RFC 4180 formula-safe CSV or JSON disbursement exports. - Localized clause generation with offline fallback: Offer-letter probation caps (such as
6months in Germany under BGB§ 622(3)or4months renewable for Cadres in France), statutory notice periods, severance formulas, and IP enforceability matrices run offline by default viaOfflineDeterministicAdapterwith explicit operational-support disclaimers.
Operational Takeaway
Global expansion cannot rely on probabilistic tax math or unverified contractor paperwork. Encoding statutory rates, country-weighted classification tests, ephemeral evidence wiping, and dual HR + CFO transaction locks gives finance and legal teams repeatable control before funds leave treasury.