# Core concepts

> Customers, accounts, keys, score tiers, and the warm-up window.

## Customers and accounts

Vectoral has a two-level model:

* A **customer** is you — the business integrating Vectoral. Resolved from your API key.
* An **account** is one of *your* end-users, identified by the `account_id` you send.
  Everything Vectoral computes is scoped to `(customer, account)`.

`account_id` is the primary join key across scoring, telemetry, and labels — use a
stable identifier (your internal user id), not an email or session.

## Keys

There are two key types, with different trust levels:

| Key | Prefix | Visibility | Used by |
| - | - | - | - |
| **Site key** | `pk_live_` | Public (safe in browser) | The browser sensor → `/v1/sensor/collect` |
| **Secret key** | `vg_live_` | Secret (server only) | Your backend → every other endpoint: `/v1/score`, telemetry, labels, `/v1/identity`, `/v1/sensor/verify`, account context, and the integration/import endpoints |

Secret keys are stored only as a hash; the raw value is shown once at creation.
A missing, invalid, or revoked key returns `401`. Manage both from the dashboard.

## Score tiers

`/v1/score` returns a `score` in `[0, 1]` and a `tier`. The default ("balanced")
banding is:

| Tier | Score | Suggested action |
| - | - | - |
| `low` | `< 0.4` | Allow |
| `medium` | `0.4` – `0.7` | Challenge / step up |
| `high` | `>= 0.7` | Block |

Thresholds are tunable per customer via a sensitivity dial (conservative / balanced /
aggressive).

The response also carries `reasons` — short codes explaining the verdict. Scoring
contributes **up to three**, ordered by impact, and two other layers can add to that
list: a [hard control](#hard-controls) prepends its code, and a
[reputation](#reputation) discount appends `reputation_discount`. So expect up to five
in total, and treat the array as variable-length rather than fixed at three.

## Hard controls

Two things can override the behavioral score outright. When either fires, `/v1/score`
returns `blocked: true`, forces the tier to `high`, and prepends a reason code:

| Reason | Cause |
| - | - |
| `account_blocked` | An operator blocked the account from the dashboard. |
| `spend_cap_exceeded:account` | The per-account spend cap tripped. |
| `spend_cap_exceeded:org` | The org-wide spend cap tripped. |

Highest precedence wins, in that order. These are applied **last**, after scoring,
fusion, and reputation — so they can't be argued down by a good score.

`score` is forced to `1.0` as well, so it no longer reflects the behavioral assessment.
What survives is `reasons`: the block code comes first, followed by the behavioral reason
codes, so you can still see what the account looked like before the block applied.

> [!WARNING]
>
> Branch on `blocked`, not only on `tier`. An account blocked by an operator is a
> decision your own product already made — treating it as merely "high risk" and letting
> a challenge flow through defeats it.

Spend caps are evaluated as post-call telemetry arrives, and `/v1/score` admits against
the cap state as of that moment. Calls already in flight when a cap trips are not
retroactively stopped.

## Reputation

Accounts accrue reputation as they behave well and spend real money, and reputation
**discounts** their fraud score. It is deliberately one-directional: reputation can only
lower a score, never raise one, so it can add false negatives but never false positives.

Two things feed it:

* **Accrued reputation** — built over time from clean, real-value activity, with decay
  so a long-dormant account doesn't coast forever.
* **An instant trust floor** from [account context](https://docs.vectoral.si/api-reference/account-context.md). A
  paid account with a card on file gets the discount immediately, without waiting to
  accrue it.

When a discount applies, `reputation_discount` is appended to `reasons`. Egregious
scores are exempt — no amount of reputation rescues them — and hard controls still
override everything.

## Signal fusion

When you forward a `sensor_token` (or a bare `session_id`) that matches a recent
browser sensor event, Vectoral folds the browser bot-score into the account score and
returns one fused verdict. The response sets `signals_fused: true` and includes
`browser_score` / `browser_decision`. The signed `sensor_token` is the trusted,
unforgeable join; `session_id` is the legacy soft join. See
[Signal fusion](https://docs.vectoral.si/guides/signal-fusion.md).

## Identity signals

Auth and dashboard moments — signup, login, opening the dashboard — are where you see
a user's **real browser IP**, which a server-side LLM call may never carry. Post these
to [`/v1/identity`](https://docs.vectoral.si/api-reference/identity) to attach that IP to the account cheaply
(no scoring). It feeds the network signals on the next
score.

## The warm-up window (shadow mode)

A freshly onboarded customer stays in a **warm-up window** (default 14 days). During
it, `/v1/score` returns the **real** score, tier, and reasons — but with
`shadow_mode: true` and `baseline_ready: false`, signalling the per-account baseline
is still forming.

> [!TIP]
>
> Treat scores as advisory rather than enforcement-grade until `baseline_ready` is
> `true`. The score is always real — the flag just tells you how much history backs it.

## Deep Mode (optional)

Off by default. When enabled per-customer **and** the request includes `prompt_text`
or `prompt_embedding`, Vectoral analyzes prompt content for abuse patterns (reseller
wrappers, scraping templates) and sets `deep_mode_active: true`.
