File size: 1,268 Bytes
c95ced1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import gradio as gr

def audit_regbi(advice_text):
    flags = []
    score = 100
    
    # REG BI / SEC Keywords
    if "fiduciary" not in advice_text.lower():
        flags.append("⚠️ Missing 'Fiduciary' Standard acknowledgement.")
        score -= 20
    if "conflict of interest" not in advice_text.lower() and "disclosure" not in advice_text.lower():
        flags.append("🚨 Critical: No Conflict of Interest Disclosure detected.")
        score -= 40
    if "commission" in advice_text.lower() or "fee" in advice_text.lower():
        if "offset" not in advice_text.lower():
            flags.append("⚠️ Fee structure mentioned without 'Offset' or 'Net' clarification.")
            score -= 15
            
    if score < 60:
        verdict = "FAIL: HIGH REGULATORY RISK"
    else:
        verdict = "PASS: COMPLIANT"
        
    return f"VERDICT: {verdict}\nRISK SCORE: {score}/100\n\nFINDINGS:\n" + "\n".join(flags)

iface = gr.Interface(
    fn=audit_regbi,
    inputs=gr.Textbox(lines=10, placeholder="Paste Investment Advice / Client Email here..."),
    outputs="text",
    title="⚖️ WealthGuard RegBI Auditor",
    description="Audits client communications for SEC Regulation Best Interest (Reg BI) compliance markers."
)
iface.launch()