---
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: "Rate the assistant's helpfulness from 0 to 1.",
  model: "gpt-5.2",
  scoreType: "numeric",
});

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

## create()

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

```typescript
async function create(options: { name: string; prompt: string; model: string; scoreType: ScoreType; description?: string; judgeDescription?: string;...): Promise<AgentJudge | null>
```

### Parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `options` | `{ name: string; prompt: string; model: string; scoreType: ScoreType; description?: string; judgeDescription?: string;...` | - | |

### Returns

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

***

## update()

Update an existing Agent Judge.

Passing any of `prompt`, `model`, `categories`, `minScore`, or
`maxScore` writes a new version of the underlying prompt scorer.
When `targetMajorVersion` / `targetMinorVersion` are omitted, the
server auto-bumps the latest version's minor by 1 — matching the
UI's default "save" behaviour.

```typescript
async function update(options: { judgeId: string; prompt?: string; model?: string; scoreType?: ScoreType; description?: string; judgeDescription?: s...): Promise<AgentJudge | null>
```

### Parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `options` | `{ judgeId: string; prompt?: string; model?: string; scoreType?: ScoreType; description?: string; judgeDescription?: s...` | - | |

### Returns

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