Inside the Salary Engine That Powers Every MITS Offer Letter

Aug 18, 2026 | Blog

Reading Time: 4 minutes

Ask any HR professional what keeps them up at night and it's rarely the big dramatic stuff. It's the small stuff. It's a Basic Salary figure that's off by ₹2,000 a month on a candidate's very first paycheck, discovered not by HR but by the candidate, three weeks into a new job, when the number on their payslip doesn't match the number on their offer letter.

That's not a bug. That's a trust problem. And trust, once a new hire starts questioning it in week three, doesn't come back easily.

BasicTiered ladder, not a formula. Rs 24,000 a month up to Rs 5L CTC, stepping to 40% of monthly CTC above Rs 71LHRA5% of Basic at or below Rs 5L CTC, 50% of Basic above it. A deliberate cliff, not a curvePF, employer and employee12% of the Rs 15,000 statutory ceiling. Rs 1,800 each, toggleable per personGratuity and MediclaimGratuity at 4.81% of Basic. Both optional, never assumedProfessional TaxFlat Rs 200 a month, no toggle. A compliance obligation, not a perkExecutive AllowanceCalculated last, absorbing the remainder so the total lands exactly on the promised CTC
Every rupee comes from deterministic C#. GPT-4o never sees this table.

So when MITS built the salary calculation logic inside its AI Letter Writer, the brief wasn't "make it smart." It was "make it exactly, unambiguously, boringly correct, every single time." Here's how that actually looks in code, and why every design choice in it exists for a reason.

A Ladder, Not a Formula

Indian payroll structuring doesn't reduce cleanly to one equation, because Basic Salary isn't a straight percentage of CTC — it's a tiered ladder that HR and compliance have refined over years of real-world edge cases. MITS's SalaryService.CalculateSalaryBreakdown() encodes that ladder directly:

An annual CTC up to ₹5,00,000 sets Basic at ₹24,000 a month. Cross into the ₹5L–6L band and it steps to ₹26,000. Then ₹28,000 up to ₹7L, ₹30,000 up to ₹8L, ₹35,000 up to ₹9L, ₹40,000 up to ₹10L. From there the steps widen — ₹45,000 up to ₹12L, ₹50,000 up to ₹15L, ₹55,000 up to ₹18L, ₹60,000 up to ₹20L, climbing in ₹5,000 increments up through ₹75,000 at the ₹26L mark, ₹80,000 at ₹30L, and then a long plateau at ₹1,00,000 all the way out to ₹71L. Above that, the model changes entirely — Basic becomes 40% of monthly CTC, because at that income level, the fixed-ladder approach stops making structural sense.

Why a ladder and not a clean formula? Because that's how Indian compensation structuring actually works in practice — informed by statutory minimums, market convention, and internal policy, not a tidy mathematical curve. Trying to force it into one formula would mean either overpaying Basic at some CTC bands or underpaying it at others. The ladder is the honest representation of a genuinely irregular real-world rule.

Why HRA Has a Cliff Edge

House Rent Allowance isn't a flat percentage either — it's 5% of Basic for anyone at or below the ₹5,00,000 CTC line, and jumps to 50% of Basic above it. That's a deliberate cliff, not a smooth curve, and it exists because HRA structuring conventions in Indian payroll genuinely work that way for lower income bands versus higher ones. Getting that boundary condition right — is ₹5,00,000 exactly inclusive or exclusive — is exactly the kind of off-by-one detail that turns into a support ticket six months later if it's ever gotten wrong. It's why the boundary logic lives in one tested, single-purpose method instead of being copy-pasted across the codebase.

The Optional Components, Toggled, Not Assumed

Employer PF and Employee PF are each calculated as 12% of a ₹15,000 statutory ceiling — ₹1,800 a month apiece — but neither is forced onto every candidate. They're toggleable per person, because not every joining scenario includes them. Same story for Gratuity, calculated at 4.81% of Basic, and Mediclaim, a flat ₹650 a month. These are real components with real statutory or policy grounding, but whether they apply is a judgment call HR makes per candidate, not something the system should assume on their behalf.

Professional Tax is the one line item with no toggle at all — a flat ₹200 a month, always included, because it's a compliance obligation, not a negotiable perk.

The Last Line Is Where It All Balances

After Basic, HRA, PF, Gratuity, Mediclaim, and Professional Tax are all accounted for, whatever's left of the target CTC gets absorbed into a single line called Executive Allowance — calculated last, specifically so the sum of every component lands exactly on the number the candidate was promised. It's the salary structure's balancing entry, and it's calculated last on purpose: every other component is a rule-driven fact, and the allowance is simply "everything else," so it has to be computed after everything else is already known.

Why None of This Touches the AI

It's worth saying plainly: GPT-4o never sees this math. Every rupee in this breakdown comes from deterministic C# logic against a fixed table — the same table, the same boundaries, the same rounding, every single time, for candidate number one and candidate number seven hundred. Language models are remarkable at reading a messy offer note and pulling a CTC figure out of unstructured prose. They are the wrong tool entirely for computing what that CTC breaks down into, because "probably right" is not a standard payroll gets to operate under.

That's really the whole philosophy in one sentence: let the AI understand language, and let plain, testable, auditable code handle money. It's not a flashy idea. It's just the correct one, and it's the reason nobody at MITS has had to explain a payslip discrepancy to a confused new hire in their third week.

MITS AI Letter Writer · part 3 of 5Third in a five-part series. Next: what happens when a document doesn't say what you'd expect — the messy reality of teaching AI to read HR paperwork.