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

# Get Custom Harness

> Get a single custom harness by ID with optional workflow status.

Returns the harness (business status: DRAFT/ACTIVE/ARCHIVED) enriched with
workflow status (execution state: RUNNING/SUCCEEDED/FAILED) if a workflow exists.

Client interpretation:
- harness.status=DRAFT + no workflow = Not started yet
- harness.status=DRAFT + workflow.status=RUNNING = Generation in progress
- harness.status=DRAFT + workflow.status=FAILED = Generation failed, can retry
- harness.status=ACTIVE = Generation completed successfully

Requires agent:read permission.



## OpenAPI

````yaml /openapi/api.json get /v1/custom-harnesses/{harness_id}
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/{harness_id}:
    get:
      tags:
        - Diamond
        - custom-harnesses
      summary: Get Custom Harness
      description: >-
        Get a single custom harness by ID with optional workflow status.


        Returns the harness (business status: DRAFT/ACTIVE/ARCHIVED) enriched
        with

        workflow status (execution state: RUNNING/SUCCEEDED/FAILED) if a
        workflow exists.


        Client interpretation:

        - harness.status=DRAFT + no workflow = Not started yet

        - harness.status=DRAFT + workflow.status=RUNNING = Generation in
        progress

        - harness.status=DRAFT + workflow.status=FAILED = Generation failed, can
        retry

        - harness.status=ACTIVE = Generation completed successfully


        Requires agent:read permission.
      operationId: get_custom_harness_v1_custom_harnesses__harness_id__get
      parameters:
        - name: harness_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Harness Id
        - 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)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomHarnessResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CustomHarnessResponse:
      properties:
        harness:
          $ref: '#/components/schemas/CustomHarness'
        workflow:
          anyOf:
            - $ref: '#/components/schemas/WorkflowStatusInfo'
            - type: 'null'
      type: object
      required:
        - harness
      title: CustomHarnessResponse
      description: Response model for custom harness with optional workflow status.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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.
    WorkflowStatusInfo:
      properties:
        status:
          $ref: '#/components/schemas/WorkflowStatus'
        phase:
          anyOf:
            - type: string
            - type: 'null'
          title: Phase
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
      type: object
      required:
        - status
      title: WorkflowStatusInfo
      description: |-
        Workflow status information for enrichment.

        For custom harness workflows, task_id and session_id (when present) are
        persisted in the workflow S3 file under workflow_specific_fields and
        exposed here for cancel/debugging.
    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
    CustomHarnessStatus:
      type: string
      enum:
        - draft
        - active
        - archived
        - failed
      title: CustomHarnessStatus
      description: Status values for custom harnesses.
    WorkflowStatus:
      type: string
      enum:
        - created
        - starting
        - running
        - succeeded
        - failed
        - cancelled
      title: WorkflowStatus
      description: >-
        Core lifecycle states for workflows.


        These are universal statuses that apply to all workflow types.

        Workflow-specific phases can be tracked using the optional `phase`
        field.

````