Hanzo
OpenapiRisk

State the decision regime: the appetite, the sample, and whether the model is…

States the decision regime the caller organisation's model decides under: how much of its own stream may be sent for examination, how much of the rest is…

PUT /v1/risk/policy

Addresshttps://api.hanzo.ai/v1/risk/policy
MethodPUT
OperationriskSetPolicy
AuthAuthorization: Bearer $HANZO_API_KEY

States the decision regime the caller organisation's model decides under: how much of its own stream may be sent for examination, how much of the rest is sampled to measure what was missed, and whether the model may change an outcome at all.

The appetite is the decision a model is not permitted to make for itself: its output is a probability, so how likely it is to MISS something is a matter of policy that has to be stated, measured and reviewed rather than absorbed into a constant. The alert threshold is derived from it as a quantile of the scores actually observed, which is what keeps its meaning as the distribution drifts.

It is DURABLE BEFORE IT IS IN FORCE. The regime is recorded as a new version on the organisation's own shelf before anything in memory moves, so a policy that cannot be written down is refused rather than answered from state the next rollout would silently undo.

ARMING IS AN ADMIN ACT AND TUNING IS NOT. Setting live requires an admin of this organisation; stating the appetite and the sample is self-service for any member. Taking the model live decides whether it may change an OUTCOME at all — a payment frozen, a grant refused — for every customer this organisation has, and that is a decision an organisation takes rather than one of its members.

A RESTATEMENT OF THE REGIME IN FORCE MINTS NOTHING and answers the version already in force. Compare the version you receive with the version you had: unchanged means the numbers were the same, which is why there is no flag for it.

Learned state survives the change. The model's identity covers its SHAPE — the inventory and the geometry — and not its appetite, so restating policy unlearns nothing. It also does not REPORT the learned state: what the model is is read from the model.

Request

3 fields, body application/json (required).

FieldInTypeRequiredDescription
livebodybooleanLive turns the model out of shadow. It defaults to FALSE on every call, so going live is always an explicit act and never a side effect of changing a number.
reviewbodynumberReview is the share of the stream that may be sent for examination, in (0, 0.5].
samplebodynumberSample is the share of below-the-line events retained for review, in [0, 1].

Response

StatusBodyMeaning
200riskPolicyOutok

200 body — 12 fields.

FieldInTypeAlwaysDescription
changesbodyintegerChanges is how many DISTINCT regimes may be adopted per Window.
disposedbodyintegerDisposed is how many versions retention has taken.
historybodyriskPolicyVersion[]History is the retained versions, newest first.
history[].atbodystringAt is when it entered force, RFC 3339, from the server clock.
history[].bybodystringBy is the identity that stated it, stamped server-side from the validated principal at the moment it entered force.
history[].livebodybooleanLive is whether the model was permitted to change an outcome under it.
history[].reviewbodynumberReview is the share of the stream the regime states may be examined.
history[].samplebodynumberSample is the share of below-the-line events the regime retains for review.
history[].versionbodyintegerVersion names this regime in this organisation's history.
retainedbodyintegerRetained is how many versions this organisation's history holds at most, derived from the byte budget its rows are a multiple of.
versionbodyintegerVersion is the version in force — the one every score currently cites.
windowbodystringWindow is the period Changes is measured over.

Failure carries the platform error shape — see Errors.

Examples

hanzo risk policy replace

Risk API · All Hanzo APIs · Interactive reference

How is this guide?

On this page