Credit Risk Analysis
Use the shared credit office public API to analyze branch loan portfolios,
pending applications, and credit-union segments for lending-committee
decisions. The API base URL is always provided as <TASK_ENV_BASE_URL>.
There is no authentication requirement.
API Reference
All data is read-only. Every endpoint returns JSON.
| Endpoint |
What it returns |
GET /api/health |
Service status and record counts. |
GET /api/manifest |
Generated dataset metadata: benchmark versions, policy version, endpoint list. |
GET /api/policies |
Credit policy rules: risk rating thresholds, CDFI factor scores, CRE weighted score, stress formulas, concentration rules, delinquency minimums. |
GET /api/branches |
List of all branch objects. |
GET /api/branches/{branch_id} |
Single branch: branch_id, branch_name, lending_capacity_q1, sector_ceiling_pct, cre_policy_limit_pct, total_assets, state_code, institution_type. |
GET /api/branches/{branch_id}/metrics |
Quarterly branch metrics: nonperforming_loans, total_loans_outstanding, delinquency_30_plus_pct, allowance_for_loan_losses, net_charge_offs, total_deposits. Most recent quarter first. |
GET /api/branches/{branch_id}/loans |
All loans for the branch. See Loan Fields below. |
GET /api/branches/{branch_id}/sector-exposures |
Per-sector concentration: sector, current_exposure, limit_pct, grandfathered. |
GET /api/branches/{branch_id}/applications |
Pending lending applications. See Application Fields below. |
GET /api/benchmarks/fdic/q4-2024 |
One object with FDIC benchmark ratios: total_loans_noncurrent_pct, total_real_estate_noncurrent_pct, construction_development_noncurrent_pct, total_real_estate_30_89_pct, construction_development_30_89_pct. |
GET /api/benchmarks/ncua/q1-2025 |
NCUA rows per state including US: state_code, delinquency_bps, loan_to_share_pct, roaa_bps, positive_net_income_pct. |
GET /api/credit-union-segments/{segment_id} |
Single segment: segment_id, segment_name, state_code, quarterly_capacity, risk_tolerance, peer_states, minimum_checklist, portfolio_focus, member_profile, internal_context, notes, current_outstanding. |
Loan Fields
Each loan object: loan_id, borrower_name, branch_id, sector, loan_type,
outstanding_balance, current_rating, payment_status, days_past_due,
dscr, ltv, collateral_value, fico, debt_to_asset, liquidity_months,
guarantor_strength, interest_rate, annual_debt_service, annual_review_date, notes.
Fields may be null. Treat null fields as unavailable for that loan.
Application Fields
Each application: application_id, applicant_name, business_name, branch_id,
sector, loan_type, requested_amount, dscr, ltv, collateral_value,
fico, years_in_business, existing_relationship_years,
relationship_deposit_balance, bankruptcy_months_ago,
prior_delinquencies_12m, documentation_complete, proposed_rate, purpose,
term_months, co_guarantor_strength, sba_guaranty_pct, total_assets,
total_debt, annual_revenue, net_income, dti, notes.
Fields may be null. Treat null fields as unavailable.
Policy Rules
Always fetch GET /api/policies first. The response contains the authoritative
rule set for the run. The rules described below are from credit_policy_v2025Q1
but the live policy response is canonical.
Risk Rating Re-derivation
The dominant factor rule: take the worst (highest integer) numeric rating
from DSCR, LTV (or collateral), and delinquency factors. When a factor is
unavailable (null DSCR, null LTV, or Current payment status), skip it.
DSCR thresholds (from policies.risk_rating.dscr_thresholds):
| DSCR |
Rating |
| >= 1.50 |
3 |
| >= 1.25 |
4 |
| >= 1.05 |
5 |
| >= 1.00 |
6 |
| < 1.00 |
7 |
LTV thresholds (from policies.risk_rating.ltv_thresholds):
| LTV |
Rating |
| <= 0.65 |
3 |
| <= 0.75 |
4 |
| <= 0.85 |
5 |
| <= 1.00 |
6 |
| > 1.00 |
7 |
Delinquency minimums (from policies.risk_rating.delinquency_minimums):
| Payment Status |
Minimum Rating |
| Current |
no minimum |
| 30 Days Past Due |
4 |
| 60 Days Past Due |
5 |
| 90+ Days Past Due |
7 |
| Nonaccrual |
8 |
A material downgrade is a final_rating >= current_rating +
policies.risk_rating.material_downgrade_notches (default 2).
CDFI Factor Scoring
Each loan is scored by summing points from four available factors. Null factors
are omitted from the sum.
From policies.cdfi_factor_scores:
FICO: >720:0, 680-720:1, 580-679:3, <580:5
LTV: <0.40:0, 0.40-0.60:2, 0.60-0.80:4, >0.80:6
Debt-to-Asset: <0.40:0, 0.40-0.60:2, 0.60-0.80:4, >0.80:6
Liquidity Months: >12:0, 6-12:1, 3-6:3, <3:5
Total factor_score = sum of available factor points.
Risk class mapping (from policies.cdfi_factor_scores.classes):
| Score |
Class |
| 0-5 |
Prime |
| 6-9 |
Desirable |
| 10-13 |
Satisfactory |
| 14-18 |
Watch |
| >=19 |
Doubtful |
| >=19 and ltv > 1.0 |
Projected Loss |
The Projected Loss rule overrides Doubtful when ltv > 1.0.
CRE Weighted Scoring
From policies.cre_weighted_score. Weights: capacity 0.45, capital 0.03,
character 0.05, collateral_exposure 0.36, conditions 0.11.
Compute sub-scores for each dimension using CDFI-style factor scoring on
application data, then apply weighted sum:
weighted_score = capacity_score*0.45 + capital_score*0.03 + character_score*0.05
+ collateral_exposure_score*0.36 + conditions_score*0.11
Map weighted_score to class:
| Score |
Class |
| <= 2.0 |
approve_quality |
| <= 3.0 |
conditional |
| > 3.0 |
weak |
DSCR Stress Formulas
From policies.stress:
Watch-list stress (+200bp parallel shock):
stressed_dscr = dscr / (1 + 0.18)
CRE dual stress:
stressed_dscr = dscr * 0.85 / (1 + 0.18)
Coverage breach threshold is always 1.0 (from policies.stress.coverage_breach_threshold).
Apply stress only to loans or applications where DSCR is available (not null).
Concentration Rules
From policies.capacity_concentration:
- Sector exposure comes from
/api/branches/{branch_id}/sector-exposures.
- Each row has
limit_pct and current_exposure.
- Compute concentration ratio:
current_exposure / total_loans_outstanding
(use latest-quarter total_loans_outstanding from branch metrics).
- Post-approval: add approved amounts to the relevant sector's current_exposure,
recompute ratio, compare to limit_pct.
- If
grandfathered is 1, existing over-ceiling exposure may remain, but new
approvals may not worsen that sector without mitigation.
- When a concentration flag fires, allowed mitigations from the policy are:
participation_required, reduced_amount, board_exception.
Workflow Patterns
Pattern A: Rating Migration Review (branch-level)
- Fetch: branch details, branch metrics, all branch loans, policies, FDIC benchmark.
- Filter loans with
current_rating >= target_min (typically 3).
- For each targeted loan, re-derive risk rating using the dominant factor rule.
- Classify migration from each current rating bucket to final rating.
- Identify material downgrades (final - current >= material_downgrade_notches).
- Compute NPA benchmark:
nonperforming_loans / total_loans_outstanding vs
FDIC total_loans_noncurrent_pct. Variance in ratio and bps.
- Assign watch-list actions to each loan based on final rating:
- 4: monitor
- 5-6: watchlist
- 7: special_assets
- 8 with Nonaccrual: partial_chargeoff_review
- 8 without Nonaccrual: legal_referral
- Select top problem credit: the loan with the worst combination of final
rating and exposure (typically the highest-rated, highest-exposure loan).
Report its loan_id, borrower_name, exposure, current_rating, final_rating,
payment_status, and recommended_action.
- Produce final_rating_exposure_totals: group by final_rating, sum loan_count
and exposure. Order by final_rating ascending.
- Produce migration_from_current_rating_3: for loans that started at rating 3,
group by final_rating, collect loan_ids.
- Produce watch_list_action_coverage: count covered loans/exposure, break down
by action with loan_ids.
Pattern B: Lending Allocation (branch-level)
- Fetch: branch details, branch metrics, sector exposures, pending applications, policies.
- For each application, decide approve/conditional_approve/decline/defer/participation_required.
- Decision logic: Start with the most creditworthy applications. Respect
capacity. Check sector limits. Apply policy thresholds.
- Decline reasons (use controlled reason codes):
capacity_limit: total committed capacity would exceed lending_capacity_q1
sector_breach: sector concentration would exceed its limit_pct
weak_dscr: DSCR well below policy floor (typically < 1.05 or < 1.0)
high_ltv: LTV > 0.85 or > 1.0
low_fico: FICO < 580 or in weakest band
recent_bankruptcy: bankruptcy within recent history
startup_risk: years_in_business < 2
underwater_collateral: LTV > 1.0
policy_floor_missing: required underwriting data missing (null DSCR, etc.)
documentation_gap: documentation_complete == 0
fdic_adverse_variance: branch metric is adverse vs FDIC benchmark
ncua_peer_weakness: state metrics weaker than peers
- Conditional approve conditions:
participation_required: sector concentration flagged
reduced_amount: cut the approved amount
board_exception: policy override needed
sba_guaranty_required: SBA-backed loan with insufficient guaranty
startup_monitoring: startup requiring oversight
none: no conditions
- For approved and conditional apps:
bank_capacity_used for
participation_required = the bank-retained portion; for sba_guaranty_required
= bank's unguaranteed share. For standard approves, full amount counts.
- Priority ranking: list approved/conditionally-approved applications in
priority order (highest first). Priority factors: credit quality, relationship
depth, strategic fit, concentration impact.
- Post-approval concentrations: for each sector, add approved amounts,
recompute ratio, flag if over limit.
Pattern C: Credit Union Segment Posture
- Fetch: manifest, policies, NCUA benchmarks, segment endpoint.
- Extract segment state's metrics from NCUA benchmark rows.
- Compute US comparison: for each metric (delinquency, loan_to_share, roaa,
positive_net_income), compare state value to US row. Direction: higher/lower/equal.
- Compute peer median comparison: compute the median of the peer_states values
for each metric, compare state to peer median.
- For even number of peers, median = average of middle two values.
- Determine posture:
continue_approving: capacity available AND external risk stronger or mixed
continue_with_tighter_conditions: capacity available BUT external risk weaker
temporarily_pause: no capacity OR severely adverse external risk
- Required checklist gates come from
segment.minimum_checklist.
- Added operating controls: based on
internal_context.control_issue and
external risk posture. Options: pre_close_insurance_binder_verification,
lien_perfection_prior_to_funding, senior_underwriter_second_review,
quarterly_state_benchmark_monitoring, monthly_segment_delinquency_watch,
committee_exception_for_capacity_overrun.
- Escalation triggers: match conditions to owners.
segment_recent_delinquency_ge_90_bps → credit_risk_manager
missing_insurance_or_lien_exception → operations_control_manager
quarterly_capacity_exceeded_or_exception_requested → lending_committee_chair
state_delinquency_gap_widens_25_bps → credit_risk_manager
- Interpretation: capacity_status based on quarterly_capacity vs
current_outstanding, external_risk_status based on benchmark comparisons,
risk_tolerance from segment, committee_message synthesized from posture and statuses.
Pattern D: Watch-List Stress (branch-level, adverse loans)
- Fetch: branch details, branch metrics, all branch loans, policies.
- Filter loans with
current_rating >= adverse_rating_min (typically 6).
- For each adverse loan, compute CDFI factor score and assign risk class.
- For each adverse loan with available DSCR, compute +200bp stress:
stressed_dscr = dscr / 1.18. Flag if stressed_dscr < 1.0.
- Set monitoring cadence:
monthly if any Projected Loss or Doubtful loans
quarterly if all are Watch or better
semiannual if all are Satisfactory or better
- Build workout queue sorted by descending exposure, then ascending loan_id:
- Projected Loss →
partial_chargeoff_review, projected_loss: true
- Doubtful →
special_assets, projected_loss: false
- Watch →
special_assets if payment_status is 90+ or Nonaccrual, else watchlist
- Satisfactory →
watchlist
- Desirable →
watchlist if payment_status not Current, else monitor
- Prime →
monitor
For each item report: loan_id, exposure, risk_class, payment_status,
recommended_action, projected_loss.
- Severe bucket counts: for ratings >= 6, group by (current_rating, payment_status),
count loans and sum exposure. Order by current_rating ascending, then payment_status.
Pattern E: Competing CRE Decision (branch-level, two applications)
- Fetch: branch details, branch metrics, all branch loans, sector exposures,
the two target applications, policies, FDIC benchmark.
- For each application, compute CRE weighted score. Sub-score dimensions:
- capacity (0.45): score from DSCR and capacity availability at branch level.
Map DSCR to score: >=1.50→0, >=1.25→2, >=1.05→4, >=1.00→6, <1.00→8.
- capital (0.03): score from borrower capital position. Map
debt_to_asset using CDFI bands. If null, use net_income/total_assets ratio
as proxy, or score 3 (midpoint) if unavailable.
- character (0.05): score from FICO (CDFI bands), relationship_years
(<2→5, 2-5→3, >5→0), prior_delinquencies, guarantor strength
(strong→0, standard→1, limited→3, none→5).
- collateral_exposure (0.36): score from LTV (CDFI bands) and exposure
size relative to branch capacity.
- conditions (0.11): score from loan_type (CRE→0, other→2), purpose
(refinance→0, other→2), documentation_complete (1→0, 0→3).
- Apply CRE dual stress:
stressed_dscr = dscr * 0.85 / 1.18.
- Compute branch CRE concentration:
- Identify all branch loans that are CRE-type. These span sectors that
commercially would be considered CRE (Multifamily, Office, Retail CRE,
Industrial CRE, Hospitality, and any sector whose loan_type is explicitly
CRE). Sum their outstanding_balance for existing CRE exposure.
existing_cre_concentration = existing CRE exposure / total_loans_outstanding.
selected_post_approval_cre_concentration = (existing + selected app amount) / total_loans_outstanding.
selected_policy_variance_bps = (post_approval_cre_concentration - cre_policy_limit_pct) * 10000.
- FDIC benchmark comparison: compare branch
delinquency_30_plus_pct to
FDIC total_real_estate_30_89_pct. Variance in ratio and bps.
- Decide path for the better-scored application:
approve_quality → approve, add conditions as needed
conditional → conditional_approve or participation_required
weak → decline or defer
- Unselected disposition: decline or defer with reason codes.
- Conditions for selected: include
committee_cre_exception when CRE policy
limit is breached, no_additional_cre_without_committee_review for
over-limit situations, bank_retained_exposure_cap for participation
scenarios, minimum_dscr_covenant_1_25 for moderate DSCR,
quarterly_financial_reporting for monitoring, tenant_roll_and_lease_review
for CRE, updated_appraisal_before_close when LTV is elevated.
Pattern F: Application-Level Decision Logic
When determining approve/decline for individual applications independently of
the competing workflow, follow this priority:
- Hard declines (any one is fatal):
documentation_complete == 0 → documentation_gap
ltv > 1.0 → underwater_collateral (unless SBA guaranteed mitigates)
fico < 580 → low_fico
bankruptcy_months_ago is recent (within 24 months) → recent_bankruptcy
years_in_business < 2 → startup_risk (unless strong mitigating factors)
- DSCR available and < 1.0 →
weak_dscr
- Capacity check: if committed_capacity + requested_amount > lending_capacity_q1 →
capacity_limit for all remaining, lower-priority apps.
- Sector check: for each application, compute post-approval sector concentration.
If > sector limit_pct AND sector not grandfathered →
sector_breach.
If > sector limit_pct AND grandfathered → can still approve with mitigation.
- Policy thresholds:
ltv > 0.85 → high_ltv
dscr < 1.05 → weak_dscr
- Benchmark comparison: if branch delinquency materially exceeds FDIC benchmark →
fdic_adverse_variance.
Reason Codes Reference
| Code |
When to use |
capacity_limit |
Branch Q1 lending capacity exhausted. |
sector_breach |
Post-approval sector concentration exceeds limit_pct. |
weak_dscr |
DSCR below policy minimum (typically < 1.05). |
high_ltv |
LTV above policy ceiling (typically > 0.85). |
low_fico |
FICO score below 580 or in weakest band. |
recent_bankruptcy |
Bankruptcy within recent history. |
startup_risk |
Business operating under 2 years. |
underwater_collateral |
LTV > 1.0. |
policy_floor_missing |
Required underwriting data missing (null DSCR, etc.). |
documentation_gap |
Incomplete application documentation. |
fdic_adverse_variance |
Branch delinquency materially exceeds FDIC benchmark. |
ncua_peer_weakness |
State metrics significantly weaker than peers (NCUA). |
Decision Enum Reference
Decision values: approve, conditional_approve, decline, defer, participation_required
Condition values: participation_required, reduced_amount, board_exception, sba_guaranty_required, startup_monitoring, none
Action values: monitor, watchlist, special_assets, workout, partial_chargeoff_review, legal_referral
Payment status values: Current, 30 Days Past Due, 60 Days Past Due, 90+ Days Past Due, Nonaccrual
Posture values: continue_approving, continue_with_tighter_conditions, temporarily_pause
Risk class values: Prime, Desirable, Satisfactory, Watch, Doubtful, Projected Loss
Score class values: approve_quality, conditional, weak
Computation Checklist
- All currency values: round to 2 decimal places.
- All percentages/ratios: round to 4 decimal places.
- Basis points (bps): round to 2 decimal places.
- List ordering: follow the template's
ordering directive (ascending by the
specified field).
- When a field is null and required for computation, exclude that dimension.
- Always use the latest quarter from branch metrics (first element in the
metrics array).
- For FDIC benchmarks, use the
/api/benchmarks/fdic/q4-2024 endpoint unless the manifest or
branch specifies otherwise.
- For NCUA benchmarks, use the
/api/benchmarks/ncua/q1-2025 endpoint unless the manifest
specifies otherwise.
- When the branch's
institution_type is bank, use FDIC benchmarks.
- When analyzing a
credit_union_segments endpoint, use NCUA benchmarks.
- For CRE concentration: sum outstanding_balance for loans where
loan_type is
CRE, regardless of sector. Also include loans in sectors typically
classified as CRE even if loan_type differs (based on sector_exposure rows
with CRE-relevant limit_pct values).
Output Rules
- Always produce valid JSON matching the provided answer template.
- Do not include narrative text outside the JSON.
- Respect all enum choices in the template.
- Sort lists exactly as the template's ordering directive specifies.
- Include all required top-level keys.
- Use null only when the template explicitly allows it.
Error Handling
- If an API endpoint returns an error or empty response, re-request once.
- If a loan or application field is null, treat the factor as unavailable and
skip it in scoring, but include the loan in population counts.
- If a branch has no loans matching the target criteria, report zero counts and
empty lists as appropriate.
1---2name: credit-risk-analysis3description: Analyze credit risk for branch and credit-union segments using the shared credit office API. Covers risk rating re-derivation, CDFI factor scoring, lending capacity allocation, concentration analysis, DSCR stress testing, watch-list actions, NPA benchmarking, CRE weighted scoring, and committee-ready report generation.4metadata:5 source: https://skillmd.com/skills/prism-shadow/credit-risk-analysis6---78# Credit Risk Analysis910Use the shared credit office public API to analyze branch loan portfolios,11pending applications, and credit-union segments for lending-committee12decisions. The API base URL is always provided as `<TASK_ENV_BASE_URL>`.13There is no authentication requirement.1415## API Reference1617All data is read-only. Every endpoint returns JSON.1819| Endpoint | What it returns |20|---|---|21| `GET /api/health` | Service status and record counts. |22| `GET /api/manifest` | Generated dataset metadata: benchmark versions, policy version, endpoint list. |23| `GET /api/policies` | Credit policy rules: risk rating thresholds, CDFI factor scores, CRE weighted score, stress formulas, concentration rules, delinquency minimums. |24| `GET /api/branches` | List of all branch objects. |25| `GET /api/branches/{branch_id}` | Single branch: `branch_id`, `branch_name`, `lending_capacity_q1`, `sector_ceiling_pct`, `cre_policy_limit_pct`, `total_assets`, `state_code`, `institution_type`. |26| `GET /api/branches/{branch_id}/metrics` | Quarterly branch metrics: `nonperforming_loans`, `total_loans_outstanding`, `delinquency_30_plus_pct`, `allowance_for_loan_losses`, `net_charge_offs`, `total_deposits`. Most recent quarter first. |27| `GET /api/branches/{branch_id}/loans` | All loans for the branch. See Loan Fields below. |28| `GET /api/branches/{branch_id}/sector-exposures` | Per-sector concentration: `sector`, `current_exposure`, `limit_pct`, `grandfathered`. |29| `GET /api/branches/{branch_id}/applications` | Pending lending applications. See Application Fields below. |30| `GET /api/benchmarks/fdic/q4-2024` | One object with FDIC benchmark ratios: `total_loans_noncurrent_pct`, `total_real_estate_noncurrent_pct`, `construction_development_noncurrent_pct`, `total_real_estate_30_89_pct`, `construction_development_30_89_pct`. |31| `GET /api/benchmarks/ncua/q1-2025` | NCUA rows per state including `US`: `state_code`, `delinquency_bps`, `loan_to_share_pct`, `roaa_bps`, `positive_net_income_pct`. |32| `GET /api/credit-union-segments/{segment_id}` | Single segment: `segment_id`, `segment_name`, `state_code`, `quarterly_capacity`, `risk_tolerance`, `peer_states`, `minimum_checklist`, `portfolio_focus`, `member_profile`, `internal_context`, `notes`, `current_outstanding`. |3334### Loan Fields3536Each loan object: `loan_id`, `borrower_name`, `branch_id`, `sector`, `loan_type`,37`outstanding_balance`, `current_rating`, `payment_status`, `days_past_due`,38`dscr`, `ltv`, `collateral_value`, `fico`, `debt_to_asset`, `liquidity_months`,39`guarantor_strength`, `interest_rate`, `annual_debt_service`, `annual_review_date`, `notes`.4041Fields may be `null`. Treat null fields as unavailable for that loan.4243### Application Fields4445Each application: `application_id`, `applicant_name`, `business_name`, `branch_id`,46`sector`, `loan_type`, `requested_amount`, `dscr`, `ltv`, `collateral_value`,47`fico`, `years_in_business`, `existing_relationship_years`,48`relationship_deposit_balance`, `bankruptcy_months_ago`,49`prior_delinquencies_12m`, `documentation_complete`, `proposed_rate`, `purpose`,50`term_months`, `co_guarantor_strength`, `sba_guaranty_pct`, `total_assets`,51`total_debt`, `annual_revenue`, `net_income`, `dti`, `notes`.5253Fields may be `null`. Treat null fields as unavailable.5455## Policy Rules5657Always fetch `GET /api/policies` first. The response contains the authoritative58rule set for the run. The rules described below are from `credit_policy_v2025Q1`59but the live policy response is canonical.6061### Risk Rating Re-derivation6263The **dominant factor rule**: take the worst (highest integer) numeric rating64from DSCR, LTV (or collateral), and delinquency factors. When a factor is65unavailable (null DSCR, null LTV, or Current payment status), skip it.6667**DSCR thresholds** (from `policies.risk_rating.dscr_thresholds`):6869| DSCR | Rating |70|----------|--------|71| >= 1.50 | 3 |72| >= 1.25 | 4 |73| >= 1.05 | 5 |74| >= 1.00 | 6 |75| < 1.00 | 7 |7677**LTV thresholds** (from `policies.risk_rating.ltv_thresholds`):7879| LTV | Rating |80|---------|--------|81| <= 0.65 | 3 |82| <= 0.75 | 4 |83| <= 0.85 | 5 |84| <= 1.00 | 6 |85| > 1.00 | 7 |8687**Delinquency minimums** (from `policies.risk_rating.delinquency_minimums`):8889| Payment Status | Minimum Rating |90|----------------------|----------------|91| Current | no minimum |92| 30 Days Past Due | 4 |93| 60 Days Past Due | 5 |94| 90+ Days Past Due | 7 |95| Nonaccrual | 8 |9697A material downgrade is a final_rating >= current_rating +98`policies.risk_rating.material_downgrade_notches` (default 2).99100### CDFI Factor Scoring101102Each loan is scored by summing points from four available factors. Null factors103are omitted from the sum.104105From `policies.cdfi_factor_scores`:106107**FICO**: >720:0, 680-720:1, 580-679:3, <580:5108**LTV**: <0.40:0, 0.40-0.60:2, 0.60-0.80:4, >0.80:6109**Debt-to-Asset**: <0.40:0, 0.40-0.60:2, 0.60-0.80:4, >0.80:6110**Liquidity Months**: >12:0, 6-12:1, 3-6:3, <3:5111112Total factor_score = sum of available factor points.113114**Risk class mapping** (from `policies.cdfi_factor_scores.classes`):115116| Score | Class |117|----------|-----------------|118| 0-5 | Prime |119| 6-9 | Desirable |120| 10-13 | Satisfactory |121| 14-18 | Watch |122| >=19 | Doubtful |123| >=19 and ltv > 1.0 | Projected Loss |124125The Projected Loss rule overrides Doubtful when ltv > 1.0.126127### CRE Weighted Scoring128129From `policies.cre_weighted_score`. Weights: capacity 0.45, capital 0.03,130character 0.05, collateral_exposure 0.36, conditions 0.11.131132Compute sub-scores for each dimension using CDFI-style factor scoring on133application data, then apply weighted sum:134135```136weighted_score = capacity_score*0.45 + capital_score*0.03 + character_score*0.05137 + collateral_exposure_score*0.36 + conditions_score*0.11138```139140Map weighted_score to class:141142| Score | Class |143|--------|-----------------|144| <= 2.0 | approve_quality |145| <= 3.0 | conditional |146| > 3.0 | weak |147148### DSCR Stress Formulas149150From `policies.stress`:151152**Watch-list stress (+200bp parallel shock)**:153```154stressed_dscr = dscr / (1 + 0.18)155```156157**CRE dual stress**:158```159stressed_dscr = dscr * 0.85 / (1 + 0.18)160```161162Coverage breach threshold is always **1.0** (from `policies.stress.coverage_breach_threshold`).163164Apply stress only to loans or applications where DSCR is available (not null).165166### Concentration Rules167168From `policies.capacity_concentration`:169170- Sector exposure comes from `/api/branches/{branch_id}/sector-exposures`.171- Each row has `limit_pct` and `current_exposure`.172- Compute concentration ratio: `current_exposure / total_loans_outstanding`173 (use latest-quarter `total_loans_outstanding` from branch metrics).174- Post-approval: add approved amounts to the relevant sector's current_exposure,175 recompute ratio, compare to limit_pct.176- If `grandfathered` is 1, existing over-ceiling exposure may remain, but new177 approvals may not worsen that sector without mitigation.178- When a concentration flag fires, allowed mitigations from the policy are:179 `participation_required`, `reduced_amount`, `board_exception`.180181## Workflow Patterns182183### Pattern A: Rating Migration Review (branch-level)1841851. Fetch: branch details, branch metrics, all branch loans, policies, FDIC benchmark.1862. Filter loans with `current_rating >= target_min` (typically 3).1873. For each targeted loan, re-derive risk rating using the dominant factor rule.1884. Classify migration from each current rating bucket to final rating.1895. Identify material downgrades (final - current >= material_downgrade_notches).1906. Compute NPA benchmark: `nonperforming_loans / total_loans_outstanding` vs191 FDIC `total_loans_noncurrent_pct`. Variance in ratio and bps.1927. Assign watch-list actions to each loan based on final rating:193 - 4: monitor194 - 5-6: watchlist195 - 7: special_assets196 - 8 with Nonaccrual: partial_chargeoff_review197 - 8 without Nonaccrual: legal_referral1988. Select top problem credit: the loan with the worst combination of final199 rating and exposure (typically the highest-rated, highest-exposure loan).200 Report its loan_id, borrower_name, exposure, current_rating, final_rating,201 payment_status, and recommended_action.2029. Produce final_rating_exposure_totals: group by final_rating, sum loan_count203 and exposure. Order by final_rating ascending.20410. Produce migration_from_current_rating_3: for loans that started at rating 3,205 group by final_rating, collect loan_ids.20611. Produce watch_list_action_coverage: count covered loans/exposure, break down207 by action with loan_ids.208209### Pattern B: Lending Allocation (branch-level)2102111. Fetch: branch details, branch metrics, sector exposures, pending applications, policies.2122. For each application, decide approve/conditional_approve/decline/defer/participation_required.2133. Decision logic: Start with the most creditworthy applications. Respect214 capacity. Check sector limits. Apply policy thresholds.2154. Decline reasons (use controlled reason codes):216 - `capacity_limit`: total committed capacity would exceed `lending_capacity_q1`217 - `sector_breach`: sector concentration would exceed its limit_pct218 - `weak_dscr`: DSCR well below policy floor (typically < 1.05 or < 1.0)219 - `high_ltv`: LTV > 0.85 or > 1.0220 - `low_fico`: FICO < 580 or in weakest band221 - `recent_bankruptcy`: bankruptcy within recent history222 - `startup_risk`: years_in_business < 2223 - `underwater_collateral`: LTV > 1.0224 - `policy_floor_missing`: required underwriting data missing (null DSCR, etc.)225 - `documentation_gap`: documentation_complete == 0226 - `fdic_adverse_variance`: branch metric is adverse vs FDIC benchmark227 - `ncua_peer_weakness`: state metrics weaker than peers2285. Conditional approve conditions:229 - `participation_required`: sector concentration flagged230 - `reduced_amount`: cut the approved amount231 - `board_exception`: policy override needed232 - `sba_guaranty_required`: SBA-backed loan with insufficient guaranty233 - `startup_monitoring`: startup requiring oversight234 - `none`: no conditions2356. For approved and conditional apps: `bank_capacity_used` for236 `participation_required` = the bank-retained portion; for `sba_guaranty_required`237 = bank's unguaranteed share. For standard approves, full amount counts.2387. Priority ranking: list approved/conditionally-approved applications in239 priority order (highest first). Priority factors: credit quality, relationship240 depth, strategic fit, concentration impact.2418. Post-approval concentrations: for each sector, add approved amounts,242 recompute ratio, flag if over limit.243244### Pattern C: Credit Union Segment Posture2452461. Fetch: manifest, policies, NCUA benchmarks, segment endpoint.2472. Extract segment state's metrics from NCUA benchmark rows.2483. Compute US comparison: for each metric (delinquency, loan_to_share, roaa,249 positive_net_income), compare state value to US row. Direction: higher/lower/equal.2504. Compute peer median comparison: compute the median of the peer_states values251 for each metric, compare state to peer median.252 - For even number of peers, median = average of middle two values.2535. Determine posture:254 - `continue_approving`: capacity available AND external risk stronger or mixed255 - `continue_with_tighter_conditions`: capacity available BUT external risk weaker256 - `temporarily_pause`: no capacity OR severely adverse external risk2576. Required checklist gates come from `segment.minimum_checklist`.2587. Added operating controls: based on `internal_context.control_issue` and259 external risk posture. Options: `pre_close_insurance_binder_verification`,260 `lien_perfection_prior_to_funding`, `senior_underwriter_second_review`,261 `quarterly_state_benchmark_monitoring`, `monthly_segment_delinquency_watch`,262 `committee_exception_for_capacity_overrun`.2638. Escalation triggers: match conditions to owners.264 - `segment_recent_delinquency_ge_90_bps` → `credit_risk_manager`265 - `missing_insurance_or_lien_exception` → `operations_control_manager`266 - `quarterly_capacity_exceeded_or_exception_requested` → `lending_committee_chair`267 - `state_delinquency_gap_widens_25_bps` → `credit_risk_manager`2689. Interpretation: capacity_status based on quarterly_capacity vs269 current_outstanding, external_risk_status based on benchmark comparisons,270 risk_tolerance from segment, committee_message synthesized from posture and statuses.271272### Pattern D: Watch-List Stress (branch-level, adverse loans)2732741. Fetch: branch details, branch metrics, all branch loans, policies.2752. Filter loans with `current_rating >= adverse_rating_min` (typically 6).2763. For each adverse loan, compute CDFI factor score and assign risk class.2774. For each adverse loan with available DSCR, compute +200bp stress:278 `stressed_dscr = dscr / 1.18`. Flag if stressed_dscr < 1.0.2795. Set monitoring cadence:280 - `monthly` if any Projected Loss or Doubtful loans281 - `quarterly` if all are Watch or better282 - `semiannual` if all are Satisfactory or better2836. Build workout queue sorted by descending exposure, then ascending loan_id:284 - Projected Loss → `partial_chargeoff_review`, projected_loss: true285 - Doubtful → `special_assets`, projected_loss: false286 - Watch → `special_assets` if payment_status is 90+ or Nonaccrual, else `watchlist`287 - Satisfactory → `watchlist`288 - Desirable → `watchlist` if payment_status not Current, else `monitor`289 - Prime → `monitor`290 For each item report: loan_id, exposure, risk_class, payment_status,291 recommended_action, projected_loss.2927. Severe bucket counts: for ratings >= 6, group by (current_rating, payment_status),293 count loans and sum exposure. Order by current_rating ascending, then payment_status.294295### Pattern E: Competing CRE Decision (branch-level, two applications)2962971. Fetch: branch details, branch metrics, all branch loans, sector exposures,298 the two target applications, policies, FDIC benchmark.2992. For each application, compute CRE weighted score. Sub-score dimensions:300 - **capacity** (0.45): score from DSCR and capacity availability at branch level.301 Map DSCR to score: >=1.50→0, >=1.25→2, >=1.05→4, >=1.00→6, <1.00→8.302 - **capital** (0.03): score from borrower capital position. Map303 debt_to_asset using CDFI bands. If null, use net_income/total_assets ratio304 as proxy, or score 3 (midpoint) if unavailable.305 - **character** (0.05): score from FICO (CDFI bands), relationship_years306 (<2→5, 2-5→3, >5→0), prior_delinquencies, guarantor strength307 (strong→0, standard→1, limited→3, none→5).308 - **collateral_exposure** (0.36): score from LTV (CDFI bands) and exposure309 size relative to branch capacity.310 - **conditions** (0.11): score from loan_type (CRE→0, other→2), purpose311 (refinance→0, other→2), documentation_complete (1→0, 0→3).3123. Apply CRE dual stress: `stressed_dscr = dscr * 0.85 / 1.18`.3134. Compute branch CRE concentration:314 - Identify all branch loans that are CRE-type. These span sectors that315 commercially would be considered CRE (Multifamily, Office, Retail CRE,316 Industrial CRE, Hospitality, and any sector whose loan_type is explicitly317 CRE). Sum their outstanding_balance for existing CRE exposure.318 - `existing_cre_concentration` = existing CRE exposure / total_loans_outstanding.319 - `selected_post_approval_cre_concentration` = (existing + selected app amount) / total_loans_outstanding.320 - `selected_policy_variance_bps` = (post_approval_cre_concentration - cre_policy_limit_pct) * 10000.3215. FDIC benchmark comparison: compare branch `delinquency_30_plus_pct` to322 FDIC `total_real_estate_30_89_pct`. Variance in ratio and bps.3236. Decide path for the better-scored application:324 - `approve_quality` → approve, add conditions as needed325 - `conditional` → conditional_approve or participation_required326 - `weak` → decline or defer3277. Unselected disposition: decline or defer with reason codes.3288. Conditions for selected: include `committee_cre_exception` when CRE policy329 limit is breached, `no_additional_cre_without_committee_review` for330 over-limit situations, `bank_retained_exposure_cap` for participation331 scenarios, `minimum_dscr_covenant_1_25` for moderate DSCR,332 `quarterly_financial_reporting` for monitoring, `tenant_roll_and_lease_review`333 for CRE, `updated_appraisal_before_close` when LTV is elevated.334335### Pattern F: Application-Level Decision Logic336337When determining approve/decline for individual applications independently of338the competing workflow, follow this priority:3393401. **Hard declines** (any one is fatal):341 - `documentation_complete == 0` → `documentation_gap`342 - `ltv > 1.0` → `underwater_collateral` (unless SBA guaranteed mitigates)343 - `fico < 580` → `low_fico`344 - `bankruptcy_months_ago` is recent (within 24 months) → `recent_bankruptcy`345 - `years_in_business < 2` → `startup_risk` (unless strong mitigating factors)346 - DSCR available and < 1.0 → `weak_dscr`3472. **Capacity check**: if committed_capacity + requested_amount > lending_capacity_q1 → `capacity_limit` for all remaining, lower-priority apps.3483. **Sector check**: for each application, compute post-approval sector concentration.349 If > sector limit_pct AND sector not grandfathered → `sector_breach`.350 If > sector limit_pct AND grandfathered → can still approve with mitigation.3514. **Policy thresholds**:352 - `ltv > 0.85` → `high_ltv`353 - `dscr < 1.05` → `weak_dscr`3545. **Benchmark comparison**: if branch delinquency materially exceeds FDIC benchmark → `fdic_adverse_variance`.355356## Reason Codes Reference357358| Code | When to use |359|---|---|360| `capacity_limit` | Branch Q1 lending capacity exhausted. |361| `sector_breach` | Post-approval sector concentration exceeds limit_pct. |362| `weak_dscr` | DSCR below policy minimum (typically < 1.05). |363| `high_ltv` | LTV above policy ceiling (typically > 0.85). |364| `low_fico` | FICO score below 580 or in weakest band. |365| `recent_bankruptcy` | Bankruptcy within recent history. |366| `startup_risk` | Business operating under 2 years. |367| `underwater_collateral` | LTV > 1.0. |368| `policy_floor_missing` | Required underwriting data missing (null DSCR, etc.). |369| `documentation_gap` | Incomplete application documentation. |370| `fdic_adverse_variance` | Branch delinquency materially exceeds FDIC benchmark. |371| `ncua_peer_weakness` | State metrics significantly weaker than peers (NCUA). |372373## Decision Enum Reference374375**Decision values**: `approve`, `conditional_approve`, `decline`, `defer`, `participation_required`376377**Condition values**: `participation_required`, `reduced_amount`, `board_exception`, `sba_guaranty_required`, `startup_monitoring`, `none`378379**Action values**: `monitor`, `watchlist`, `special_assets`, `workout`, `partial_chargeoff_review`, `legal_referral`380381**Payment status values**: `Current`, `30 Days Past Due`, `60 Days Past Due`, `90+ Days Past Due`, `Nonaccrual`382383**Posture values**: `continue_approving`, `continue_with_tighter_conditions`, `temporarily_pause`384385**Risk class values**: `Prime`, `Desirable`, `Satisfactory`, `Watch`, `Doubtful`, `Projected Loss`386387**Score class values**: `approve_quality`, `conditional`, `weak`388389## Computation Checklist390391- All currency values: round to 2 decimal places.392- All percentages/ratios: round to 4 decimal places.393- Basis points (bps): round to 2 decimal places.394- List ordering: follow the template's `ordering` directive (ascending by the395 specified field).396- When a field is null and required for computation, exclude that dimension.397- Always use the **latest quarter** from branch metrics (first element in the398 metrics array).399- For FDIC benchmarks, use the `/api/benchmarks/fdic/q4-2024` endpoint unless the manifest or400 branch specifies otherwise.401- For NCUA benchmarks, use the `/api/benchmarks/ncua/q1-2025` endpoint unless the manifest402 specifies otherwise.403- When the branch's `institution_type` is `bank`, use FDIC benchmarks.404- When analyzing a `credit_union_segments` endpoint, use NCUA benchmarks.405- For CRE concentration: sum outstanding_balance for loans where `loan_type` is406 `CRE`, regardless of sector. Also include loans in sectors typically407 classified as CRE even if loan_type differs (based on sector_exposure rows408 with CRE-relevant limit_pct values).409410## Output Rules411412- Always produce valid JSON matching the provided answer template.413- Do not include narrative text outside the JSON.414- Respect all enum choices in the template.415- Sort lists exactly as the template's ordering directive specifies.416- Include all required top-level keys.417- Use null only when the template explicitly allows it.418419## Error Handling420421- If an API endpoint returns an error or empty response, re-request once.422- If a loan or application field is null, treat the factor as unavailable and423 skip it in scoring, but include the loan in population counts.424- If a branch has no loans matching the target criteria, report zero counts and425 empty lists as appropriate.