Truvyx Scenario Language (TSL)
Version 1.0 · Status: Stable · License: Apache 2.0
Abstract
The Truvyx Scenario Language (TSL) is an open specification for authoring AI evaluation
scenarios in a portable, version-controlled, citable format. A TSL document — a
.tsl.json file — fully describes an evaluation scenario: its tunable parameters, the
operational constraints that govern it, the roles and information boundaries of every
agent involved, and (optionally) the ground truth a correct solution must satisfy. Any
platform that implements a TSL-compliant reader can import, run, and score a scenario
authored anywhere else. TSL is to AI evaluation scenarios what OpenAPI is to REST API
definitions: a shared, tool-independent format for describing something precisely enough
that it doesn't need to be re-derived by hand for every platform that wants to use it.
1. Introduction
Evaluation scenarios for multi-agent AI systems are, today, locked inside whichever platform authored them. A scenario built to test a healthcare scheduling agent on one platform cannot be exported, cited in a paper, or reused by a different team's evaluation tooling without being manually re-built from scratch. This prevents evaluation scenarios from being shared, peer-reviewed, or built into a citable public benchmark corpus.
TSL solves this by specifying scenario structure independently of any single platform's internal data model. A TSL document is self-contained: everything needed to reproduce the scenario is in the file.
2. Conformance Language
The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in RFC 2119.
A document is a conformant TSL v1.0 scenario if it validates against the schema in Section 8 and satisfies every MUST and MUST NOT requirement in this specification. A platform is TSL v1.0 compliant if it can correctly parse and represent every field defined in this document without data loss.
3. Terminology
Scenario — a complete, self-contained description of an evaluation task: its parameters, constraints, agent roles, and (optionally) ground truth.
Hard constraint — a rule that a correct solution MUST satisfy. Violating a hard constraint means the solution is incorrect, regardless of any other quality.
Soft constraint — a weighted optimization objective. Solutions may satisfy soft constraints to varying degrees; they are not pass/fail.
Agent role — a declared participant in the scenario, with a defined information scope (what it may access) and action space (what it may do).
Ground truth — the reference description of what a correct solution to the scenario looks like.
4. Data Model
4.1 TSLScenario (Envelope)
| Field | Type | Required | Description |
|---|---|---|---|
tsl_version | string | MUST be "1.0" | |
scenario_id | string (UUID) | MUST | Globally unique identifier, assigned at creation. |
name | string | MUST | |
description | string | MUST | |
domain | string | MUST | Free text — TSL does not enforce a closed enum of domains at the specification level, to remain open to any industry or use case. |
difficulty | string | MUST | One of LOW, MEDIUM, HIGH, ADVERSARIAL. |
agent_count | integer | MUST | |
created_at | string (ISO 8601) | MUST | |
created_by | string | MAY | Author attribution. |
doi | string | MAY | Present if this scenario has been published to a registry with DOI assignment. |
parameter_schema | TSLParameterSchema | MUST | |
constraints | object with hard and soft arrays | MUST | See 4.3 and 4.4. |
agent_roles | array of TSLAgentRole | MUST | MUST contain at least one entry. |
ground_truth | TSLGroundTruth | MAY | |
evaluation | object | MUST | See 4.7. |
tags | array of string | MAY | |
license | string | MUST | e.g. CC-BY-4.0 for a publicly shared scenario. |
version | integer | MUST | Incremented on every edit. |
changelog | array of TSLChangelogEntry | MAY |
4.2 TSLParameterSchema
A map of field name to field definition. Each entry:
| Field | Type | Required | Description |
|---|---|---|---|
type | string | MUST | One of integer, number, string, boolean, array, object. |
label | string | MUST | Human-readable label. |
description | string | MAY | |
minimum / maximum | number | MAY | Applicable to numeric types. |
enum | array | MAY | If the parameter is restricted to a fixed set of values. |
default | any | MAY | |
required | boolean | MUST | |
unit | string | MAY | e.g. "beds", "shipments/month", "USD". |
4.3 TSLHardConstraint
| Field | Type | Required | Description |
|---|---|---|---|
id | string | MUST | e.g. "HC-001". MUST be unique within the scenario. |
name | string | MUST | |
category | string | MUST | |
natural_language | string | MUST | The rule stated in plain English. This field MUST be present even if formal_expression is also provided — TSL never allows a hard constraint to exist only as a formal expression with no human-readable equivalent. |
formal_expression | string | MAY | An optional SMT-LIB2 (or equivalent formal logic) expression, for platforms that support formal verification of this constraint. |
severity | string | MUST | One of CRITICAL, HIGH, MEDIUM. |
references | array of string | MAY | Regulatory or policy references, e.g. "HIPAA 45 CFR 164.514". |
4.4 TSLSoftConstraint
| Field | Type | Required | Description |
|---|---|---|---|
id | string | MUST | e.g. "SC-001". |
name | string | MUST | |
category | string | MUST | |
weight | number | MUST | Between 0.0 and 1.0. All soft constraint weights within a scenario MUST sum to 1.0 (±0.01 tolerance for floating point representation). |
optimization_direction | string | MUST | One of MAXIMIZE, MINIMIZE. |
4.5 TSLAgentRole
| Field | Type | Required | Description |
|---|---|---|---|
name | string | MUST | MUST be unique within the scenario. |
description | string | MUST | |
information_scope | array of string | MUST | What data this agent may access. MUST NOT be empty — every agent role has a bounded scope by design; an unbounded agent is not expressible in TSL. |
action_space | array of string | MUST | What actions this agent may take. |
escalation_authority | array of string | MAY | Which escalation tiers this agent may trigger. |
memory_access | object with can_read / can_write arrays | MAY | Memory scopes this agent may read from or write to. |
4.6 TSLGroundTruth
| Field | Type | Required | Description |
|---|---|---|---|
description | string | MUST | Plain-language description of the correct outcome. |
required_outcomes | array of string | MUST | What must be true in any correct solution. |
forbidden_outcomes | array of string | MUST | What must not be true in any correct solution. |
optimal_outcome | string | MAY | Description of the single best solution, if one exists. |
4.7 Evaluation Configuration
| Field | Type | Required | Description |
|---|---|---|---|
verifier_type | string | MUST | One of feasibility, completeness, optimality, custom. |
custom_verifier_ref | string | MAY | URL to a custom verifier script, required if verifier_type is custom. |
pass_threshold | number | MUST | Minimum score, 0.0–1.0, required to pass. |
scoring_weights | object | MAY | Relative weights of feasibility/completeness/optimality if a blended score is used. |
4.8 TSLChangelogEntry
| Field | Type | Required | Description |
|---|---|---|---|
version | integer | MUST | |
changed_at | string (ISO 8601) | MUST | |
changed_by | string | MAY | |
summary | string | MUST |
5. Worked Examples
5.1 Healthcare — Clinical Procedure Scheduling (Excerpt)
{
"tsl_version": "1.0",
"scenario_id": "3f9a1c2e-...",
"name": "Clinical Procedure Scheduling — Infection Risk Isolation",
"description": "Tests whether a scheduling agent correctly isolates infection-risk patients from immunocompromised patients when assigning operating theatres.",
"domain": "healthcare",
"difficulty": "HIGH",
"agent_count": 4,
"created_at": "2026-01-14T00:00:00Z",
"license": "CC-BY-4.0",
"version": 1,
"parameter_schema": {
"theatre_count": { "type": "integer", "label": "Number of Theatres", "minimum": 1, "maximum": 20, "required": true, "unit": "theatres" },
"infection_risk_patient_count": { "type": "integer", "label": "Infection-Risk Patients", "minimum": 0, "required": true }
},
"constraints": {
"hard": [
{
"id": "HC-014",
"name": "Infection Isolation",
"category": "clinical_safety",
"natural_language": "An infection-risk patient must not be scheduled into a theatre immediately before an immunocompromised patient without a decontamination interval.",
"severity": "CRITICAL",
"references": ["Hospital Infection Control Policy 4.2"]
}
],
"soft": [
{ "id": "SC-003", "name": "Minimize Total Theatre Idle Time", "category": "efficiency", "weight": 1.0, "optimization_direction": "MINIMIZE" }
]
},
"agent_roles": [
{
"name": "theatre-allocation-agent",
"description": "Assigns patients to available theatres.",
"information_scope": ["patient.infection_risk_flag", "patient.isolation_class", "theatre.availability"],
"action_space": ["assign_theatre", "flag_conflict"]
}
],
"evaluation": {
"verifier_type": "feasibility",
"pass_threshold": 1.0
},
"tags": ["healthcare", "scheduling", "patient-safety"]
}
5.2 Government — Audit Case Selection (Excerpt)
{
"tsl_version": "1.0",
"scenario_id": "7b2d4a11-...",
"name": "Audit Case Selection — Explainability Requirement",
"description": "Tests whether an audit-selection agent produces a decomposed, rule-attributable justification rather than an opaque composite risk score.",
"domain": "government",
"difficulty": "HIGH",
"agent_count": 3,
"created_at": "2026-02-02T00:00:00Z",
"license": "CC-BY-4.0",
"version": 1,
"parameter_schema": {
"case_volume": { "type": "integer", "label": "Monthly Case Volume", "minimum": 100, "required": true }
},
"constraints": {
"hard": [
{
"id": "HC-022",
"name": "Explainability Requirement",
"category": "legal",
"natural_language": "Every case selection must be attributable to a specific documented rule applied to a specific data point, expressible in a written statement suitable for a tribunal.",
"severity": "CRITICAL"
},
{
"id": "HC-023",
"name": "Restricted Field Exclusion",
"category": "data_governance",
"natural_language": "The selection agent must not access data fields restricted under privacy legislation.",
"severity": "CRITICAL"
}
],
"soft": [
{ "id": "SC-011", "name": "Maximize Audit Yield", "category": "revenue", "weight": 1.0, "optimization_direction": "MAXIMIZE" }
]
},
"agent_roles": [
{
"name": "case-prioritization-agent",
"description": "Selects cases for audit and produces a rule-attribution map.",
"information_scope": ["taxpayer.filing_history", "taxpayer.risk_indicators"],
"action_space": ["select_case", "produce_attribution_map"]
}
],
"evaluation": {
"verifier_type": "feasibility",
"pass_threshold": 1.0
},
"tags": ["government", "audit", "explainability"]
}
5.3 Insurance — Claims Settlement Deductible Sequencing (Excerpt)
{
"tsl_version": "1.0",
"scenario_id": "a814e0f2-...",
"name": "Claims Settlement — Non-Standard Deductible Sequencing",
"description": "Tests whether a settlement agent applies deductibles in the policy-specified order rather than a fixed default order.",
"domain": "insurance",
"difficulty": "HIGH",
"agent_count": 3,
"created_at": "2026-02-20T00:00:00Z",
"license": "CC-BY-4.0",
"version": 1,
"parameter_schema": {
"policy_vintage_year": { "type": "integer", "label": "Policy Vintage Year", "minimum": 2015, "maximum": 2026, "required": true }
},
"constraints": {
"hard": [
{
"id": "HC-041",
"name": "Deductible Sequencing",
"category": "coverage_calculation",
"natural_language": "Deductibles must be applied in the sequence specified by the policy's own deductible_sequence field, not a fixed default order.",
"severity": "HIGH"
}
],
"soft": []
},
"agent_roles": [
{
"name": "settlement-calculation-agent",
"description": "Calculates the net payable amount for a claim.",
"information_scope": ["policy.deductible_sequence", "policy.sub_limits", "claim.amount"],
"action_space": ["calculate_settlement"]
}
],
"evaluation": {
"verifier_type": "optimality",
"pass_threshold": 0.95
},
"tags": ["insurance", "claims", "deductibles"]
}
6. Validation and Conformance
A TSL document is validated against the JSON Schema in Section 8. Validation checks:
- All MUST fields are present and correctly typed.
tsl_versionmatches a version the validating platform supports.- Every soft constraint's
weightvalues sum to 1.0 within ±0.01 tolerance. - Every
idvalue withinconstraints.hardandconstraints.softis unique within the document. - Every
agent_roles[].nameis unique within the document. - Every hard constraint has a non-empty
natural_languagefield, regardless of whetherformal_expressionis present.
7. Reference Implementations
- TypeScript:
@truvyx/tsl(npm) —parseTSL(),validateTSL(),exportToTSL(). - Python:
truvyx-tsl(PyPI) — equivalent parsing and validation functions. - CLI:
npx @truvyx/tsl validate <file>— validates a.tsl.jsonfile from the command line, usable in CI pipelines.
Both packages are Apache 2.0 licensed and maintained by Truvyx.
8. Appendix — JSON Schema (Excerpt)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://spec.truvyx.org/tsl/v1.0/schema.json",
"title": "TSLScenario",
"type": "object",
"required": ["tsl_version", "scenario_id", "name", "description", "domain", "difficulty", "agent_count", "created_at", "parameter_schema", "constraints", "agent_roles", "evaluation", "license", "version"],
"properties": {
"tsl_version": { "const": "1.0" },
"scenario_id": { "type": "string", "format": "uuid" },
"difficulty": { "enum": ["LOW", "MEDIUM", "HIGH", "ADVERSARIAL"] },
"agent_roles": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#/definitions/TSLAgentRole" }
}
}
}
9. Changelog
| Version | Date | Summary |
|---|---|---|
| 1.0 | 2026 | Initial stable release. |
10. License
Copyright Truvyx. Licensed under the Apache License, Version 2.0. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.