---
title: "Create Custom Harness"
method: POST
path: "/v1/custom-harnesses/"
tags: ["Diamond", "custom-harnesses"]
---

# Create Custom Harness

`POST /v1/custom-harnesses/`

Create a new custom harness.

Creates a harness in 'draft' status. The harness can be configured with
an agent, personas, and policies before being activated.

Note: Harnesses are immutable once created - they cannot be updated.

Requires agent:write permission.

## Query parameters

- `team_id` string, uuid, nullable — Team ID (required)

## Request body

- CustomHarnessCreate — Request model for creating a custom harness.
  - `id` string, uuid, nullable
  - `name` string, required
  - `description` string, nullable
  - `agent_id` string, uuid, required
  - `persona_ids` string[]
  - `policy_ids` string[]
  - `system_prompt` string, nullable — AUT description or system prompt for harness generation. If not provided, agent description will be used.

## Response `201`

Successful Response

- CustomHarness — Domain model for a custom harness (test configuration). A custom harness is a test configuration that combines an agent, personas, and policies. The backend generates evaluation prompts based on this configuration. Stored as metadata.json in S3.
  - `id` string, uuid, required
  - `team_id` string, uuid, required
  - `name` string, required
  - `description` string, nullable
  - `agent_id` string, uuid, required
  - `persona_ids` string[]
  - `policy_ids` string[]
  - `status` 'draft' | 'active' | 'archived' | 'failed' — Status values for custom harnesses.
  - `workflow_id` string, uuid, nullable — Reference to the latest workflow that generated this harness. Enables lookup of workflow status by harness_id. Supports future 'regenerate harness' scenarios.
  - `s3_key` string, nullable
  - `generated_at` integer, nullable
  - `prompt_count` integer, nullable
  - `created_at` integer, required
  - `updated_at` integer, required
  - `created_by` string, uuid, required
  - `creation_error` string, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/vijilai/apis/vijil-console-api-combined.md) · [All operations](https://skmtc.net/vijilai/apis/vijil-console-api-combined/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vijilai/vijil-console-api-combined/versions/a8b2ee2b2d06/schema)
