> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kairoconnect.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Diagramas

> Flujo de integración y ciclo de vida de scoring en Kairo Shield

## Flujo de integración típico

```mermaid theme={null}
sequenceDiagram
    participant F as Su fintech
    participant API as Kairo Shield API
    participant W as Su webhook

    F->>API: POST /score (X-API-Key)
    API-->>F: fraud_score, decision, top_features
    API->>W: POST transaction.* (opcional)

    Note over F: Aplica decision (APPROVE / REVIEW / REJECT)

    F->>API: POST /feedback (cuando confirme fraude o legítimo)
    API->>W: POST feedback.received (opcional)
```

## Decisiones de scoring

```mermaid theme={null}
flowchart LR
    A[POST /score] --> B{Reglas}
    B -->|Regla dispara| C[decision_source: RULES]
    B -->|Sin regla| D[Modelo ML]
    D --> E{fraud_score vs umbrales}
    E -->|LOW| F[APPROVE]
    E -->|MEDIUM/HIGH| G[REVIEW]
    E -->|CRITICAL| H[REJECT]
```

## Eventos webhook por transacción

```mermaid theme={null}
flowchart TD
    S[Transacción evaluada] --> B{decision}
    B -->|REJECT| E1[transaction.blocked]
    B -->|REVIEW o HIGH/CRITICAL| E2[transaction.high_risk]
    B -->|APPROVE o LOW/MEDIUM| E3[transaction.scored]
```

Solo se envía **un** evento de transacción por evaluación (el más específico).

## Privacidad de datos

```mermaid theme={null}
flowchart LR
    subgraph Cliente
        PII[PII en su sistema]
        H[SHA-256 local]
    end
    subgraph Kairo_Shield
        API[API scoring]
        ML[Modelo + reglas]
    end
    PII --> H
    H -->|user_token, ip_hash| API
    API --> ML
```

Nunca envíe PII en claro a Kairo Shield.
