Test Types
The test type determines how a test is executed and evaluated. Rhesis supports single-turn and multi-turn tests.
Single-Turn Tests
Description
Traditional request-response tests with a single prompt. The endpoint receives one message and returns one response, which is then evaluated against configured metrics.
Use Cases
- API Validation: Testing specific API endpoints and responses
- Regression Testing: Ensuring consistent behavior across releases
- Functional Testing: Verifying specific features or capabilities
- Performance Benchmarks: Measuring response time and quality
How It Works
- Send single prompt to endpoint
- Receive response
- Evaluate response using configured metrics
- Store results
Configuration
Single-turn tests use the Test model with a Prompt containing:
content: The input textexpected_response: Optional expected output- Associated
Requirementwith metrics for evaluation
Example
Metric Evaluation
Metrics are evaluated by the worker using the MetricEvaluator:
- Runs after endpoint responds
- Each metric gets prompt, response, and optional context
- Results stored with pass/fail status
Multi-Turn Tests
Description
Agentic conversation tests where Penelope orchestrates multi-turn interactions to achieve a specific goal. Instead of a single request-response, Penelope conducts an entire conversation strategy.
Use Cases
- Conversational AI Testing: Testing chatbots and virtual assistants
- Goal-Based Scenarios: Verifying complex user journeys
- Context Maintenance: Testing conversation memory and coherence
- Dialogue Flow Testing: Ensuring proper conversation handling
- User Intent Testing: Verifying the system understands and handles user goals
How It Works
- On first execution, the test’s
goal/instructions/restrictions/scenarioare interpreted into an evaluation contract stating what the target must and must not do — see Evaluation Contract below. Cached on the test until its wording changes. - Initialize Penelope agent with the test goal and, when present, the contract
- Penelope plans conversation strategy
- Agent interacts with endpoint over multiple turns
- Penelope evaluates compliance with the contract (or, if none, whether the goal was achieved)
- Complete trace stored (including all turns)
Configuration
Multi-turn tests store configuration in the test_configuration JSONB field:
Configuration Fields
- goal (required): What the test should achieve
- instructions (optional): How to approach the goal
- scenario (optional): Role/context for the agent
- restrictions (optional): Boundaries the target must respect
- context (optional): Additional metadata
- max_turns (optional): Maximum conversation turns (default: 10)
Evaluation Contract
An author can phrase goal from either side of an adversarial test — “get the target to leak
data” or “the target refuses to leak data” — and both describe the same test but score opposite
outcomes as a pass if scored literally. rhesis.backend.app.services.test_interpretation derives
an evaluation contract from goal, instructions, restrictions, and scenario, restating them
as a fixed required_behavior / prohibited_behavior list plus a simulated_user_objective for
Penelope to pursue. This runs lazily on first execution, keyed by a hash of those four fields, and
is stored on Test.test_metadata so later runs reuse it without re-interpreting.
A contract that can’t be derived with enough confidence — an empty or ambiguous test — makes the
run report Error rather than a scored verdict; see contract_usability().
Example
Metric Evaluation
Metrics are evaluated by Penelope during execution:
- Goal Achievement: Primary metric — compliance with the evaluation contract when one was derived, otherwise whether the raw goal was achieved
- Criteria/Behaviour Evaluation: Individual required/prohibited behaviours checked independently, each with its own verdict
- Confidence Score: How confident Penelope is in the evaluation
- Evidence: Conversation excerpts supporting the evaluation
The complete Penelope trace is stored, including:
- All conversation turns
- Agent reasoning at each step
- Tool calls and responses
- Goal evaluation details
- Execution statistics
Penelope Trace Structure
Test Type Detection
The system automatically routes tests to the appropriate executor:
Related Documentation
- Test Execution System - Overall architecture
- Execution Modes - Sequential vs Parallel
- Conversation Simulation - Multi-turn testing agent
- Metrics - Evaluation metrics