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

# Custom Harnesses

> Create targeted evaluations with custom Harnesses, personas, and policies.

While Vijil has a variety of pre-configured [Harnesses](/concepts/evaluation-components/harness) that you can select from, you can also create your own Harnesses in order to obtain a trust score specific to your organization and agent.

## View Custom Harnesses

You can view previously created custom Harnesses by navigating to [Harnesses](https://evaluate.vijil.ai/harnesses) in the left sidebar.

To view the prompts in a custom Harness, click on its row in the **Harnesses** table.

## Create a Custom Harness

1. In the left sidebar, navigate to [Harnesses](https://evaluate.vijil.ai/harnesses) and click **Create Harness**.
2. Enter a Harness name and a description.

<Tabs>
  <Tab title="Select Prompts">
    1) Select an existing prompt, or create a new one by pressing **Add Prompt**.
    2) Press Create.
  </Tab>

  <Tab title="Generate Prompts">
    1. Specify one more existing [Agents](/manage-agents/integrations/platform). If you do not have an existing Agent, press **Register Agent**.
    2. Specify up to 3 **Personas**.

    <Info>
      Personas define structured user archetypes used to condition evaluations and analyze model behavior across demographic and contextual variations.
    </Info>

    3. Specify one or more Policy Requirements. You can choose existing, or upload your own.

    <Info>
      Specify regulatory or security frameworks to align Evaluations with compliance and policy constraints.
    </Info>

    4. Specify optional dimensionality tests (Reliability, Security, and Safety)
    5. Press Create.
  </Tab>
</Tabs>

## Create a Custom Harness via API

You can programmatically create custom Harnesses using the Vijil client API.

### Policy Document(s)

You can create a custom policy adherence Harness that checks whether your model adheres to its system prompt or an organizational policy. To do this, you need a system prompt specified as a string, and an optional organizational policy provided as a `.txt` or `.pdf` file. If you do not provide a policy file, Vijil will create a Harness based only on the provided system prompt. To specify that you want a policy adherence Harness, you need to specify the `category` argument as `["AGENT_POLICY"]`.

You can use the `harnesses.create` API function to create a Harness to test adherence against frameworks like NIST AI RMF. After creation, you can check the status of the Harness creation job. The `harness_config_version` starts at 1.0.0 for any new Harness name. If you create another Harness with the same name, Vijil automatically increments the Harness version.

Once the Harness is created, you can pass its ID when running an evaluation with the API.

### Knowledge Base (Enterprise Only)

If you are developing a RAG agent and would like to generate a custom test Harness to evaluate generation and retrieval capabilities based on a set of document chunks, upload the documents that you would like to base the evaluation on into a GCP storage bucket. When creating the Harness via the API, set the `category` parameter to `["KNOWLEDGE_BASE"]`.

### Tool Calling Agent (Enterprise Only)

To evaluate a tool calling agent, you need to supply input and output schemas for a function that you want to generate test prompts based on, as well as an endpoint to call that function. To specify that you want a tool calling Harness, set the `category` parameter to `["FUNCTION_ROUTE"]`.

In addition, provide the `function_route` variable which stores the URL required to call the function with the arguments and return the result.

### Custom Harness with Multiple Components

You can also create a Harness that contains multiple components. For example, you can create a Harness that contains a knowledge base component and a tool calling agent component, or any of those components together with a policy adherence component. To do this, specify multiple values in the `category` list when making the API call.

<Card title="Work in Progress" icon="pickaxe" badge="Private preview">
  The programmatic evaluation capabilities are currently in private preview and subject to change.
</Card>

## Next Steps

<CardGroup cols={2}>
  <Card title="Run Evaluations" icon="play" href="/developer-guide/evaluate/running-evaluations">
    Execute custom Harness evaluations
  </Card>

  <Card title="Understand Results" icon="chart-bar" href="/developer-guide/evaluate/understanding-results">
    Analyze custom Harness results
  </Card>

  <Card title="Personas" icon="users" href="/owner-guide/simulate-environment/personas">
    Learn more about personas
  </Card>

  <Card title="Policies" icon="scroll" href="/owner-guide/simulate-environment/policies">
    Learn more about policies
  </Card>
</CardGroup>
