FinSafe Doesn't Predict Your Future. It Bounds It.
A personal finance decision engine that answers Buy Now or Wait from the 10th percentile of your own transaction history, not from a forecast.
- FinSafe answers affordability questions by computing an empirical floor from your own transaction history rather than forecasting a likely future balance.
- The engine treats overdue bills as certain and overdue income as uncertain, an asymmetry that encodes a specific worldview: bills come, paychecks might not.
- The bad case is the 10th percentile of the user's own rolling 30-day spending, which is why the system refuses to run on less than 60 days of history.
- The README describes a single decision path through Python and Claude, but the code contains two separate decision engines, one in Java and one in Python, with different thresholds.
The 10th Percentile Is the Whole Idea
Most budgeting apps sell a forecast. They take your income and your spending, project them forward, and draw a line into next month. FinSafe refuses that move. It does not estimate what your balance will probably be. It computes a floor, the point below which your money usually does not fall, and it asks whether a purchase survives that number.
Concretely, the engine looks at your last 60 days of transactions, works out your rolling 30-day spending, and takes the 10th percentile of that distribution. That number is the bad case. Not a stress test, not a multiplier, not a scenario you can tune. An empirical quantile of your own behavior.
A forecast is a number you can argue with. A floor is a number you cannot. That distinction is the whole design.
What FinSafe Actually Answers
The system takes a financial profile (current balance, income, recurring bills, EMIs, savings goals) plus a planned purchase, and returns one of four verdicts.
- Buy Now: the purchase clears the bad-case floor with room to spare.
- EMI: the purchase is affordable only if split into installments, and the offers are evaluated against the same floor.
- Wait: the purchase would breach the floor today but looks safe later.
- Not Recommended: the purchase breaches the floor and waiting does not fix it.
The context is Indian rupees. The code carries INR assumptions in its formatting and thresholds, which tells you who this was built for: an individual consumer deciding whether a single purchase is safe, not an analyst modeling a portfolio.
How the Forecast Works
Everything rests on forecast_cashflow(). It takes transactions, the current balance, today's date, and a 30-day horizon, and returns two projections: a typical one and a bad one.
Before any math runs, a gate checks your history. If you have fewer than 60 days of transactions, the function raises an error and the system declines rather than guessing. This is the part most finance apps skip. A quantile of three data points is not a quantile.
Salary is projected at the minimum of your last three deposits. Rent is projected at the maximum of your last three withdrawals. Both rules lean the same direction: assume the least income and the most obligation.
Irregular spending, everything that is not salary or rent, gets aggregated into daily net amounts and rolled into a 30-day sum. The median of those sums is the typical case. The 10th percentile is the bad case.
Because the bad case is drawn from your own history, its quality depends entirely on how much history you have. That is why the 60-day gate exists. It is not a product decision. It is a statistical one.
Assume Bills Come. Don't Assume Income Arrives.
The sharpest detail in the codebase is a rule most tools would never write. When a recurring payment is overdue, FinSafe treats income and obligations differently. The rules, condensed:
MIN_HISTORY_DAYS = 60
N_RECENT = 3
BAD_CASE_QUANTILE = 0.10
GRACE_DAYS = 3
# salary: assume the least income arrives
salary_amount_rule = "min"
# rent: assume the most obligation lands
rent_amount_rule = "max"
if overdue:
if category == "salary":
treatment = "excluded" # income might not arrive
else:
treatment = "included" # the bill is still owed
An overdue salary is stripped out of the projection entirely and flagged as excluded. The system assumes a paycheck that did not arrive might not arrive at all.
An overdue rent payment is the opposite. It stays in fixed expenses, flagged as included. The system assumes the bill is still owed whether or not you have paid it.
The principle underneath: assume bills still come, don't assume income arrives. It is asymmetric on purpose, and it is the single most opinionated line in the project.
Two Decision Engines, One README
Here is where the README and the code part ways. The README describes a clean flow: Spring Boot receives a request, calls a Python service at /internal/v1/analyze, Python runs the math and the model, and Claude writes the plain-language explanation.
The code shows something else. The Java PurchaseService computes a candidate verdict locally. The Python make_decision() runs a separate pipeline with its own thresholds. And no Claude or Anthropic client appears anywhere in the provided source. templates.py, the explanation layer, is deterministic string formatting, not a language model.
Some files were truncated, so the full call path cannot be confirmed. Treat the table below as what the code shows, not as a verdict on intent.
| README says | Code shows | Confidence |
|---|---|---|
| Spring Boot calls Python at /internal/v1/analyze | Java PurchaseService computes a verdict locally; a RestTemplate is declared but no call is visible | Unverified (file truncated) |
| Python produces the decision | Python make_decision() runs a separate pipeline with different thresholds | Verified in provided source |
| Claude writes the explanation | templates.py does deterministic string formatting; no LLM client present | Verified in provided source |
Where It Sits
Against a typical budgeting app, FinSafe inverts almost every default.
| FinSafe | Typical budgeting app | |
|---|---|---|
| Future balance | Empirical 10th percentile of your history | Forward forecast from income and spending |
| Missed income | Excluded from the projection | Blended into expected income |
| Missed bills | Included as still owed | Blended into expected spending |
| Minimum data | 60 days of transactions, or it declines | None |
| Explanation | Template text | Chart |
FinSafe is also a crowded name. Separate projects called FinSafe cover DeFi collateral monitoring, transaction and login risk scoring, card spending limits, and AI agent security. None of them is verified as related to this repository. The shared name is a coincidence, not a lineage.





