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

# Liability Estimates: AI exposure in dollars

> Liability estimates give each decision a probabilistic dollar exposure, derived from its action risk tier, confidence score, and historical loss rate.

A liability estimate is a forward-looking, probabilistic dollar exposure number attached to a decision record. Where consequence links record what *did* happen — realised revenue, realised cost — liability estimates record what *might* happen if the decision turns out to have been wrong. They are derived, not ingested: the liability engine runs nightly and on-demand after every link creation to keep them current.

<Warning>
  Liability estimates are **probabilistic approximations for informational purposes only**. They do not constitute legal, financial, or actuarial advice. Consult qualified professionals before acting on these numbers.
</Warning>

## How the number is calculated

Four factors multiply into the estimated exposure:

<Steps>
  <Step title="Base risk from the action type">
    Every `action_type` maps to a risk tier via a configurable matrix stored in your organisation settings. The defaults are:

    | `action_type`            | Tier     | Base exposure |
    | ------------------------ | -------- | ------------- |
    | `email_send`             | low      | \$500         |
    | `contract_generation`    | medium   | \$10,000      |
    | `pricing_change`         | medium   | \$10,000      |
    | `claim_denial`           | high     | \$50,000      |
    | `medical_recommendation` | critical | \$200,000     |
    | *(anything else)*        | medium   | \$10,000      |
  </Step>

  <Step title="Confidence adjustment">
    Low-confidence decisions are riskier. A `confidence` value below 0.5 multiplies the base exposure by 2.0×.
  </Step>

  <Step title="Human-in-loop adjustment">
    A decision that was auto-executed without human review multiplies the exposure by 1.5×. Setting `human_in_loop: true` when logging the decision removes this multiplier.
  </Step>

  <Step title="Historical loss rate">
    For this agent and action pair, the fraction of past decisions that resulted in a negative consequence link (cost or liability type). Falls back to 0.5 when fewer than five historical decisions exist for the pair.
  </Step>
</Steps>

The formula:

```
estimated_exposure = base × confidence_adj × hil_adj × max(loss_rate, 0.10)
```

The result is capped at `liability_max_exposure` (default \$10 million) to prevent absurd numbers from a misconfigured matrix. A 90% confidence interval is constructed as `[exposure × 0.5, exposure × 2.0]` (log-symmetric).

## Shape

```json theme={null}
{
  "id": "lia_...",
  "decision_id": "d5e7a3b0-...",
  "estimated_exposure": "7500.00",
  "confidence_interval_low": "3750.00",
  "confidence_interval_high": "15000.00",
  "risk_category": "medium",
  "status": "active",
  "rationale": "action_type=pricing_change; tier=medium; base=$10,000; conf_adj=1.0x; hil_adj=1.5x; loss_rate=50.00%"
}
```

The `rationale` field gives you a human-readable breakdown of every factor that went into the number — useful for explaining an estimate to a colleague or an auditor.

## Reading estimates on the dashboard

The **Liability** tab shows each active estimate alongside its decision record, risk category badge, and confidence interval. Estimates are sortable by exposure amount, agent, and action type. Clicking through to a decision record shows you the full rationale and any consequence links that affected the calculation.

## Fetching aggregate exposure

<CodeGroup>
  ```python Python theme={null}
  # (Via the REST API — no dedicated SDK method yet.)
  import httpx

  r = httpx.get(
      "https://api.precipiq.dev/api/v1/analytics/liability",
      headers={"X-Precipiq-Key": "pq_test_demo_key_REPLACE_ME"},
      timeout=10.0,
  )
  r.raise_for_status()
  agg = r.json()["data"]
  print("total exposure:", agg["total_exposure"], agg["currency"])
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    'https://api.precipiq.dev/api/v1/analytics/liability',
    { headers: { 'X-Precipiq-Key': 'pq_test_demo_key_REPLACE_ME' } },
  );
  const agg = (await res.json()).data;
  console.log('total exposure:', agg.total_exposure, agg.currency);
  ```
</CodeGroup>

## Alert thresholds

The dashboard subscribes to `liability_estimate.updated` events over the WebSocket stream. When an estimate's exposure crosses `liability_alert_threshold` (default \$100,000), a red toast fires:

> *Liability threshold exceeded — ${exposure} • ${risk_category}*

Configure your threshold via **Settings → Liability** in the dashboard.

<Note>
  Lowering your threshold generates more alerts but gives you earlier warning on borderline decisions. Start with the default and tune it down once you have a baseline sense of your organisation's typical exposure distribution.
</Note>
