Skip to main content

Billing Service — AI Integration

Status: populated Owner: TBD Last updated: 2026-04-17 Companion: Service Template · ai-gateway-service

1. Posture

Billing treats AI as assistive only. No autonomous pricing, automatic write-offs, or AI-posted payments. All AI calls go through ai-gateway-service via Kong /v1/ai/* — no vendor SDK keys in this service. Assistive outputs are drafts; a human approves before a ledger entry is created.

DecisionRationale
No direct LLM integration in billing-serviceCentralised governance, cost control, HITL enforcement, PII redaction handled by ai-gateway
No AI-driven automatic write-offsFinancial integrity; ledger mutations require human authorisation
No AI-driven price suggestionRegulatory exposure (pricing transparency laws); keep price list deterministic
AI used for code assist, denial summarisation, collections toneProven low-risk productivity gains

2. Use cases (Tier A only — assistive drafts)

Use caseTriggerPrompt templateOutputHITLModeration
code_assist.suggest_cptBiller opens an uncoded chargeprompts/billing/cpt_assist.v1.mdTop-N CPT/HCPCS/ICHI candidates with confidence + rationaleBiller must pick a code; no auto-applyTerminology-service membership check server-side
denial.summarise_reason_codesDenial case openedprompts/billing/denial_summary.v1.mdHuman-readable summary of payer reason codes + suggested next actionSupervisor reviews
statement.tone_polishStatement text template authoringprompts/billing/statement_tone.v1.mdPolished RTL-safe collection letter copyTenant admin reviews before publishing templateProfanity + threat filter
ledger.anomaly_narrationOps dashboard click-throughprompts/billing/ledger_narrate.v1.mdPlain-language description of ledger patternOps only; no ledger write

3. Call pattern

4. Redaction + context hygiene

FieldSent to AITransformation
Patient namenostripped
Patient identifiersnostripped
Encounter IDyes (pseudonymised)salted hash
Clinical note excerptyes, ≤ 500 chars, redactednames → [NAME], dates → [DATE]
Amounts / currencyyes (numeric only)
Tenant IDyes (pseudonymised)salted hash for cost attribution
Actor IDno

5. Provenance

Each AI-assisted candidate stored alongside the charge/denial/adjustment carries an ai_provenance blob:

{
"provider": "anthropic",
"model": "claude-haiku-latest",
"promptTemplate": "prompts/billing/cpt_assist.v1",
"promptHash": "sha256:...",
"confidence": 0.83,
"latencyMs": 420,
"requestId": "aig_01J0...",
"acceptedBy": "usr_01J0...",
"acceptedAt": "2026-04-17T10:10:00Z"
}

6. Tenant controls

ControlScopeDefault
AI features on/offtenantoff
Per-use case enablementtenantoff
Redaction aggressivenesstenantaggressive
Daily token budgettenant100 000
Data-residency allowlisttenantrequired

7. Offline degradation

When ai-gateway is unavailable or the tenant is offline:

  • Code-assist UI hides the suggestion panel with banner "Code assist temporarily unavailable; continue coding manually."
  • Denial summariser returns the raw reason code list.
  • No fallback to external vendor from inside billing.

8. Compliance

  • All AI calls are audit-logged (ai.billing.call.v1 via audit-service).
  • No AI output is persisted as authoritative until a human accepts.
  • GDPR: AI calls are classified as processing by a sub-processor; tenant admin consent recorded in tenant-service.
  • No AI is used on refund decisions, adjustment approvals, or payment posting (compliance blast-radius).