Rules and Alerts

Set up rules to automatically notify you or perform actions when your agent misbehaves in production.

Rules define conditions on evaluation metrics. When conditions are met, rules trigger alerts that can send notifications or execute actions.

Alerts

Overview

Rules monitor metrics including:

Each rule has conditions that determine when to trigger alerts. You can configure alert frequency thresholds and cooldown periods to control when notifications or actions execute.

Rules do not support local Custom Scorers. Upload Custom Scorers to the server before using them in rules. See Online Behavioral Monitoring.


Create a Rule

Create rules from your project's Monitoring section by clicking "Create New Rule".

Create New Rule

Rule Configuration

Rule Basic Information
  • Rule Name: Descriptive name (required)
  • Description: Optional purpose explanation

Filter Conditions

Create New Rule - Filter Conditions

Define when the rule triggers:

  • Match Type: "AND" (all conditions) or "OR" (any condition)
  • Conditions: Add one or more conditions with:
    • Metric: Built-in scorers, Prompt Scorers, Trace Prompt Scorers, hosted Custom Scorers, or static metrics
    • Operator: Comparison (>=, <=, ==, <, >) or success condition (succeeds, fails)
    • Value: Threshold value (comparison operators only)

Success operators (succeeds, fails) apply only to scorers, not static metrics. Success evaluates against scorer success thresholds configured at creation.

You can add multiple conditions with the "Add condition" button.


Actions and Notifications

Configure what executes when alert frequency is met and cooldown has expired:

Rule Actions Configuration

Below are the available actions and notifications:

Add to Dataset

Automatically add traces with failing evaluations to a dataset. Select target dataset from dropdown.

Dataset Configuration for Rules

Email Notifications

Send notifications to specified email addresses.

Email Notification Configuration

Slack Integration

Post alerts to Slack channels. Connect Judgment to Slack via SettingsNotifications → App Integrations, then select channels for each rule.

Slack App Integration Status Slack Settings Configuration

PagerDuty Integration

Create incidents for critical issues. Configure integration keys and severity levels.

PagerDuty Integration Configuration

Advanced Configuration

Set the frequency and cooldown for alerts and actions:

Rule Frequency and Cooldown

Rule Action Frequency

Set minimum alerts within a time window before triggering alerts/actions:

Default: at least 1 alert within 1 second (every matching condition will trigger)

Action Cooldown Period

Set minimum time between consecutive alerts/actions:

Default: 0 seconds (no cooldown)


Managing Rules

Manage rules from the rules page: add, edit, or delete rules as needed.

Rules Dashboard