# Built-in policies and evaluators

> Generated policy names and Python signatures.

[Read in the browser](https://aqvenstudio.com/reference/built-in-policies/)

<!-- Generated by tools/generate_reference.py. Do not edit this file by hand. -->

Use these names with `use:` in a policy or evaluator slot. The accepted `with:` keys follow each Python signature; run `aqven check` to validate the slot and parameters.

None of these fit your check? [How to write a custom evaluator](/engine/custom-evaluator/) covers writing your own with `run:` instead of `use:` — same signature shape as every `evaluator` row below.

## join

| `use` name | Python signature |
| --- | --- |
| `all` | `join_all(state: 'JoinState[T]', params: 'NoParams') -> 'JoinDecision[T]'` |
| `any` | `join_any(state: 'JoinState[T]', params: 'NoParams') -> 'JoinDecision[T]'` |
| `first_success` | `first_success(state: 'JoinState[T]', params: 'NoParams') -> 'JoinDecision[T]'` |
| `quorum` | `quorum(state: 'JoinState[T]', params: 'QuorumParams') -> 'JoinDecision[T]'` |

## stop

| `use` name | Python signature |
| --- | --- |
| `threshold` | `threshold(state: 'LoopState', params: 'ThresholdParams') -> 'StopDecision'` |
| `stagnation` | `stagnation(state: 'LoopState', params: 'StagnationParams') -> 'StopDecision'` |

## select

| `use` name | Python signature |
| --- | --- |
| `last` | `last(state: 'LoopState', params: 'NoParams') -> 'int'` |
| `best` | `best(state: 'LoopState', params: 'BestParams') -> 'int'` |

## on_item_error

| `use` name | Python signature |
| --- | --- |
| `skip` | `skip(item: 'object', error: 'MapItemError', params: 'NoParams') -> 'ItemDecision[JsonValue]'` |
| `fail` | `fail(item: 'object', error: 'MapItemError', params: 'NoParams') -> 'ItemDecision[JsonValue]'` |
| `default` | `default(item: 'object', error: 'MapItemError', params: 'DefaultParams') -> 'ItemDecision[JsonValue]'` |

## evaluator

| `use` name | Python signature |
| --- | --- |
| `not_empty` | `not_empty(value: 'BaseModel', context: 'Context', params: 'FieldParams') -> 'Verdict'` |
| `max_words` | `max_words(value: 'BaseModel', context: 'Context', params: 'MaxWordsParams') -> 'Verdict'` |
| `language` | `language(value: 'BaseModel', context: 'Context', params: 'LanguageParams') -> 'Verdict'` |
| `no_pii` | `no_pii(value: 'BaseModel', context: 'Context', params: 'NoPiiParams') -> 'Verdict'` |
| `regex` | `regex(value: 'BaseModel', context: 'Context', params: 'RegexParams') -> 'Verdict'` |
| `unique_items` | `unique_items(value: 'BaseModel', context: 'Context', params: 'UniqueItemsParams') -> 'Verdict'` |
| `ids_in_allowed_set` | `ids_in_allowed_set(value: 'BaseModel', context: 'Context', params: 'IdsInAllowedSetParams') -> 'Verdict'` |
| `citations_in_sources` | `citations_in_sources(value: 'BaseModel', context: 'Context', params: 'CitationsInSourcesParams') -> 'Verdict'` |
| `expected` | `expected(value: 'BaseModel', context: 'ExpectationContext', params: 'ExpectedParams') -> 'Verdict'` |
| `cost_usd` | `cost_usd(value: 'BaseModel', context: 'Context', params: 'NoParams') -> 'Verdict'` |
| `latency_ms` | `latency_ms(value: 'BaseModel', context: 'Context', params: 'NoParams') -> 'Verdict'` |

## `with` parameter models

## BestParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `path` | `RefPath` | Yes | `—` | — |

[JSON Schema](/reference/schemas/BestParams.json)

## CitationsInSourcesParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `citations` | `RefPath` | Yes | `—` | — |
| `sources` | `RefPath` | Yes | `—` | — |
| `id` | `string` | Yes | `—` | — |
| `quote` | `string` | Yes | `—` | — |
| `text` | `string` | Yes | `—` | — |

[JSON Schema](/reference/schemas/CitationsInSourcesParams.json)

## DefaultParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `value` | `JsonValue` | Yes | `—` | — |

[JSON Schema](/reference/schemas/DefaultParams.json)

## ExpectedParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `fields` | `FieldName[] \| null` | No | `None` | — |

[JSON Schema](/reference/schemas/ExpectedParams.json)

## FieldParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `field` | `RefPath` | Yes | `—` | — |

[JSON Schema](/reference/schemas/FieldParams.json)

## IdsInAllowedSetParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `field` | `RefPath` | Yes | `—` | — |
| `allowed` | `RefPath` | Yes | `—` | — |

[JSON Schema](/reference/schemas/IdsInAllowedSetParams.json)

## LanguageParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `field` | `RefPath` | Yes | `—` | — |
| `locale` | `RefPath` | Yes | `—` | — |

[JSON Schema](/reference/schemas/LanguageParams.json)

## MaxWordsParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `field` | `RefPath` | Yes | `—` | — |
| `max` | `integer` | Yes | `—` | minimum=1 |

[JSON Schema](/reference/schemas/MaxWordsParams.json)

## NoParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |

[JSON Schema](/reference/schemas/NoParams.json)

## NoPiiParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `fields` | `RefPath[]` | Yes | `—` | minItems=1 |
| `detectors` | `('email' \| 'phone' \| 'card_number' \| 'iban' \| 'ip_address')[] \| null` | No | `None` | — |

[JSON Schema](/reference/schemas/NoPiiParams.json)

## QuorumParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `min_ok` | `integer` | Yes | `—` | minimum=1 |
| `on_error` | `'skip' \| 'fail'` | No | `'fail'` | — |

[JSON Schema](/reference/schemas/QuorumParams.json)

## RegexParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `field` | `RefPath` | Yes | `—` | — |
| `pattern` | `string` | Yes | `—` | minLength=1 |

[JSON Schema](/reference/schemas/RegexParams.json)

## StagnationParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `path` | `RefPath` | Yes | `—` | — |
| `window` | `integer` | Yes | `—` | minimum=1, maximum=5 |
| `min_delta` | `number` | Yes | `—` | minimum=0 |

[JSON Schema](/reference/schemas/StagnationParams.json)

## ThresholdParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `path` | `RefPath` | Yes | `—` | — |
| `gte` | `number \| null` | No | `None` | — |
| `lte` | `number \| null` | No | `None` | — |

[JSON Schema](/reference/schemas/ThresholdParams.json)

## UniqueItemsParams

| YAML field | Type | Required | Default | Constraints |
| --- | --- | --- | --- | --- |
| `field` | `RefPath` | Yes | `—` | — |
| `key` | `string` | Yes | `—` | — |

[JSON Schema](/reference/schemas/UniqueItemsParams.json)
