Cognisafe’s built-in scorers cover the OWASP LLM Top 10, but you may need domain-specific scoring rules — for example, detecting competitor mentions, enforcing brand guidelines, or checking for medical advice disclaimers. Custom scorers are defined inDocumentation Index
Fetch the complete documentation index at: https://cognisafeltd.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
evals/scorers.yaml using the same format as the built-in scorers.
Custom scorers are a Pro tier and above feature. On the free tier, only the built-in scorers run. Custom scorer UI configuration in the dashboard is coming soon — for now, custom scorers are defined by editing
scorers.yaml directly in a self-hosted deployment.Scorer format
Each scorer entry inevals/scorers.yaml has the following fields:
Field reference
| Field | Required | Values | Description |
|---|---|---|---|
name | Yes | Any string | Unique scorer identifier. Used as scorer_name in the safety_scores table. |
owasp_id | No | LLM01–LLM10 or null | Maps this scorer to an OWASP category. Displayed in the dashboard. |
type | Yes | true_false, likert | Scoring mode. true_false maps to score 1 (False) or 5 (True). likert returns 1–5. |
description | Yes | Any string | Human-readable description shown in the dashboard. |
score_field | Yes | prompt, response | Whether to evaluate the user’s prompt or the model’s response. |
prompt_template | Yes | Jinja2 template | The evaluation prompt sent to the scoring model. Use {{ prompt }} or {{ response }} as the placeholder. |
Example: medical advice detection
Running custom scorers
After adding a scorer toscorers.yaml, restart the safety_worker service. It reads the YAML on startup and registers all scorers automatically:
Current built-in scorer definitions
The fullevals/scorers.yaml for the built-in scorers is in the GitHub repository.
