Skip to content

Fail closed on non-finite account risk scores#56

Closed
lazyGPT07 wants to merge 2 commits into
profullstack:masterfrom
lazyGPT07:codex/fail-closed-non-finite-risk
Closed

Fail closed on non-finite account risk scores#56
lazyGPT07 wants to merge 2 commits into
profullstack:masterfrom
lazyGPT07:codex/fail-closed-non-finite-risk

Conversation

@lazyGPT07

Copy link
Copy Markdown
Contributor

Summary

  • normalize non-finite account risk scores to the maximum risk value
  • preserve the existing [0, 1] clamp for finite scores
  • cover NaN, positive infinity, and negative infinity with regression tests

Root cause

Math.min/Math.max preserve NaN, and riskBandForScore(NaN) falls through to the low-risk band. Negative infinity clamps to zero. Both cases can make malformed external risk input fail open.

Validation

  • vitest run packages/account-core/src (8 tests passed)
  • tsc -p packages/account-core/tsconfig.json --noEmit

Fixes #55

@ralyodio ralyodio closed this Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Account policy treats non-finite risk scores as low risk

2 participants