> For the complete documentation index, see [llms.txt](https://docs.rubyscore.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rubyscore.io/how-rubyscore-works/ai-scoring.md).

# AI Scoring

AI-driven, anti-Sybil reputation scoring that converts raw on-chain behavior into a **bot-likelihood** signal and **risk tiers** (**Clean / Monitor / High-Risk**). It blends temporal patterns, transaction-graph structure, action diversity, and economic rationality to help gate rewards and access **before** budgets get drained by bots.

***

### How it works (at a glance)

#### 1) Feature engineering from on-chain data

* **Temporal patterns:** activity rhythm, streaks vs. bursts, synchronicity with campaign “waves.”
* **Transaction graph:** connectivity density, cyclic routes, fan-out/fan-in, shared counterparties.
* **Action diversity:** share of unique contracts, depth of sequences (e.g., bridge → deposit → swap → LP → vote).
* **Economic sense:** fee/volume balance, net inflows/outflows, asset retention vs. instant withdrawals.
* **Cross-chain signals:** recurring routes and migrations across networks.

#### 2) Model ensemble

A combination of gradient-boosting and sequence/graph models produces a **Bot Likelihood** score (0–1) plus explanatory flags (e.g., `sync-batch`, `cycle-flow`, `fee-volume-outlier`).

#### 3) Risk tiers & explainability

* **Clean** — low risk
* **Monitor** — medium risk
* **High-Risk** — high bot probability

For integrations, we return a brief explanation of which features pushed the score up/down.

#### 4) Access-rule integration

Use risk tiers **together with** MRS / PoH / Score Level:

* Example rule: **allow access if** `High-Risk = false` **AND** `MRS ≥ 500` **AND** `Level ≥ 6`.
* Tighten thresholds for airdrops; relax them for onboarding flows.

#### 5) Feedback loop

Appeals and manual samples improve quality over time: we tune thresholds per campaign/ecosystem and update features/weights based on outcomes.

***

### Best practices

* **Combine AI risk with reputation metrics** (MRS / PoH / Levels) to reduce false positives/negatives.
* **Set per-campaign thresholds** (stricter for airdrops, softer for onboarding).
* For **Monitor** tier, prefer **soft limits** (reduced caps) over hard bans.

The AI anti-bot layer turns raw transactions into a clear risk signal, enabling informed gating and rewards decisions **before** bots consume your campaign budget.
