> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vijil.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Custom Harness

> 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.



## OpenAPI

````yaml /openapi/api.json post /v1/custom-harnesses/
openapi: 3.1.0
info:
  title: Vijil Console API (Combined)
  description: Combined OpenAPI specification for all vijil-console microservices.
  version: 0.1.0
servers: []
security: []
tags:
  - name: Teams
    description: Authentication, users, and team management
  - name: Agent Environment
    description: Agent, persona, policy, and harness management
  - name: Diamond
    description: Evaluation management and report retrieval
  - name: Dome
    description: Protection, guardrails, and telemetry
  - name: Red Team
    description: Red team campaigns
paths:
  /v1/custom-harnesses/:
    post:
      tags:
        - Diamond
        - custom-harnesses
      summary: Create Custom Harness
      description: |-
        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.
      operationId: create_custom_harness_v1_custom_harnesses__post
      parameters:
        - name: team_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Team ID (required)
            title: Team Id
          description: Team ID (required)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomHarnessCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomHarness'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CustomHarnessCreate:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Id
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        agent_id:
          type: string
          format: uuid
          title: Agent Id
        persona_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Persona Ids
        policy_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Policy Ids
        system_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: System Prompt
          description: >-
            AUT description or system prompt for harness generation. If not
            provided, agent description will be used.
      type: object
      required:
        - name
        - agent_id
      title: CustomHarnessCreate
      description: Request model for creating a custom harness.
    CustomHarness:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        team_id:
          type: string
          format: uuid
          title: Team Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        agent_id:
          type: string
          format: uuid
          title: Agent Id
        persona_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Persona Ids
        policy_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Policy Ids
        status:
          $ref: '#/components/schemas/CustomHarnessStatus'
          default: draft
        workflow_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Workflow Id
          description: >-
            Reference to the latest workflow that generated this harness.
            Enables lookup of workflow status by harness_id. Supports future
            'regenerate harness' scenarios.
        s3_key:
          anyOf:
            - type: string
            - type: 'null'
          title: S3 Key
        generated_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Generated At
        prompt_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Prompt Count
        created_at:
          type: integer
          title: Created At
        updated_at:
          type: integer
          title: Updated At
        created_by:
          type: string
          format: uuid
          title: Created By
        creation_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Creation Error
      type: object
      required:
        - id
        - team_id
        - name
        - agent_id
        - created_at
        - updated_at
        - created_by
      title: CustomHarness
      description: |-
        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.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CustomHarnessStatus:
      type: string
      enum:
        - draft
        - active
        - archived
        - failed
      title: CustomHarnessStatus
      description: Status values for custom harnesses.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````