Skip to main content

TVL — an AI agent requirements specification language

CI CodeQL Lean proofs License: Apache-2.0 Spec: 1.4

Tuned Variables Language (TVL) is a typed, machine-checkable language for specifying what an AI agent must achieve, what parts of its design may vary, and what evidence is required before a candidate may be accepted.

AI agent requirements are often scattered across prompts, configuration files, evaluation scripts, dashboards, and release checklists. That makes it hard to answer basic questions: Which agent designs are allowed? Which properties are required? Which evaluation set and metrics define success? What evidence supports a release or certification claim?

TVL puts those requirements in one reviewable specification. It describes an agent design space, rather than prescribing the code or optimization algorithm used to build one agent.

A 30-second example

Save this as support-bot.tvl.yml. It declares two allowed agent choices, one rule relating them, one objective, and the promotion policy:

tvl:
  module: example.support_bot
tvl_version: "1.2"

environment:
  snapshot_id: "2026-01-01T00:00:00Z"

evaluation_set:
  dataset: "test://support-bot"

tvars:
  - name: model
    type: enum[str]
    domain: ["small", "large"]
  - name: max_tool_calls
    type: int
    domain:
      range: [0, 5]

constraints:
  structural:
    - when: model = 'small'
      then: max_tool_calls <= 3

objectives:
  - name: resolution_rate
    metric_ref: metrics.resolution_rate.v1
    direction: maximize

promotion_policy:
  dominance: epsilon_pareto
  alpha: 0.05
  min_effect:
    resolution_rate: 0.01

From a clone of this repository (see Quick start to install), check it:

tvl-validate support-bot.tvl.yml   # prints: Schema + lint checks passed.
tvl-lint support-bot.tvl.yml       # prints: Lint checks passed.

The problem TVL solves

A TVL module connects four things that otherwise drift apart:

  1. Agent design space — typed variables for allowed models, prompts, tools, retrieval, routing, memory, orchestration, and other agent choices.
  2. Required properties — structural rules, operating assumptions, objectives, acceptable ranges, and behavioral constraints.
  3. Evaluation contract — the evaluation set and metric identifiers used to produce comparable evidence.
  4. Acceptance policy — the evidence and statistical conditions required to accept or promote a candidate.

This gives developers, evaluators, CI systems, and certification workflows a shared contract for AI agent verification.

What makes TVL different

TVL specifies the set of acceptable agents. It does not specify the construction procedure for a particular agent.

TVL module
  ├── allowed agent choices
  ├── relationships between those choices
  ├── required measured properties
  ├── pinned evaluation context
  └── acceptance and promotion criteria
          ↓
    validators, optimizers, evaluators, CI gates, or certifiers

Any compatible tool may search the declared space. The TVL contract stays stable when the optimizer, model provider, agent framework, or implementation changes.

Verification and certification scope

TVL can be the specification layer for a verifiable certificate. A defensible claim is scoped to:

  • a versioned TVL module;
  • a candidate configuration or implementation binding;
  • a pinned evaluation set and environment context;
  • named evaluator and metric definitions;
  • evidence produced by a governed process; and
  • the acceptance checks that actually ran.

Passing a TVL gate means that the candidate met the declared requirements under that pinned contract and evidence. It does not by itself prove universal safety, correctness, or performance outside that scope. See AI Agent Requirements and Certification.

TVL 1.3: requirements in production

TVL 1.3 (accepted 2026-10-21) is a conservative extension of TVL 1.2: a module without the new blocks means exactly what it meant before. It adds three optional blocks: requirements (what must keep holding once the agent runs, such as "at most 5% of traces take longer than 2 s" or "the agent never calls a forbidden tool"), monitors (which evidence checks a requirement, before release or in production, and with what statistics) and responses (what should happen when a monitor reports a breach, from a notification to a human-approved suspend). A separate tvl_pack document carries organisation floors that modules can only tighten.

TVL states what these declarations mean and what each verdict promises; its tools validate, compose and compile them, and tvl-ci-gate decides promotion monitors from fully resolved evaluation-set counts. Evaluating runtime evidence and carrying out responses is outside the language (RFC 0003 §3.5).

Quick start

Install the Python package and CLI tools from the repository root:

git clone https://github.com/Traigent/tvl.git
cd tvl
python -m pip install -e ".[dev]"

Validate a shipped AI agent specification:

tvl-validate spec/examples/rag-support-bot.tvl.yml
tvl-check-structural spec/examples/rag-support-bot.tvl.yml
tvl-check-operational spec/examples/rag-support-bot.tvl.yml

Language version

The current language version is TVL 1.4. TVL 1.1 added calibrated variables (cvars), operational policies, and the strict promotion_policy.require_calibration mode (RFC 0001); TVL 1.2 added composites (RFC 0002); TVL 1.3 added runtime requirements, monitors and responses (RFC 0003, above); TVL 1.4 added reactive outcome notifications, undecided-run notifications and notification guards (RFC 0004, accepted 2026-10-21, and formal semantics §13). All are conservative extensions: a module that uses none of these constructs (nor TVAR ownership scope, also added in 1.1) is also a valid 1.0 module. The user guides focus on the core constructs; every diagnostic the validators emit, including those for the 1.1 and 1.2 constructs, is listed in the error code catalog. See the changelog for details.

Repository map

  • spec/ — normative grammar, schemas, examples, and promotion contracts
  • docs/ — problem statement, language reference, verification model, and guides
  • formalization/ — formal semantics, with normative and informative sections identified
  • python/ and tvl_tools/ — reference validators, SDK, and CLI tools
  • tests/ and conformance/ — executable validation and compatibility cases
  • vscode-tvl/ and editor_shared/ — editor support
  • website/ — source for tvl-lang.org
  • proofs/ — Lean mechanization for selected results (pre-RFC-0001/0002 core subset; cvars/policies/composites are not yet formalized, see proofs/PROOF_SUMMARY.md's coverage note; the TVL 1.3 language results and TVL 1.4 guard results are listed in its Runtime (TVL 1.3) and RFC 0004 sections)

Start here

  1. AI Agent Requirements and Certification
  2. Getting Started
  3. Language Reference
  4. Semantics and Verification Reference
  5. Agent Evaluation and Promotion Evidence
  6. Requirements, Monitors and Responses (TVL 1.3)
  7. Complete examples

Specification boundary

TVL standardizes what a conforming module means and what a verifier must check. It does not standardize search algorithms, optimizer architecture, scheduling, sample allocation, or internal solver representation. Those mechanisms may be documented by individual implementations without becoming part of the language contract. Likewise, for TVL 1.3 the language defines what a runtime requirement means and what each verdict promises; how an evaluator decides from runtime evidence and how a platform executes responses are not part of the language contract.

License

  • Code, schemas, validators, CLI tools, editor support, tests, executable examples, and the website application are licensed under Apache-2.0 in LICENSE, unless a subdirectory provides its own license file.
  • Authored documentation, formalization notes, and learning content are licensed under CC-BY-4.0 as described in LICENSE-content.

Community

Metadata

Release files for tvl-spec 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tvl-spec 1.4.0
File Size Uploaded Provenance
tvl_spec-1.4.0.tar.gz 363.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tvl-spec 1.4.0
File Interpreter ABI Platform
tvl_spec-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 804.5 kB

Release files / tvl_spec-1.4.0.tar.gz

Download URL tvl_spec-1.4.0.tar.gz
Size 363.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b1ec85e251b51b6ac2990dce0cd32c29574365fc710d332708c38bb2853a523c
BLAKE2b-256 checksum
How to use checksums
566db386462a4c4d2a19ab8e5731a66425bcc065831c1e4435da892f54a999e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / tvl_spec-1.4.0-py3-none-any.whl

Download URL tvl_spec-1.4.0-py3-none-any.whl
Size 441.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
929b0cbed32f88224a4976f7c1a1102702e8c13a91ab082d69ffa08a3f103f7d
BLAKE2b-256 checksum
How to use checksums
36a3815fc576fbb80d6a677703fff221505e64fd689cce97a0415ba1ee057568
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for tvl-spec 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tvl_spec-1.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page