Guardrail Philosophy
AltScore makes credit decisions that affect livelihoods. An incorrectly low score denies a retailer credit they deserve. An incorrectly high score sends a lender's capital into a loan that defaults. Guardrails exist to bound the harm in both directions — and to ensure the system remains trustworthy even as it scales.
A guardrail is not a fallback for when the model fails. It is a structural constraint that the model must operate within — always. If the model's output would violate a guardrail, the guardrail wins. Not sometimes. Every time.
GUARDRAIL DESIGN PRINCIPLE — ALTSCOREGuardrails are Infrastructure, Not Policy
Guardrail logic is enforced at the API and pipeline layers — not in a policy document. A developer cannot ship code that bypasses the affordability ceiling, for example, even accidentally. The ceiling is a hard code constraint with no configuration toggle.
Fail Safe, Not Fail Open
If a guardrail check fails to execute (due to system error), the scoring pipeline returns a conservative fallback — not an unguarded score. A missing anomaly detection result causes the request to be flagged for review, not silently passed through.
Transparent Guardrail Activation
When a guardrail modifies or blocks a score, this is surfaced to the lender in the API response — not hidden. The lender knows whether a limit was capped, a score was held for review, or an anomaly was flagged. No silent interventions.
The Six Guardrails — Overview
| # | Guardrail | What It Protects Against | Who It Protects | Implementation Layer | Failure Mode if Absent |
|---|---|---|---|---|---|
| GR-1 | Fairness & Bias | Systematic under-scoring of a demographic or geographic cohort | Retailers; AltScore regulatory standing | Post-scoring audit; training pipeline | Discriminatory credit access; DPDP + RBI enforcement risk |
| GR-2 | Score Gaming Prevention | Retailer behavioral manipulation to inflate score before scoring event | Lender (credit risk); AltScore model integrity | Pre-scoring anomaly detection; feature design | Over-lending to manipulated profiles → excess defaults |
| GR-3 | Explainability & Right to Reason | Opaque credit decisions with no actionable feedback | Retailer; lender (compliance); AltScore (RBI FLDG) | Score API response layer; SHAP pipeline | RBI non-compliance; retailer harm with no recourse; lender liability |
| GR-4 | Affordability & Limit Ceiling | Over-lending beyond a retailer's realistic repayment capacity | Retailer (debt trap); lender (credit loss) | Score API response layer; hard-coded limit logic | Retailer over-indebtedness; elevated default rates; lender loss |
| GR-5 | Data Quality & Provenance | Corrupt or low-quality ERP data generating unreliable scores | Lender; retailer; AltScore model performance | Ingestion pipeline; feature pipeline; score API | Scores driven by garbage data; systemic scoring errors; audit failure |
| GR-6 | Model Lifecycle Governance | Silent model degradation, drift, or unauthorized model changes | Lender (credit risk); AltScore (model integrity) | MLOps monitoring layer; model registry | Scores become increasingly unreliable; default rates creep above predictions undetected |
Guardrail Architecture
Guardrails are applied at three distinct points in the scoring pipeline. Each point has different characteristics — pre-scoring checks block computation before it starts; post-scoring checks evaluate the output before it is served; and continuous monitoring checks run asynchronously on accumulated data.
Guardrail Failure Response Matrix
| Guardrail Check | Check Fails to Execute | Check Triggers (Threshold Breached) | Override Possible? |
|---|---|---|---|
| Consent check | Score blocked — fail safe | Score blocked, 403 returned | No — hard block |
| Data completeness check | Score served with "low_confidence" flag | Score served with "low_confidence" flag; limit capped at conservative minimum | No — flag is always surfaced |
| Anomaly detection (Isolation Forest) | Score marked "review_required" — not blocked, flagged | Score returned with anomaly_flag=true; lender notified; review queue entry created | Lender can accept with acknowledgment; audit logged |
| SHAP reason codes | Score blocked — reason codes are mandatory (RBI FLDG) | N/A — either codes generate or score is blocked | No — regulatory requirement |
| Affordability ceiling (30% GMV) | Score blocked — ceiling cannot be skipped | Recommended limit capped; warning surfaced in response | No API override; lender manual override via dashboard + audit trail |
| Fairness audit (async) | Alert to ML team; audit rescheduled | Alert to Risk + ML; model freeze if divergence >15% | No — model freeze requires DPO + CTO sign-off to lift |
| PSI / model drift check (async) | Alert to ML Ops; drift check rescheduled | PSI > 0.2 → model refresh triggered; scoring continues with current model during refresh | No auto-override; manual override with Risk team sign-off only |
GR-1 · Fairness & Bias Guardrail
Credit models trained on historical data inherit the biases of past lending decisions. If NBFCs historically avoided lending to retailers in certain states or trade categories, the training data will show higher "defaults" for those cohorts — not because those retailers are riskier, but because they were never given credit to repay. This creates a self-fulfilling exclusion loop. The fairness guardrail exists to detect and break this loop.
Geography is explicitly excluded as a direct feature. But indirect geographic signals (seasonal patterns, SKU categories, distributor tenure norms) can still encode regional bias. The guardrail tests outcomes, not just inputs.
- Cohort definitions: State (28 states + 8 UTs), district tier (1/2/3/4), trade category (FMCG / auto parts / general trade / agri-input / pharma), gender proxy (name-based inference — used only for audit, never as a feature)
- Matched cohort construction: For each audit, retailers are binned by behavioral similarity (GMV range × payment delay band × tenure band). Score distributions compared within bins across cohort segments.
- Disparate impact test: Adverse Impact Ratio = (fraction of cohort A receiving Band A/B) ÷ (fraction of reference cohort receiving Band A/B). Threshold: AIR ≥ 0.80 required.
- Geography exclusion verification: Geography-related features (state, district) must not appear in top-20 SHAP features globally. If they do, feature removal and model retraining is mandatory.
- Audit frequency: Quarterly scheduled; also triggered if any cohort's score distribution shifts >10% vs. prior quarter.
GR-2 · Score Gaming Prevention
- Order velocity inflation: Retailer places unusually large orders in the 30–60 days before a scoring event to increase GMV and order frequency signals
- Return suppression: Retailer accepts delivery of ordered goods (not returning them as usual) to reduce return rate signal during look-back window
- Payment timing manipulation: Retailer pays invoices unusually early for 1–2 months before scoring to reduce payment delay signal
- Collusion with distributor: Distributor records fake invoices or early payments on behalf of retailer in exchange for kickback
- Isolation Forest (primary): Unsupervised anomaly detector trained on 12 months of historical behavior per retailer. Flags samples where order velocity, payment timing, or return rate deviates >3σ from the retailer's own baseline. Contamination parameter set at 5% (top 5% most anomalous are flagged).
- 60-day look-back window: Scoring event evaluates behavior over a rolling 60-day window. Manipulation must be sustained for 2 full months — not just 1–2 weeks — to influence the window meaningfully.
- Return rate counter-signal: Order inflation is often paired with low returns (retailer keeps goods they don't need). This unusual combination (high GMV + abnormally low return rate vs. baseline) is a gaming signature.
- Long-term history dominance: Payment delay signal weights 3-year history vs. recent 60-day behavior at approximately 70:30. Short-term manipulation cannot overcome multi-year payment patterns.
GR-3 · Explainability & Right to Reason
RBI FLDG guidelines require reason codes for credit decisions made using algorithmic scoring. The DPDP Act gives data principals the right to understand decisions made about them. And practically: a retailer told "your score is 580" with no explanation cannot do anything with that information. A retailer told "your score would improve if your payment delays reduced below 10 days" has an actionable goal.
Explainability serves three distinct audiences: the lender (credit decision audit), the retailer (understanding and appeal), and the regulator (compliance evidence). The reason code design must work for all three — without exposing the exact feature weights that would allow model gaming.
- SHAP values computed: TreeSHAP computed on every score inference. Produces a SHAP value per feature indicating contribution to the final score (positive or negative).
- Reason code mapping: SHAP values mapped to 24 categorical reason codes (12 positive, 12 negative). Mapping uses absolute SHAP value threshold (top contributing features selected). Raw SHAP numbers never exposed.
- Mandatory output: Every score response must include ≥3 positive and ≥2 negative reason codes. If SHAP computation fails, score is blocked — not served without codes.
- Retailer-facing translations: All 24 reason codes have plain-language translations in English and Hindi (regional languages in Phase 2). Translations reviewed by native speakers and plain-language accessibility testers.
- Grievance integration: Reason codes are the basis for the retailer grievance flow. If a retailer disputes a negative reason code, the grievance is routed to the correct team with the SHAP evidence attached.
Reason Code Taxonomy (v1)
✦ Positive Reason Codes
| Code | Plain Language (EN) | Plain Language (HI) |
|---|---|---|
| consistent_order_freq | Regular buying pattern | नियमित खरीद |
| low_payment_delay | Pays invoices on time | समय पर भुगतान |
| growing_basket_size | Business is growing | व्यवसाय बढ़ रहा है |
| low_return_rate | Low product returns | कम वापसी |
| long_distributor_tenure | Long relationship with supplier | लंबा व्यापार संबंध |
| strong_gmv_trend | Strong sales momentum | मजबूत बिक्री |
| zero_delay_rate_high | Frequently pays ahead of due date | अक्सर जल्दी भुगतान |
| seasonal_recovery | Business rebounds well after slow seasons | मंदी के बाद अच्छी वापसी |
✦ Negative Reason Codes
| Code | Plain Language (EN) | Plain Language (HI) |
|---|---|---|
| payment_delay_high | Often pays invoices late | अक्सर देर से भुगतान |
| p90_delay_gt_15days | Sometimes very late on payments | कभी-कभी बहुत देर |
| declining_gmv | Sales have been falling | बिक्री घट रही है |
| high_return_rate | High product return rate | अधिक वापसी |
| order_gap_detected | Gaps in buying activity | खरीद में रुकावट |
| partial_payment_freq | Often pays only part of invoices | अक्सर आंशिक भुगतान |
| seasonal_gap_deep | Long slow season with low activity | लंबी मंदी |
| data_insufficient | Not enough history to score fully | पर्याप्त इतिहास नहीं |
GR-4 · Affordability & Limit Ceiling
Primary ceiling: 30% of trailing 6-month GMV. Rationale: a retailer's working capital need is bounded by their stock-turn cycle. A retailer with ₹5L/month GMV needs approximately ₹1–2L in working capital (stock cycle of 2–4 weeks). At 30% of 6-month GMV (≈ 5% of annual GMV), the limit is conservative enough to prevent over-indebtedness while being meaningful for the average kirana's festival-season need.
Seasonal adjustment: The ceiling is computed on the trailing 6 months at scoring time. Scoring in October uses April–September GMV. If this under-represents the festival quarter, lenders can request a seasonal-adjusted limit — which uses the highest 6-month trailing window in the past 24 months instead.
Additional affordability check: Where bureau data is available via Account Aggregator (v2), existing NBFC exposure is checked against the proposed limit. Total formal credit exposure should not exceed 40% of annualised GMV.
- Ceiling enforcement layer: Applied in the Score API service, post-model-inference. The model may produce a recommended limit; the ceiling clamps it. Model output is never served directly without passing through the ceiling layer.
- Hard-coded constant: The 30% ceiling is a compile-time constant, not a configurable parameter. Any change requires a code change, PR review, deployment, and Risk team sign-off — not a config toggle.
- API transparency: If ceiling is applied, the response includes: limit_source="gmv_ceiling", gmv_6m_trailing, ceiling_applied=true. Lenders always know when the ceiling, not the model, determined the limit.
- Lender manual override: Lender can set a higher limit via the dashboard with a documented justification. Override is capped at 150% of the GMV ceiling. Override creates an immutable audit record. All overriding lenders receive a monthly override performance report (default rates on overridden loans vs. non-overridden).
- Zero-GMV cold-start: Retailers with insufficient GMV history receive a conservative fixed starting limit (₹25,000) regardless of model score. This prevents the ceiling from being infinite for retailers with no computable GMV baseline.
GR-5 · Data Quality & Provenance
Every distributor's data batch receives a completeness score (0–100%) computed across five dimensions:
- Invoice completeness: % of invoices with all required fields populated (date, amount, retailer_id, SKU category)
- Payment completeness: % of invoices with at least one associated payment record
- Temporal coverage: % of months in the last 24 months with at least 5 invoice records
- Retailer identity completeness: % of retailer records with GST or verified phone number
- Schema conformance: % of records matching expected data types and value ranges
Overall completeness = weighted average of five dimensions. Weights: Invoice 30%, Payment 30%, Temporal 20%, Identity 10%, Schema 10%.
- Completeness ≥ 70%: Full scoring permitted. Score serves without quality flag.
- Completeness 50–69%: Score served with low_confidence=true flag. Recommended limit capped at 50% of standard ceiling. Lender notified. Distributor prompted to improve data quality via dashboard.
- Completeness < 50%: Scoring blocked for this distributor's retailers. Rules-based conservative limit applied if lender explicitly requests it. Distributor alerted with specific dimension breakdowns.
- Anomalous batch detected: Bulk payment recording, duplicate invoices, all-same-day transactions → batch quarantined; feature pipeline does not process until reviewed.
- Data freshness: If last sync >7 days ago, data_freshness_days prominently surfaced in API response; >14 days, low_confidence=true automatically applied.
GR-6 · Model Lifecycle Governance
- Population Stability Index (PSI): Computed monthly by comparing the score distribution of the current live population vs. the training baseline distribution. PSI quantifies distribution shift across deciles. PSI <0.10 = stable; 0.10–0.20 = monitor; >0.20 = model refresh triggered.
- KS Statistic on live data: Kolmogorov-Smirnov statistic tracked monthly on the subset of retailers with known repayment outcomes (pilot + Phase 4 cohorts). If KS drops >10 points vs. validation baseline, model refresh is triggered regardless of PSI.
- PD Calibration: Predicted probability of default vs. actual 90-day default rate tracked monthly for all retailers with resolved loan outcomes. Divergence >3% triggers investigation.
- Feature drift: Individual feature distributions monitored for shift. If a top-5 SHAP feature drifts significantly (PSI >0.2 at feature level), root cause is investigated — may indicate ERP data change, not model failure.
- Champion/Challenger framework: New model versions run in shadow mode for minimum 30 days, scoring real retailers without driving decisions. Shadow mode AUROC, KS, PSI, and fairness metrics compared to champion.
- Promotion gate: Challenger must exceed champion on AUROC by ≥0.01 and not degrade on KS, PSI, or any fairness metric. Requires sign-off from: ML Lead + Head of Risk.
- Rollback protocol: If promoted model causes AUROC to drop >5% on next monthly evaluation, automatic rollback to previous champion. Rollback takes <10 minutes (pre-baked previous model artifact).
- Emergency freeze: Any team member can trigger a model freeze via the ML Ops dashboard. Frozen model serves last pre-freeze scores from cache. Freeze must be reviewed by ML Lead + CTO within 4 hours.
- Version stamping: Every API response includes model_version. Enables exact reproducibility of any historical scoring decision for audit purposes.
Guardrail Health Dashboard
All six guardrails are monitored on a unified health dashboard reviewed weekly by the Risk team and monthly by the full cross-functional guardrail committee (Product, Risk, ML, Legal, Engineering).
| Guardrail | Primary Metric | Green (Healthy) | Amber (Watch) | Red (Action Required) | Current Status |
|---|---|---|---|---|---|
| GR-1 Fairness | Adverse Impact Ratio (lowest cohort) | AIR ≥ 0.85 | AIR 0.80–0.85 | AIR < 0.80 → model freeze for affected cohort | PRE-LAUNCH |
| GR-2 Gaming | Anomaly detection recall on test set | Recall ≥ 85% | Recall 80–85% | Recall < 80% → model review + threshold recalibration | PRE-LAUNCH |
| GR-3 Explainability | % scores with complete reason codes | 100% | 99–100% | < 99% → engineering incident declared | PRE-LAUNCH |
| GR-4 Affordability | Override default rate vs. non-override | < 1.5× non-override rate | 1.5–2× non-override rate | > 2× → lender override policy review triggered | PRE-LAUNCH |
| GR-5 Data Quality | % distributors with completeness ≥ 70% | ≥ 90% of distributors | 80–90% of distributors | < 80% → customer success escalation; data improvement program review | PRE-LAUNCH |
| GR-6 Model Lifecycle | PSI (monthly) | PSI < 0.10 | PSI 0.10–0.20 | PSI > 0.20 → model refresh; > 0.30 → model freeze | PRE-LAUNCH |
Guardrail Governance & Change Control
Cross-Functional Ownership
The Guardrail Committee meets monthly and is responsible for reviewing all guardrail health metrics, approving any threshold changes, and escalating model freeze decisions to leadership.
- Chair: Head of Risk
- ML Lead (model performance + drift)
- DPO / Legal Lead (fairness + regulatory)
- Head of Product (retailer + lender experience)
- Head of Engineering (implementation + reliability)
- CISO (security guardrails observer)
How Guardrails Can Change
Guardrail thresholds and logic are not changed at individual discretion. The following change control applies:
- Threshold relaxation (e.g., raising affordability ceiling): requires Guardrail Committee approval + DPO sign-off + written risk assessment
- Threshold tightening: Guardrail Committee approval only
- New guardrail addition: Product + ML + Legal proposal → Committee review → implementation
- Emergency threshold change: Head of Risk + CTO joint approval; Committee ratification at next meeting
- All changes versioned in the Guardrail Change Log (maintained in this document's appendix)
Guardrail Change Log
| Version | Date | Guardrail | Change | Approved By | Rationale |
|---|---|---|---|---|---|
| v1.0 | May 2026 | All (initial) | Initial definition of all 6 guardrails and thresholds | Head of Risk + CTO + DPO | Pre-launch baseline; thresholds to be reviewed after first 90 days of live data |