View as Markdown

Identify · Guide

Get traffic rule suggestions

Use traffic rule suggestions to find traffic rules your own recorded traffic argues for. Provenance drafts up to three rules from the last 30 days of decisions, each with the numbers behind it and a traffic backtest. Nothing changes until a person tries the draft in shadow mode and publishes it.

Before you begin: recorded traffic (hosted checks, or middleware and edge reports), and a key with the identify scope. Rule drafts are on the Pro plan and above, with a few drafts during the Free trial; the monthly draft limit per plan is on the pricing page. An owner or admin turns the Traffic rule drafts assist on in Account → AI assists (AI assists).

export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x

Two kinds of draft

Statistics find the groups and count everything; a model picks among them, writes the conditions and action, and names each draft. The pipeline and its checks are the same as for checkout rule suggestions.

KindWhat it findsFloor
Fraud-linkedGroups of visits that went on to an assessment or a store order, where the orders were disputed or flagged200 visits that reached checkout over at least 2 weeks, with at least 10 of them and 5 flagged in the group
Crawler loadGroups that send many requests and never reach checkout, such as a training crawler1,000 requests from the group over at least 2 weeks, none of them reaching checkout

Groups are built from the facts a traffic rule reads: the visitor class, agent category and operator, whether the agent is verified or backed by a person, named signals, bot score bands, the method, the route map's action name, the protocol and the agent platform. Paths, pseudonyms, IPs and user agents are never part of a group.

A draft is marked limited_data until 500 visits reached checkout over the last 30 days. Order outcomes decide which visits count as flagged; report them as in step 1 of the checkout guide.

1. Get drafts

The nightly job drafts for every account with the assist on. To draft now, refresh; it runs once a day, and each draft shown counts toward your monthly limit.

These calls need the assist on

The sandbox has no model provider, so the requests below answer 503 ai_assist_unconfigured there. The response shown comes from a test provider.
curl -s -X POST $PROVENANCE_API/v1/identify/policies/rule_suggestions/refresh \
  -H "Authorization: Bearer $PROVENANCE_KEY"
{
  "object": "rule_suggestion_refresh",
  "domain": "traffic",
  "result": "drafted",
  "created": 1,
  "open": [
    {
      "object": "identify_rule_suggestion",
      "id": "prs_01M81AY7GNSD12T411C88A76PR",
      "domain": "traffic",
      "status": "open",
      "label": "Rate limit declared bots",
      "rule": {
        "id": "draft-94932507be",
        "label": "Rate limit declared bots",
        "when": [{ "fact": "agent.class", "op": "eq", "value": "declared_bot" }],
        "then": { "action": "rate_limit", "per": "agent", "window_seconds": 60, "max": 60 }
      },
      "action": "rate_limit",
      "description": "If class eq declared_bot, then rate limit",
      "explanation": "This group sent 1200 requests and none reached checkout.",
      "explanation_source": "model",
      "explanation_label": "Written by a model from these numbers. The numbers and the backtest are the source of truth.",
      "evidence": {
        "kind": "crawler_load",
        "requests": 1200,
        "share": 0.8,
        "reached_checkout": 0,
        "flagged": 0,
        "rate": 0,
        "baseline_rate": 0,
        "total_requests": 1500,
        "window_from": "2026-10-23T09:56:00.632Z",
        "window_to": "2026-11-22T09:56:00.632Z"
      },
      "backtest": {
        "object": "policy_backtest",
        "days": 30,
        "requests": 1500,
        "totals": { "allowed": 300, "challenged": 0, "rejected": 0 },
        "traffic": {
          "actions": { "allow": 300, "log_only": 0, "rate_limit": 1200, "challenge": 0, "require_intent": 0, "block": 0 },
          "changed": { "allow→rate_limit": 1200 },
          "reached_checkout": { "stopped": 0, "visits": 0, "flagged": 0 }
        }
      },
      "limited_data": true,
      "policy_version": null,
      "shadow_version": null,
      "published_version": null,
      "dismissed_until": null,
      "created_at": "2026-11-22T09:56:00.632Z",
      "updated_at": "2026-11-22T09:56:00.632Z"
    }
  ]
}

result takes the same values as for checkout drafts (what each means). List every suggestion with GET /v1/identify/policies/rule_suggestions (filter with ?status=), or read one with GET /v1/identify/policies/rule_suggestions/{id}.

2. Read a draft

FieldWhat it says
evidence.kindfraud_linked or crawler_load.
evidence.requests, shareRequests the rule matches in the window, and their share of all requests.
evidence.reached_checkout, flagged, rateVisits in the group that reached checkout, how many of their orders were disputed or flagged, and that rate against your overall rate (baseline_rate).
backtest.trafficYour live rules plus this one, replayed: each action's count, the decisions that would change, and reached_checkout for the visits it would stop.

A draft may propose any traffic action except allow: challenge, require an intent, rate limit, log or block. Checks drop a draft that would:

Dropped whenWhy
It challenges or blocks visits that placed more unflagged orders than flagged onesIt would stop more customers than fraud
It is fraud-linked and its backtest stops no flagged orderIts evidence doesn't hold over the replay
It challenges, requires an intent or blocks more than the deployment's share limit of requestsIt would change too much traffic at once

A blocked visitor can't show you what they would have done next, so shadow mode can't tell you how many customers a block rule would lose. A draft that blocks carries warning saying so.

3. Try it in shadow mode, then publish

POST /v1/identify/policies/rule_suggestions/{id}/shadow creates a draft version (your live traffic rules plus this one) and runs it in shadow; the suggestion's shadow_version names it. Read the shadow report, then publish with POST /v1/identify/policies/versions/{version}/publish, which sends identify.policy.published and moves the suggestion to published. To change the draft first, open it from its suggestion card under Rules → Traffic in the console.

POST /v1/identify/policies/rule_suggestions/{id}/dismiss hides a draft for 90 days. When a draft is created, identify.rule_suggestion.created is sent to your webhook endpoints.

Errors you might see

SymptomCauseFix
503 ai_assist_unconfiguredThis deployment has no model providerNothing to fix on your side; backtests still work.
403 ai_assist_offThe traffic assist is off for your accountAn owner or admin turns it on in Account → AI assists.
402 plan_requiredRule drafts are on the Pro plan and above, and your Free trial has endedChoose a plan in Settings → Plan & usage.
429 rate_limit_exceededA refresh already ran todayWait for Retry-After; the nightly job still runs.

See also