Financial institutions do not need to wait for a missed payment to identify a potentially risky loan.

A borrower may show warning signs months before a payment default. Revenue may decline, debt may increase, cash reserves may shrink, or financial statements may become inconsistent.

The challenge is turning these signals into useful decisions.

A borrower risk scoring engine can help investment funds identify loans that require closer attention. But there is an important distinction between a system that produces a risk score and one that can explain exactly why the score was generated.

For financial technology developers, explainability, data quality, and auditability should be core design requirements.

The Paul Brenneke and Sortis Income Fund lawsuit provides a relevant context for examining these controls. The investor complaint raises allegations concerning related-party lending, loan disclosures, and fund management. Sortis disputes the allegations, and they have not been established as facts by a final court judgment.

This article explores how developers can build a hypothetical, explainable borrower risk scoring engine using Python and PostgreSQL.

1. Why Traditional Loan Monitoring Is Not Enough

A basic loan management system may track:

  • Outstanding principal.
  • Interest payments.
  • Payment due dates.
  • Loan maturity.
  • Borrower information.
  • Current loan status.

These fields are important, but they do not necessarily provide an early indication of financial deterioration.

Consider a borrower with the following changes:

Indicator Previous period Current period
Revenue $2,000,000 $1,500,000
Total debt $800,000 $1,200,000
Cash reserves $400,000 $180,000
DSCR 1.65 1.15

The borrower may still be making scheduled payments, but several indicators have deteriorated.

A monitoring system that only checks payment status could classify the loan as healthy.

A risk scoring engine can combine multiple indicators and flag the loan for further review.

2. What Is an Explainable Risk Scoring Engine?

A borrower risk scoring engine evaluates financial and operational indicators and converts them into a structured risk assessment.

For example:

Risk factor Example warning
DSCR Below the required threshold
Revenue trend Significant decline
Debt exposure Increasing leverage
Cash reserves Falling liquidity
Payment history Repeated delays
Reporting compliance Missing financial statements

Each indicator contributes to an overall risk assessment.

However, the system should never return only:

Risk Score: 82

A reviewer should also understand:

  • Which indicators increased the score?
  • What source data was used?
  • When was the data collected?
  • Which scoring rules were applied?
  • How did the score change from the previous assessment?
  • Who reviewed the result?

This is the difference between a black-box score and an explainable financial control.

3. Designing the System Architecture

A practical architecture can contain six components.

1. Borrower data ingestion

Collects financial statements, repayment records, borrower submissions, and operational information.

2. Data validation layer

Checks missing values, invalid formats, reporting periods, duplicate records, and unusual changes.

3. Feature calculation engine

Calculates DSCR, revenue growth, leverage, liquidity ratios, and other relevant indicators.

4. Risk scoring engine

Applies documented scoring rules or a validated statistical model.

5. Explainability layer

Records the factors that contributed to each risk score.

6. Review and audit workflow

Allows authorized analysts to investigate alerts, add comments, and record decisions.

A simplified flow looks like this:

Borrower Financial Data | v Data Validation | v Feature Calculation | v Risk Scoring Engine | v Explainability Layer | v Risk Classification | v Human Review and Audit 

The scoring engine should support human decision-making, not automatically make lending, enforcement, or investment decisions.

4. Defining Financial Risk Indicators

Before writing Python code, developers need to define the indicators the system will evaluate.

Some common examples include:

Debt Service Coverage Ratio (DSCR)

Measures whether a borrower generates enough operating income to cover debt service.

DSCR = Net Operating Income / Debt Service

A declining DSCR can indicate weakening repayment capacity.

Revenue Growth

Measures changes in borrower revenue over time.

Revenue Growth = (Current Revenue - Previous Revenue) / Previous Revenue

A sustained decline may require additional review.

Debt-to-Equity Ratio

Provides an indication of how much debt a business uses relative to equity.

Debt-to-Equity = Total Debt / Shareholders' Equity

Cash Coverage

Can help assess the relationship between available cash and upcoming obligations.

These indicators must be interpreted in the context of the borrower's industry, loan agreement, accounting policies, and reporting period.

A restaurant business and a real estate company may require different risk assumptions.

5. Building a Risk Scoring Engine With Python

For an initial implementation, a transparent rule-based scoring model is easier to inspect than a complex machine learning model.

The following example uses hypothetical data and illustrative thresholds.

from decimal import Decimal def calculate_risk_score(borrower): score = 0 reasons = [] dscr = Decimal(str(borrower["dscr"])) revenue_growth = Decimal(str(borrower["revenue_growth"])) debt_to_equity = Decimal(str(borrower["debt_to_equity"])) cash_ratio = Decimal(str(borrower["cash_ratio"])) if dscr < Decimal("1.00"): score += 30 reasons.append("DSCR below 1.00") elif dscr < Decimal("1.25"): score += 15 reasons.append("DSCR below 1.25") if revenue_growth < Decimal("-0.20"): score += 20 reasons.append("Revenue declined by more than 20%") elif revenue_growth < Decimal("-0.10"): score += 10 reasons.append("Revenue declined by more than 10%") if debt_to_equity > Decimal("3.00"): score += 20 reasons.append("High debt-to-equity ratio") if cash_ratio < Decimal("0.50"): score += 15 reasons.append("Low cash coverage") if score >= 60: category = "High" elif score >= 30: category = "Medium" else: category = "Low" return { "risk_score": score, "risk_category": category, "risk_reasons": reasons } borrower = { "dscr": "1.15", "revenue_growth": "-0.25", "debt_to_equity": "3.50", "cash_ratio": "0.40" } result = calculate_risk_score(borrower) print(result) 

Example output:

{ "risk_score": 70, "risk_category": "High", "risk_reasons": [ "DSCR below 1.25", "Revenue declined by more than 20%", "High debt-to-equity ratio", "Low cash coverage" ] } 

The important part is not the number 70.

It is the explanation behind that number.

A reviewer can see which indicators triggered the assessment and investigate the underlying financial records.

Important: These thresholds and weights are illustrative, not industry standards or validated credit risk parameters. A production model requires calibration, historical testing, documented assumptions, and appropriate approval.

6. Storing Risk Assessments in PostgreSQL

A risk assessment should be stored as a historical record rather than simply overwriting the borrower's previous score.

A simplified table could look like this:

CREATE TABLE borrower_risk_assessments ( assessment_id SERIAL PRIMARY KEY, borrower_id INTEGER NOT NULL, assessment_date TIMESTAMP NOT NULL, risk_score INTEGER NOT NULL, risk_category VARCHAR(30) NOT NULL, scoring_version VARCHAR(50) NOT NULL, reviewer_status VARCHAR(30), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); 

The factors contributing to the score can be stored separately:

CREATE TABLE risk_assessment_factors ( factor_id SERIAL PRIMARY KEY, assessment_id INTEGER NOT NULL REFERENCES borrower_risk_assessments(assessment_id), factor_name VARCHAR(100) NOT NULL, observed_value NUMERIC(15, 4), contribution INTEGER NOT NULL, explanation TEXT ); 

This structure makes it possible to answer questions such as:

  • What was the borrower's risk score three months ago?
  • Which indicators caused the score to increase?
  • Which scoring version was used?
  • Did a reviewer approve or override the classification?
  • What evidence supported the assessment?

For a production environment, also store source document references, reporting periods, data validation results, and model approval information.

7. Tracking Risk Changes Over Time

A single risk score provides limited information.

The trend is often more useful.

Imagine these assessments:

Month Risk score Classification
January 18 Low
February 24 Low
March 35 Medium
April 48 Medium
May 72 High

The system should identify that the borrower's risk has increased consistently.

A simple SQL query can retrieve the assessment history:

SELECT borrower_id, assessment_date, risk_score, risk_category, scoring_version FROM borrower_risk_assessments WHERE borrower_id = 101 ORDER BY assessment_date; 

A dashboard can then display the score trend and highlight significant changes.

Developers should also distinguish between genuine deterioration and changes caused by revised scoring rules or corrected source data.

8. Why Model Versioning Is Essential

Suppose a fund changes its scoring rules in June.

Previously, a DSCR below 1.25 contributed 15 points. The revised model assigns 20 points.

If the system does not record which model generated each score, historical comparisons may become misleading.

Every assessment should therefore include:

  • Model or scoring version.
  • Effective date.
  • Risk factor definitions.
  • Thresholds and weights.
  • Data sources.
  • Validation status.
  • Approval information.

When a model changes, the system should preserve the previous version.

It should also be possible to reproduce an earlier assessment using the original data and scoring rules.

9. Avoiding Common Risk Scoring Mistakes

A scoring engine can create new problems if it is poorly designed.

Missing data should not automatically mean low risk.

If a borrower fails to submit financial statements, the system should flag incomplete information rather than assume the borrower is financially healthy.

Do not mix reporting periods.

Comparing annual revenue with quarterly debt service can produce misleading results.

Do not treat every industry equally.

Financial ratios vary across industries. Thresholds should reflect the borrower's business model and the specific loan agreement.

Avoid unexplained manual overrides.

If an analyst changes a risk classification, the system should record the reason, reviewer, timestamp, and supporting evidence.

Do not confuse correlation with causation.

A declining revenue trend may indicate a concern, but it does not independently establish that a borrower will default.

10. Model Validation, Drift, and Human Oversight

A risk scoring engine should be tested before it becomes part of a live financial workflow.

Useful validation activities include:

  • Backtesting against historical borrower outcomes.
  • Checking false positives and false negatives.
  • Comparing predictions across borrower segments.
  • Testing sensitivity to missing or inaccurate data.
  • Monitoring changes in input data distributions.
  • Reviewing whether scoring thresholds remain appropriate.
  • Independently reviewing model changes.

For machine learning models, developers should also monitor model drift and document the limitations of the training data.

Human reviewers should be able to challenge a score, request additional information, and record a decision.

A high-risk classification should trigger investigation, not an automatic conclusion that the borrower has committed misconduct or will default.

11. Connecting the Technical Design to the Sortis Income Fund Dispute

A November 2026 Willamette Week report described a $5 million lawsuit filed by Stillwater Portfolio and an individual investor against Paul Brenneke and related Sortis entities.

The complaint alleges that the Sortis Income Fund made loans to businesses connected to the wider Sortis network, including Rudy's Barbershop and Sustainable Restaurant Group. It also raises questions about loan descriptions, investor disclosures, and the management of certain loans.

Sortis disputes the allegations and has described the lawsuit as meritless.

Separately, The Oregonian/OregonLive reported that the SEC had opened an investigation involving the Sortis Income Fund and that Oregon regulators were conducting a separate inquiry involving Sortis. The precise relationship between those inquiries and the loans described in the lawsuit was not established in that reporting.

These reports do not establish that a borrower risk scoring system was absent, that a particular risk score was incorrect, or that any specific loan breached a financial covenant.

However, the broader issues demonstrate why investment platforms benefit from structured borrower information, documented risk assessments, historical scoring records, and independent review processes.

An explainable scoring engine cannot determine whether a transaction was legally appropriate. It can help make financial warning signs more visible and ensure that assessments are supported by traceable data.

Conclusion

Building a borrower risk scoring engine is not simply a matter of assigning numbers to financial ratios.

A reliable system must combine:

  1. Validated borrower data.
  2. Clearly defined financial indicators.
  3. Documented scoring rules.
  4. Explainable risk assessments.
  5. Historical model versioning.
  6. Human review and approval.
  7. Reproducible audit records.

Python can handle calculations and scoring logic, while PostgreSQL can maintain historical assessments and their supporting evidence.

For developers building fintech platforms, private credit systems, and investment management software, explainability should be designed into the system from the beginning.

A risk score tells you where to look. A good risk scoring system explains why you should look there.

References

  1. Willamette Week: A Lawsuit Alleges Paul Brenneke and Sortis Companies Defrauded Investors and Engaged in Self-Dealing Loans

  2. The Oregonian/OregonLive via Yahoo Finance: Feds Probe $166M Sortis Real Estate Fund

  3. Python Decimal Documentation

  4. PostgreSQL Documentation

  5. NIST AI Risk Management Framework

  6. NIST AI Risk Management Framework Playbook