> ## Documentation Index
> Fetch the complete documentation index at: https://neuraltrust-92b43583-develop.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Run repeatable AI red teaming and functional evaluations against models, agents, and LLM endpoints with TrustTest.

TrustTest is a testing framework for **AI red teaming** and functional
evaluation. It helps security and engineering teams find unsafe behavior, test
model responses against defined criteria, and record results across repeated
runs.

<img src="https://mintcdn.com/neuraltrust-92b43583-develop/ZjhDoyrIVw7ZHapy/images/static/img/trusttest-product.svg?fit=max&auto=format&n=ZjhDoyrIVw7ZHapy&q=85&s=248583b7e601b16f3164f494f231c630" alt="TrustTest flags a jailbreak attempt in an AI conversation" width="490" height="438" data-path="images/static/img/trusttest-product.svg" />

## AI red teaming with TrustTest

Traditional test frameworks verify application logic and performance.
TrustTest adds the components needed for adversarial testing: targets,
generated or curated test cases, attack techniques, evaluators, and structured
results.

You can point the same workflow at a model, agent, or HTTP endpoint. This keeps
the assessment process consistent when you change providers or move a workload
between environments.

### Run an assessment

The following example runs an assessment against an HTTP endpoint and sends the
results to NeuralTrust:

```python theme={null}
import os
from typing import List

from dotenv import load_dotenv

import trusttest
from trusttest.catalog.red_team import run_red_teaming
from trusttest.language_detection.types import LanguageType
from trusttest.targets.http import HttpTarget, PayloadConfig

load_dotenv(override=True)


target = HttpTarget(
    url="https://your-api.com/chat",
    headers={"Content-Type": "application/json"},
    payload_config=PayloadConfig(format={"message": "{{ test }}"}),
    concatenate_field="response",
)

client = trusttest.client(
    type="neuraltrust",
    token=os.getenv("TARGET_TOKEN"),
    target_id=os.getenv("TARGET_ID"),
)

languages: List[LanguageType] = ["English"]
for language in languages:
    run_red_teaming(target, language=language, client=client)
```

### Coverage and workflow

* Test first-party models and third-party APIs through a consistent target interface.
* Generate test cases automatically or supply your own datasets and prompts.
* Use built-in probes and algorithmic attacks to exercise security and safety controls.
* Evaluate responses across scenarios, edge cases, languages, and model behaviors.
* Track test cases, evaluations, scenarios, and results locally or in NeuralTrust.
* Combine AI red teaming with functional evaluations in the same workflow.

## Why use TrustTest?

TrustTest makes the process repeatable. Instead of treating each assessment as
a separate exercise, teams can keep the target, test generation, evaluation
criteria, and results together.

This approach helps teams:

1. Identify security and safety weaknesses before a model or agent reaches production.
2. Rerun assessments after model, prompt, retrieval, or application changes.
3. Select probes and evaluators that match the risks of a specific workload.
4. Compare results across models, versions, languages, and environments.
5. Retain evidence for investigation, reporting, and remediation.

## Frequently asked questions

### When should I rerun an assessment?

Run another assessment after material changes to the model, system prompt,
tools, retrieval data, or surrounding application. Run assessments regularly
to detect regressions as the system evolves.

### Can results stay in my environment?

Yes. Use `FileSystemClient` to store scenarios, test sets, and results as JSON
under a local path. Use `NeuralTrustClient` when you want to persist those
artifacts in the NeuralTrust platform. See
[Connect to NeuralTrust](/trusttest/connect/client) for both options.

### What systems can TrustTest evaluate?

The Python library supports `HttpTarget` for REST APIs and custom target
implementations for other model interfaces. The web UI currently requires an
LLM exposed through a REST API. Multi-turn probes require a
`ConversationTarget`; `HttpTarget` already provides that interface.

### Does adversarial testing replace functional evaluation?

No. AI red teaming looks for security and safety failure modes, while
functional evaluation checks whether the system meets expected requirements.
TrustTest supports both, so teams can assess each area separately or as part of
the same test plan.
