---
title: "How Overlane uses models"
description: "The three-rung ladder (rules, then a decision model, then a generative model), where Cloudflare's Clef decision models are used, what is sent, and why nothing is logged or leaves Cloudflare."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.overlane.app/llms.txt
> Use this file to discover all available pages before exploring further.

# How Overlane uses models

Overlane uses the least model that can do each job, and it records why. Work goes down a ladder of three rungs and stops at the first rung that can do it.

1. **Deterministic rules and parsers.** Secret scans, static rules, diff validation, guardrail rules and usage meters are code. They cost no tokens and give the same answer every time.
2. **A decision model.** When the job is to choose among options we wrote down, Overlane asks a decision model. It does not write text. It returns a probability for each allowed answer, in one pass. Overlane uses Cloudflare's Clef. Its smaller sibling, Clef-flash, was measured on review risk and was not accurate enough, so it is not used there; it is used only where speed matters, for the assistant's intent check.
3. **A generative model.** Only when the output must be new text or code, such as a review comment. This rung is optional and comes last; see [how review works](/review/how-review-works/).

A decision never replaces rung 1. The deterministic result always exists first, and the model can only add a label or change an order.

## Where Clef is used today

| Use | What it does | What it cannot do |
|---|---|---|
| Review risk | Labels each changed file low, medium, high or unsure, moves riskier files earlier in the review, and adds one advisory line to the summary with the pull request's risk. | Suppress or change a deterministic finding, skip a file, approve, merge or label anything. |
| Hostile-content labelling | Adds a flag to fetched documentation and recalled memories when the text looks written to instruct an AI reader. | Clear the deterministic flag, change the data-not-instructions label, or stop the text being returned as data. |
| Failure cause | Labels the cause (code, test, infrastructure or configuration) of a failure that no rule recognises, on the fix task. | Change the fix task's priority. |
| Assistant intent | For an imperative request the assistant's rules did not recognise, picks a page to open, a docs question or a read tool that takes no arguments. | Choose a change, supply an argument or approve anything. |

Every use is **off for every team until a team switches them on**, because they are not yet measured on real code. A team can switch a use on or off, and can make the gate stricter, but never looser than the floor. Reading settings is open to any member; changing them needs the policy permission.

```http
GET /v1/tenants/{tenant}/decision/settings
PUT /v1/tenants/{tenant}/decision/settings/review_risk
{ "enabled": true, "threshold": 0.9 }
```

No decision may authorise a payment, a legal action or a safety-class action. The list of uses is fixed in code, and a use whose name suggests one of those is refused before any call.

## The gate: when an answer is used

Every question we send has an explicit escape option (`none` or `unsure`). A question without one is rejected before anything is sent, because a model forced to pick will pick wrongly.

An answer is used only if both hold:

- the top probability is at least the **threshold**;
- the top probability beats the runner-up by at least the **margin**.

Each use has its own starting gate, set from measurement: 0.85 and 0.5 for hostile-content labelling, failure cause and assistant intent, and 0.6 and 0.2 for review risk, where Clef's probabilities on real diffs are lower but its ordering was reliable.

A yes or no question is used when the probability is at least the threshold (yes) or at most one minus the threshold (no). Anything in between is undecided. If the answer is the escape option, if the gate is not met, or if the call fails, Overlane uses its own deterministic default and records the reason. Thresholds are set per use and tuned from labelled sets before a decision is allowed to change an outcome.

## What is sent

- **Review risk:** for one file at a time, the file path, its status and line counts, the first 8,000 characters of its diff and the first 200 characters of the pull request title.
- **Hostile-content labelling:** the fetched text, up to 20,000 characters. This is only sent when the deterministic scan found nothing, because a deterministic flag already settles the label.
- **Failure cause:** the failure's kind and subject and the last 1,500 characters of its message.
- **Assistant intent:** up to 500 characters of the words you typed, redacted.

Credentials that match a provider or vendor token pattern are replaced with `[redacted]` before any call. No images are sent.

## Where it runs and what is kept

- **Data stays on Cloudflare.** The models run on Workers AI in the same Cloudflare account as the rest of Overlane. No third-party model provider receives the text.
- **Logs are off.** Decisions go through a dedicated AI Gateway, `overlane-decisions`, with log collection turned off and caching skipped, so the gateway does not keep request bodies. They never use the account's default gateway, which logs.
- **Overlane keeps a record, not your text.** For every question it stores the question set and its version, the probability of each answer, the threshold and margin applied, the outcome, any fallback reason, the model, the latency, the input tokens and your team ID. It does not store the code or text that was sent.
- **Metering.** Input tokens are metered as hosted inference like any other model call.

## Current limits

The risk decision has been measured only on a labelled set of synthetic pull requests, where Clef caught every seeded high-risk file but was confident about only a third of the files. Its quality on real code is not known, and a use stays off by default until it has been checked. Until then, treat the risk line as a hint about where to look first, never as a reason to skip reading a change.

Source: https://docs.overlane.app/review/how-overlane-uses-models/index.mdx
