# Settings (/docs/risk/settings)

Each environment has its own risk settings, in the dashboard (**Risk → Settings**) or through the API.

```ts twoslash
import { Coss } from "coss";
const coss = new Coss();
// ---cut---
await coss.risk.settings.update({
  review_threshold: 0.4,
  block_threshold: 0.9,
  disabled_reasons: ["email.role_account"],
});
```

## Thresholds [#thresholds]

A score at or above `review_threshold` is `review`, at or above `block_threshold` is `block`
(defaults 0.5 and 0.85). Lists and rules decide
before the thresholds. `review_threshold` can't be above `block_threshold`; setting them equal skips
`review`.

## Disabled reasons [#disabled-reasons]

Reasons you list in `disabled_reasons` never fire: they don't appear in assessments or count in the
score. [Rules](/docs/risk/rules) still see the facts behind them. Decision reasons (`list.*`,
`rule.matched`) can't be disabled, and `content.*` reasons are controlled by their thresholds.

## Reason weights [#reason-weights]

Every reason weighs what the [reason catalog](/docs/risk/reasons) says, unless you give it another
weight (0 to 0.99) in `reason_weights`; `null` goes back to the default. Weights are what
[calibration](/docs/risk/calibration) suggests from your feedback, and the dashboard's
**Calibration** page applies them in one click.

```ts twoslash
import { Coss } from "coss";
const coss = new Coss();
// ---cut---
await coss.risk.settings.update({
  reason_weights: { "ip.hosting_provider": 0.1, "checkout.prepaid_card": null },
});
```

## Content thresholds [#content-thresholds]

[Content](/docs/risk/content) scores fire `content.<category>` only at the thresholds you set; a
category without one never fires (rules can still test its score). `null` removes a threshold.

```ts twoslash
import { Coss } from "coss";
const coss = new Coss();
// ---cut---
await coss.risk.settings.update({
  content_thresholds: { phishing: 0.8, malware: 0.8, spam: null },
});
```

## Captcha [#captcha]

Pass the token of your captcha widget with assessments and coss.com verifies it with the provider:
`captcha.failed` when the provider refuses it. Set the provider and your **secret key** first; the
secret is stored encrypted and never returned.

```ts twoslash
import { Coss } from "coss";
const coss = new Coss();
declare const turnstileToken: string;
// ---cut---
await coss.risk.settings.update({
  captcha: { provider: "turnstile", secret: "0x4AAAAAAA…", required: true },
});

const { data } = await coss.risk.assess({
  event: "signup",
  user: { email: "ada@acme.com" },
  captcha: { token: turnstileToken },
});
```

- Providers: Cloudflare Turnstile (`turnstile`) and hCaptcha (`hcaptcha`). coss.com sends them the token,
  your secret and the client's IP address.
- With `required: true`, assessments without a token get `captcha.missing`.
- Tokens are single-use: verify each one once. A retried assessment (same `Idempotency-Key`) returns
  the first result without verifying again.
- If the provider can't be reached, the assessment goes on without the captcha and lists `captcha` in
  `degraded`.
- `captcha: null` turns verification off and deletes the secret.
