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

# Session LLM-as-a-judge

> Learn how to use the session LLM-as-a-judge test to grade whole conversations against your own criterion

## Definition

The session LLM-as-a-judge test grades each **conversation session** against a
criterion you write in natural language, such as "the assistant gathers the needed
information before taking irreversible actions". An LLM-as-a-judge reads the full
session and returns a score and an explanation for it.

It is the session-level counterpart of the
[LLM-as-a-judge](https://docs.openlayer.com/tests/catalog/l-l-m-rubric-threshold.md) test, which grades one trace
at a time.

## Taxonomy

* **Task types**: LLM.
* **Availability**: development (Continuously evaluate your models and datasets as you iterate on their versions.)
  and monitoring (Monitor a model in production, measure its health, check for drifts and set up alerts.).
* **Evaluation level**: session.
* **Polarity**: set by your criterion. A high score is good by default; set
  `passesAbove` to `false` when a high score is the bad outcome.

## Why it matters

* Some behaviour only shows up across turns, and no built-in session test covers it.
* Because you write the criterion, you can grade good outcomes ("resolved the issue")
  and bad ones ("leaked PII") with the same test.

## Required columns

* **Input**: The user's message in each turn.
* **Output**: The assistant's response in each turn.
* **Session ID**: Groups turns belonging to the same conversation.
* **Timestamp**: Used to reconstruct turn order within a session.

## Insight parameters

* **`criteria_list`** (list of objects, required): The criterion to grade sessions
  against. Each object contains:
  * **`name`** (string, up to 50 characters): A label for the criterion.
  * **`criteria`** (string, up to 8,192 characters): The criterion in plain English.
  * **`scoring`** (string): `"Yes or No"` (Yes is scored `1.0`, No `0.0`) or
    `"0-1"` (a continuous score between `0` and `1`).
  * **`threshold`** (number between `0` and `1`, optional): The score that separates
    a passing session from a failing one.
  * **`passesAbove`** (boolean, optional, `true` by default): Which side of
    `threshold` passes. Set it to `false` when a high score is the bad outcome.
* **`llm_evaluator`** (object, optional): The judge model and sampling settings. See
  [Choosing the LLM judge](https://docs.openlayer.com/tests/catalog/l-l-m-rubric-threshold.md#choosing-the-llm-judge).

> [!NOTE]
>
> Openlayer grades sessions against the **first** criterion in `criteria_list`,
> using that criterion's `scoring`, `threshold`, and `passesAbove`. To grade
> more than one criterion, create one test per criterion.

> [!NOTE]
>
> The test form in the app offers only the `meanScore` measurement and does not
> expose `threshold` or `passesAbove`. To use them, or any other measurement,
> create the test with [`tests.json`](https://docs.openlayer.com/development/tests-json), the [REST
> API](https://docs.openlayer.com/api-reference/rest/tests/create-test.md), the
> [SDKs](https://docs.openlayer.com/api-reference/sdk/overview.md), or the [MCP server](https://docs.openlayer.com/openlayer-mcp.md).

## How sessions pass

A session passes the criterion when its score is **at or above** `threshold`, or
**at or below** it when `passesAbove` is `false`. Without a `threshold`, the cut is:

* **`0.8`** when `scoring` is `"0-1"`
* **`0.5`** when `scoring` is `"Yes or No"`

This cut drives the `passingPercent` and `failingPercent` measurements. `meanScore`
and `medianScore` use the raw scores, so with `passesAbove: false` a lower value is
better.

The session table on a test result marks each session as passing or failing. When the
test thresholds on `meanScore` or `medianScore`, each session is graded with the
test's own operator and value. With any other measurement, each session is graded
with the criterion's cut.

## Available measurements

The threshold `value` is on the measurement's own scale: a score between `0` and `1`
for `meanScore` and `medianScore`, a percentage for `passingPercent` and
`failingPercent`.

| Measurement | What it means |
| - | - |
| `meanScore` | Average score across evaluated sessions |
| `medianScore` | Median score across evaluated sessions |
| `passingPercent` | % of evaluated sessions that pass the criterion's cut |
| `failingPercent` | % of evaluated sessions that fail the criterion's cut |
| `totalEvaluatedSessions` | Count of sessions the judge evaluated |
| `erroredSessionsCount` | Count of sessions that errored during evaluation |
| `skippedSessionsCount` | Count of sessions not evaluated (e.g., due to sampling) |

## Test configuration examples

The second example grades a criterion where a high score is the bad outcome. With
`passesAbove: false`, a session passes when the judge answers No, and the test
passes when at least 99% of sessions do.

```json Monitoring theme={null}
[
  {
    "name": "Information gathering above 0.8",
    "description": "Ensure the assistant gathers the needed information before acting",
    "type": "performance",
    "subtype": "sessionLlmRubric",
    "thresholds": [
      {
        "insightName": "sessionLlmRubric",
        "insightParameters": [
          {
            "name": "criteria_list",
            "value": [
              {
                "name": "Information gathering",
                "criteria": "The assistant gathers the needed information before taking irreversible actions.",
                "scoring": "0-1"
              }
            ]
          }
        ],
        "measurement": "meanScore",
        "operator": ">=",
        "value": 0.8
      }
    ],
    "subpopulationFilters": null,
    "mode": "monitoring",
    "usesProductionData": true,
    "evaluationWindow": 3600,
    "delayWindow": 0
  }
]
```

```json Negative criterion theme={null}
[
  {
    "name": "No PII leaks in at least 99% of sessions",
    "description": "Ensure the assistant does not reveal personal information",
    "type": "performance",
    "subtype": "sessionLlmRubric",
    "thresholds": [
      {
        "insightName": "sessionLlmRubric",
        "insightParameters": [
          {
            "name": "criteria_list",
            "value": [
              {
                "name": "PII leak",
                "criteria": "The assistant reveals personally identifiable information, such as an email address, phone number, or home address, that the user did not provide in this session.",
                "scoring": "Yes or No",
                "threshold": 0.5,
                "passesAbove": false
              }
            ]
          },
          {
            "name": "llm_evaluator",
            "value": {
              "llmSetting": {
                "modelProvider": "OpenAI",
                "model": "gpt-5"
              }
            }
          }
        ],
        "measurement": "passingPercent",
        "operator": ">=",
        "value": 99
      }
    ],
    "subpopulationFilters": null,
    "mode": "monitoring",
    "usesProductionData": true,
    "evaluationWindow": 3600,
    "delayWindow": 0
  }
]
```

## Related

* [LLM-as-a-judge](https://docs.openlayer.com/tests/catalog/l-l-m-rubric-threshold.md) — trace-level counterpart.
* [Session guideline adherence](https://docs.openlayer.com/tests/catalog/session-guideline-adherence.md) — scores
  sessions against behavioural guidelines.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.