# Sign-in risk signals

When an environment has a risk policy, every enterprise SSO sign-in gets a risk score from 0 to 100 with the reasons behind it:

| Reason                | Meaning                                                                    |
| --------------------- | -------------------------------------------------------------------------- |
| `impossible_travel`   | This sign-in is too far from the user's last one for the time between them |
| `brute_force`         | Many failed attempts for this user or from this address recently           |
| `new_country`         | The user has not signed in from this country before                        |
| `unrecognized_device` | The user has not signed in from this browser and network before            |

The score and reasons are in the profile (`risk`), in the `sso.sign_in.succeeded` event, on each sign-in in `GET /v1/sign_ins` and `GET /v1/sign_ins/{sign_in}` (`risk`), and on the sign-in timeline in the dashboard. `degraded: true` means the short-lived counters could not be read, so some signals are missing.

Hosted login sign-ins of your own end users are assessed too (unrecognized device, new country, impossible travel). For now this is recorded only, as a `user.sign_in_risk` entry in your audit log: there is no end-user risk policy yet, so it never blocks or steps up a sign-in.

Signals use only keyed digests of the address, device and user, kept for a limited time; no raw address or device data is stored for them.

## Policy

`PUT /v1/sign_in_risk_policy` (scope `policies:write`) sets what to do above a score:

| Field       | Meaning                                                                                                                |
| ----------- | ---------------------------------------------------------------------------------------------------------------------- |
| `min_score` | The score (1 to 100) at which the action applies                                                                       |
| `action`    | `allow`, `step_up` (hand the decision, with the risk, to your pre-profile-issue [sign-in hook](/sso/hooks/)) or `deny` |
| `reasons`   | Optional: apply only when one of these reasons is present                                                              |

A denied sign-in answers [`sign_in_risk_denied`](/errors/sign_in_risk_denied/). Remove the policy with `DELETE /v1/sign_in_risk_policy`; the CLI uses `ohauthcat risk-rules get|set|delete`. Risk policies are a Business and Enterprise feature. For your own decisions, combine the score with a [sign-in hook](/sso/hooks/).
