---
title: AgentJudgeFactory
seo:
  title: AgentJudgeFactory — TypeScript SDK
  description: >-
    Create and update prompt-based Agent judges on the Judgment platform.
    (TypeScript SDK)
description: Create and update prompt-based Agent judges on the Judgment platform.
---

Access via `client.agentJudges`.

```typescript
const judge = await client.agentJudges.create({
  name: "helpfulness",
  prompt: "Did the assistant answer the user's question?",
  scoreType: "binary",
});

await client.agentJudges.update({
  judgeId: judge.judgeId,
  prompt: "Updated rubric prompt.",
});
```

## create()

Create a new Agent judge (prompt-based scorer).

> **Throws**
>
> If `scoreType` is `"numeric"`.

```typescript
async function create(options: { name, prompt, model?, reasoningLevel?, scoreType, description?, judgeDescription?, categories?, minScore?, maxScore? }): Promise<AgentJudge | null>
```

### Parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `options.name` | `string` | - | Unique judge name within the project. |
| `options.prompt` | `string` | - | Rubric prompt template used by the Agent judge harness. |
| `options.model?` | `string` | - | Ignored: the platform picks the model from reasoningLevel. |
| `options.reasoningLevel?` | `ReasoningLevel` | - | "lite" (server default), "normal", or "high". |
| `options.scoreType` | `ScoreType` | - | "categorical", or "binary" for a categorical judge with Pass / Fail outputs. New judges cannot be "numeric"; existing numeric judges can still be updated. |
| `options.description?` | `string` | - | Description stored on the initial judge version. |
| `options.judgeDescription?` | `string` | - | Description shown in the UI. |
| `options.categories?` | `Category[]` | - | Choice list for categorical judges (at least two). |
| `options.minScore?` | `number` | - | Lower score bound stored on the version. |
| `options.maxScore?` | `number` | - | Upper score bound stored on the version. |

### Returns

`Promise<AgentJudge | null>` - The newly created `AgentJudge`, or `null` if the project is unresolved.

***

## update()

Update an existing Agent judge.

Passing any version field (`prompt`, `reasoningLevel`, `scoreType`,
`description`, `categories`, `minScore`, `maxScore`, or a source/target
version) writes a new production version, copying unspecified fields from
the source version. When `targetMajorVersion` / `targetMinorVersion` are
omitted, the latest version's minor is bumped by 1 — matching the UI's
default "save" behaviour. The score type of a judge cannot change.

```typescript
async function update(options: UpdateOptions): Promise<AgentJudge | null>
```

### Parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `options` | `UpdateOptions` | - | |

### Returns

`Promise<AgentJudge | null>` - The updated `AgentJudge`, or `null` if the project is unresolved.
