Telvine Learn

How to Evaluate Agent Plugins with Telvine

Import synthetic plugin eval cases, run them in your own harness, and record versioned results with Telvine's evaluation API.

Use Telvine to keep plugin eval cases, component inventory, and run results attached to the versions you are testing. Your harness executes the scenarios and judges the outcome; Telvine imports the suite and stores the evaluation evidence.

This walkthrough covers the current publish CLI and evaluation API. Use telvine eval run to execute a native Promptfoo suite locally, or telvine eval import to ingest an existing Promptfoo JSON export. Telvine records evidence and checks release policies; Promptfoo owns execution and grading.

1. Add a synthetic trigger suite

Start with a plugin containing a supported manifest and a Skill:

my-plugin/
  .claude-plugin/plugin.json
  skills/invoice-review/SKILL.md
  evals/invoice-triggers/cases.jsonl
  evals/invoice-triggers/rubric.md
  evals/invoice-triggers/README.md

For a Codex install surface, use .codex-plugin/plugin.json. See the plugin build guide for packaging.

Put each case on a separate line in cases.jsonl:

{"case_key":"positive-overdue","name":"Review overdue invoices","scenario":"Review the synthetic invoice fixture for overdue payments.","expected_outcome":"Invoice-review Skill activates and identifies the overdue invoices.","tags":["positive"],"weight":1}
{"case_key":"negative-definition","name":"Explain invoice terminology","scenario":"Explain what an overdue invoice means without reviewing records.","expected_outcome":"Invoice-review Skill does not activate.","tags":["negative"],"weight":1}
{"case_key":"paraphrase-chasing","name":"Find invoices to chase","scenario":"Which invoices in the synthetic test fixture need chasing?","expected_outcome":"Invoice-review Skill activates and identifies the overdue invoices.","tags":["paraphrase"],"weight":1}

These scenarios are synthetic authored test content. Do not paste production prompts or customer records into the suite. Keep fixture files and full execution evidence in your controlled test environment.

In rubric.md, describe the checks your evaluator should apply: observed activation, expected task outcome, and any permission boundary. The CLI imports a hash of this rubric text; your evaluator must read and apply the local rubric itself.

In README.md, state the release decision rule, such as “all negative cases must pass; review every regression.” The CLI imports this as the suite's promotion-gate description. Configure executable release rules in suite.json. The default pass threshold is 0.8; required cases must be observed and must not be skipped or errored. Required-tag groups and required graders add independent checks. Prose in README.md supplies context and is not executable policy.

2. Inspect and publish

npm i -g @telvine/cli
telvine login
telvine publish ./my-plugin --dry-run
telvine publish ./my-plugin

Confirm the dry run lists the expected Skill and eval suite. Publishing records the component inventory, imports evals/**/cases.jsonl, and prints the imported suite ID. It does not execute the tests or install the plugin into your harness.

3. Execute the cases in your own harness

Install the plugin version into the target test environment. Run each case in a fresh session with fixed model settings and fixtures. Record activation observations and outcome checks locally.

Test both the stable version and the candidate with the same case set. Declare the trial count when creating a run. Each result has a one-based trial; the API preserves one immutable result per case and trial. Regrading uses a new run with parent_run_id, preserving the original record.

For trigger-test design, use the Skill triggering guide or the Claude Code component test matrix.

4. Record the run through the API

Use an authenticated Telvine API client with access to the plugin's organization. Read operations need read access; run and result writes need write access. Keep credentials in the client configuration rather than in case files. Authenticate requests with an Authorization: Bearer TOKEN header. A valid Clerk session can access both operations; API keys must match the requested scope, so use a read key for retrieval and a write key for run/result submission, each scoped to the plugin or its organization.

First request GET /v1/eval-suites/SUITE_ID to retrieve the imported cases and their IDs. Then send POST /v1/eval-suites/SUITE_ID/runs with a body like this, replacing the example versions and model with the values actually tested:

{
  "plugin_version": "0.2.0",
  "baseline_version": "0.1.0",
  "harness": "claude-code",
  "model": "your-tested-model",
  "status": "running",
  "trials": 3
}

Use the returned run ID to send POST /v1/eval-runs/RUN_ID/cases for each result:

{
  "eval_case_id": "IMPORTED_CASE_ID",
  "trial": 1,
  "status": "passed",
  "score": 1,
  "rubric_results": {
    "activation_matched": true,
    "outcome_matched": true
  },
  "duration_ms": 4200
}

Only set passed after applying the case's expected behavior and rubric. For a negative case, staying inactive is the expected result. Supported case statuses are passed, failed, skipped, and errored. Use a skipped result for a check you cannot observe, and do not treat it as proof of correctness.

Keep submitted results metadata-only. Do not place transcripts, outputs, tool arguments, or customer content in rubric_results, feedback, or evidence references. A safe evidence reference can be an opaque identifier for evidence retained in your environment.

Complete the run with POST /v1/eval-runs/RUN_ID/complete:

{"status":"completed"}

Use GET /v1/eval-runs/RUN_ID to inspect the stored results, and GET /v1/plugins/PLUGIN_ID/evals/summary to read the plugin's suite summaries. Run completion seals the evidence. It does not mean every case passed: inspect gateStatus, gateReasons, and coverage. Missing required cases, skipped or errored required trials, failed required assertions, and a pass rate below the threshold block the release check. Missing and skipped trials contribute no passes to the weighted denominator.

5. Review the release evidence

Compare failed cases and trigger groups as well as the aggregate pass rate. Review skipped and errored checks, hold the candidate when required evidence is missing, and make the release decision using the suite's stated rule.

After release, measure plugin usage with skill.* events for Skills and plugin.component.invoked or plugin.component.error for non-Skill behavior. Production invocations and error rates complement the synthetic tests; they do not by themselves prove correct trigger selection.

Frequently asked questions

Can Telvine generate and execute the cases for me?

Promptfoo runs authored tests and grades outputs in your environment. telvine eval run delegates to that installed executable; it does not build an agent harness or generate cases automatically. Keep your custom plugin harness behind a native Promptfoo provider.

Does publishing send fixture files or runtime transcripts?

The eval importer sends the authored scenario and expected outcome, along with case metadata. It does not upload fixture files or runtime transcripts through this import path. Keep scenarios synthetic and result submissions metadata-only.

Can the same workflow support multiple harnesses?

Yes. Create separate runs with the actual harness and model identifiers for each execution. Keep the plugin version and case set consistent when comparing them.

Start with production onboarding or return to the evaluation test matrix.

Run a native Promptfoo suite

Install the current Telvine CLI and a pinned Promptfoo version in your local environment or CI. Model provider credentials stay in the execution environment. The adapter supports Promptfoo v2/v3 JSON exports; validate compatibility when changing your pinned version.

Keep these files in evals/invoice-triggers/:

  • cases.jsonl: synthetic authored scenarios with stable case_key values.
  • promptfooconfig.yaml (or .json): native prompts, providers, and assertions.
  • suite.json: Telvine release policy and optional grader metadata.
  • Local providers, graders, and fixtures: included in the source hash; keep execution exports outside the suite directory.

Every Promptfoo test must carry metadata.telvine_case_key matching a case in cases.jsonl. Use separate keys for parameter-expanded cases. Provider/prompt combinations become separate Telvine runs; repeated results become distinct trials.

prompts:
  - '{{task}}'
providers:
  - file://provider.js
tests:
  - vars:
      task: Review the synthetic invoice fixture.
    metadata:
      telvine_case_key: positive-overdue
    assert:
      - type: javascript
        metric: outcome-check
        value: 'JSON.parse(output).overdueCount === 2'

This example needs your own provider.js, which executes the plugin against controlled fixtures. Assertions should verify resulting state when possible, rather than trusting a completion claim in the response.

{
  "purpose": "regression",
  "pass_threshold": 1,
  "gate_policy": {
    "required_tags": ["negative"],
    "min_trials": 3,
    "require_calibration": false,
    "require_baseline": false
  },
  "graders": [
    {
      "id": "outcome-check",
      "type": "outcome",
      "target": "state",
      "version": "1",
      "required": true
    }
  ]
}

The CLI fills an omitted grader config_hash with the suite source hash. Each required grader must produce a result for every case; name its Promptfoo assertion with the matching metric. Use non-required graders for checks that only apply to some cases.

These eval commands require Telvine CLI 0.1.2 or later. Install the latest release from npm:

npm i -g @telvine/cli

The CLI 0.1.2 release archive is also available directly.

Install and pin Promptfoo separately in your project. --engine-version must match the installed engine; the CLI checks it before execution.

telvine publish ./my-plugin
telvine eval run ./my-plugin --suite invoice-triggers \
  --plugin-id plg_YOUR_PLUGIN --version 0.2.0 \
  --trials 3 --engine-version YOUR_PINNED_PROMPTFOO_VERSION

The CLI invokes promptfoo eval with cache disabled and sharing disabled. Full exports remain in a local temporary directory printed by the command. Telvine receives statuses, numeric scores, durations, costs, hashes, assertion identities, and opaque evidence IDs. It receives no prompts, outputs, variables, tool arguments, error messages, or judge explanations from the export. Unknown result content is never forwarded.

For an existing export:

telvine eval import ./private-results.json --suite-id evs_YOUR_SUITE \
  --source-hash YOUR_REGISTERED_SOURCE_HASH --version 0.2.0 \
  --trials 3 --engine-version YOUR_PINNED_PROMPTFOO_VERSION

Both commands exit nonzero when a release check is blocked. Each provider and prompt combination produces a separate run variant. Release checks require the latest evidence for every observed variant in each current release suite; ensure your native configuration executes every intended variant. In CI, register the suite first with telvine publish; provide TELVINE_READ_TOKEN and TELVINE_WRITE_TOKEN scoped to the plugin, plus TELVINE_API_BASE_URL if using a different API. Interactive login uses the existing session. A single TELVINE_TOKEN can supply a Clerk session for both operations.

Calibrate model graders

Use domain experts to label outputs in your controlled environment. Keep a calibration holdout separate from examples used to tune the judge. Submit only sample IDs, categories, and human/judge verdicts to POST /v1/eval-calibrations, with grader_id, config_hash, rubric_hash, dataset_hash, split: "holdout", and samples. Each sample contains sample_id, human, judge, and optionally category.

The API returns an immutable cal_... report ID and agreement, false-pass, false-fail, and unresolved counts. Set the grader's calibration_ref to that ID and enable gate_policy.require_calibration. Defaults require at least 20 samples, 90% agreement, at most 5% false passes among human-labelled failures, and no unresolved verdicts. Configure these thresholds for the task; these defaults are product policy, not a universal research standard. Include both successes and failures. The report must match the grader ID and configuration hash in the same organization.

Define an explicit grader hash when adding calibration references, so the reference itself does not change the identity of the grader being calibrated. Rubric or judge changes require a new hash and calibration report. Inspect disagreements by category, and test pairwise judges with identities hidden and presentation order reversed.

Compare and release

Use the same suite revision, model, harness, and trial count for baseline and candidate. Enable require_baseline, configure max_regressions, and pass --baseline-run-id to check paired pass-to-fail regressions. Baseline evidence must be completed and cover the required trials. capability suites measure progress; regression and holdout suites contribute to stable-promotion checks.

GET /v1/plugins/PLUGIN_ID/versions/VERSION/release-evidence returns the decision and individual suite checks. PATCH /v1/plugins/PLUGIN_ID/versions/VERSION/status with {"status":"stable"} requires passing evidence for every current regression/holdout suite. A new suite revision invalidates eligibility based on the old revision. Skill stable promotion applies the same rule to Skill-scoped suites.

Stable is a Telvine release status. Distribution and marketplace installation remain in your existing pipeline. Production outcomes, latency, and feedback are review signals; they are not automatically enforced by the eval policy.

Improve safely

Use Promptfoo or your existing optimiser for bounded candidate experiments. Keep suite definitions, graders, gate policies, and release holdouts outside the candidate agent's writable scope. Track candidate and parent run IDs with --parent-run-id and --experiment-id; do not reuse trial IDs or modify sealed evidence. Holdout results should be used for release assessment rather than repeated prompt tuning.

Add regression cases for judge-directed instructions, forged success claims, fixture tampering, forbidden actions, and skipped hard cases. Independently verify final state and permissions. Keep detailed failure evidence local and use failure_cluster and task categories to guide review and new synthetic cases.