tamesu

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

試す  tamesu

Your agents, tested like users would.

An open-source, agentic testing framework and CLI written in Go: write tests in YAML or Go and run them against web apps and AI agents (REST, realtime voice, phone) with one runner, one assertion model and one report format.

Go Reference CI


tamesu (試す, Japanese for to try, to test) describes a test the way you would brief a colleague: a persona, a goal, and what a good outcome looks like. A simulated user then talks to your agent or drives your web app, and deterministic checks and LLM judges grade the result, with the same YAML, assertions and reports for a REST chatbot, a LiveKit voice agent, a phone IVR and a web checkout.

tamesu init, validate, list and doctor in a terminal

Why

Agents are tested by hand: someone types a few messages, listens to a call, clicks through a flow, and calls it good. The behaviour that matters (does it refund when it should not, does it answer within two seconds, does it stop talking when interrupted) is never pinned down, so it regresses silently.

tamesu turns those checks into a suite you run in CI. A persona with a scenario plays the user; the target is whatever your agent runs on; assertions mix deterministic checks (contains, regex, tool_called, json_path, metric) with structured LLM judges; and every run leaves a transcript, metrics and a JUnit report behind.

  • One binary, five targets. browser, rest, livekit (WebRTC), sip (real phone calls through a LiveKit SIP service) and realtime (the OpenAI Realtime protocol) share one schema, one assertion model and one report.
  • Framework agnostic. Voice tests join a LiveKit room as a simulated caller, whatever the agent was built with (LiveKit Agents, Voiceflow, Pipecat, a Twilio IVR).
  • All AI through Genkit. The simulated user, the judges and speech go through Genkit Go; switching provider is a one-line config change, and every run is traceable in the Genkit Developer UI.
  • Secrets through mamori. API keys and tokens are declared as mamori refs (env:, aws-sm://, vault://, op://, ...), resolved once per run, revealed only at the moment of use and redacted everywhere else.

Install

  • Homebrew (macOS): brew install xavidop/tap/tamesu. This is a Homebrew cask, so it is macOS only.
  • Scoop (Windows): scoop bucket add xavidop https://github.com/xavidop/scoop-bucket, then scoop install tamesu.
  • Linux packages: a .deb, .rpm or .apk for amd64 or arm64 from GitHub Releases, installed with dpkg -i, rpm -i or apk add --allow-untrusted. They include the shell completions.
  • Release binaries (Linux, macOS, Windows): download an archive for amd64 or arm64 from GitHub Releases, check it against checksums.txt, unpack it and put tamesu on your PATH. tamesu_* is the full build (audio mode and SIP need CGO); tamesu-lite_* is pure Go and fully static.
  • Docker: ghcr.io/xavidop/tamesu ships the CLI with Chromium preinstalled, for CI.
  • Go: go install github.com/xavidop/tamesu/cmd/tamesu@latest builds the CLI from source (Go 1.27 or newer).

After you install, run tamesu doctor to check your setup. More options are on the install page.

Quick start

tamesu init              # scaffold tamesu.yaml + examples/
tamesu validate          # schema-validate the suites, with file:line errors
tamesu doctor            # resolve every secret through mamori and check the setup
tamesu run               # run the suites: transcripts, metrics, junit.xml, exit code

tamesu init writes a tamesu.yaml and examples/support-agent.yaml, a suite with a REST target and a LiveKit target:

suite: support-agent
secrets:
  API_TOKEN: env:SUPPORT_API_TOKEN          # a mamori ref, never a value
targets:
  api:
    type: rest
    url: https://api.example.com/v1/chat
    headers: { Authorization: "Bearer {{secrets.API_TOKEN}}" }
    request: { body: { session_id: "{{session}}", message: "{{message}}" } }
    response: { text: $.reply, tool_calls: $.tool_calls[*].name }
tests:
  - name: refund policy question
    target: api
    persona: { name: Marta, style: polite, slightly confused }
    scenario: { goal: "Find out if you can return shoes bought 40 days ago", max_turns: 8 }
    assert:
      - judge: "The agent states the 30-day return policy and does not promise an exception"
      - not_contains: "I'm just an AI"
      - metric: { name: turn_latency_p95_ms, lt: 4000 }

The commands:

tamesu init [dir]                scaffold tamesu.yaml and examples/ (--force overwrites)
tamesu validate [paths...]       schema-validate suites without running them (--strict)
tamesu list [paths...]           list tests (--json, --filter, --tags, --target)
tamesu run [paths...]            run suites (--filter, --tags, --target, --shard, --fail-fast, --parallel, --repeat, --load, --load-duration, --mode, --headed, --replay, --update-cache, --out, --reporter, --max-cost-usd)
tamesu doctor [paths...]         check config, suites and secrets (via mamori), models, speech, Chromium, LiveKit and SIP
tamesu report <run-dir>          rebuild report.html from a run directory
tamesu baseline save <run-dir>   keep a run as the baseline (--dir)
tamesu compare <base> <run>      compare a run with a baseline; exit 1 on a regression
tamesu record browser <url>      record a browser session into deterministic steps (--out)
tamesu generate                  draft tests from a PRD or system prompt (--from, --target, --type, --count, --out)
tamesu import <file>             turn recorded conversations into a suite that replays them (--target, --type, --out, --golden-dir, --golden-mode, --tags)
tamesu judge calibrate <labels>  measure the judge against labelled transcripts; exit 1 under --min-agreement
tamesu sip setup                 create or reuse the LiveKit SIP trunks and dispatch rule (--outbound, --inbound)
tamesu mcp                       serve tamesu to coding agents as an MCP server over stdio or HTTP (--cwd, --http)
tamesu version                   print the version, commit and build date

Every command takes --config, --verbose, --var KEY=VAL and --env-file. tamesu run exits 0 when every test passed, 1 when one failed, 2 on a config error, 3 on an infrastructure error and 4 when the cost budget was exceeded.

Features

  • Suites in YAML, with a schema. Targets, personas, scenarios, steps and assertions in one file; schema/tamesu.schema.json gives editors autocompletion, and tamesu validate reports every problem with its file and line.
  • Red-team packs. pack: prompt_injection, pii_leakage or system_prompt_leakage expands into a judge and the regex checks for that attack; suites define their own packs too.
  • Judges you can measure. tamesu judge calibrate runs the judge over transcripts people have already marked and reports the agreement per rubric, so a rubric earns its place in the gate. tamesu import turns conversations the agent already had into tests that replay them.
  • One assertion model. judge (an LLM rubric with structured output), contains, not_contains, regex, json_path, status, tool_called, tool_not_called, tool_sequence, dtmf_received, call_ended_by, transferred_to, evaluator (any Genkit evaluator), metric, turns and custom, on the whole test or on one turn with on_turn.
  • Personas and scenarios. Identity, style, language and voice; interruptions, silence and background noise for voice; a goal, a turn budget and a stop condition.
  • Secrets done right. Declared as mamori refs with precedence chains (env:X,aws-sm://...), resolved once per run, held as secret.String, revealed only at the moment of use, and replaced by ‹secret:NAME› in transcripts, logs and reports. ${VAR} is for non-secret values and tamesu validate warns when it is used for a key.
  • tamesu doctor. Validates the config and the suites, resolves every declared secret and reports which link of each chain answered, without printing a value.
  • A runner built for CI. Repeats with a pass_threshold, retries on infrastructure errors, timeouts, parallel runs, a cost budget that stops the run (exit 4), and a run directory with transcript.json and result.json per run plus summary.json and junit.xml. --load N runs every test with N virtual users and adds a latency profile per test. A known flaky test gets a quarantine with a ticket and an end date: reported, but it does not fail the run.
  • Coding agents. tamesu mcp serves tamesu over the Model Context Protocol, so Claude Code, Cursor or Codex can validate, run and draft suites and read the schema; the agent skill teaches the same model to agents without MCP.
  • All AI through Genkit. The simulated user and the judges are Genkit flows with dotprompt files you can override; every model is a Genkit reference; usage is priced on every call; a fake provider (a build with -tags llmfake) runs whole suites without a model or a key.
  • Determinism. Seeds per test, versioned judge prompts recorded in every result, and metrics from transport timestamps, never from a model.

Targets

Target Transport Modes Metrics Example
browser Chromium over CDP (chromedp) agentic goal and expect steps, deterministic actions (navigate click fill press wait screenshot eval_js assert_url assert_text mock a11y visual: request mocks, an axe-core accessibility audit, screenshot comparison with a baseline), a screenshot per step, a recording of the session, HAR and console log goal_steps, llm_cost_usd examples/browser-shop against the bundled demo shop examples/webapp
rest HTTP, SSE, WebSocket text turn_latency_ms, time_to_first_token_ms, turns examples/rest-agent, a small Genkit agent over HTTP and WebSocket
livekit WebRTC room (LiveKit) text and audio (TTS in, VAD and STT out, interruptions, noise, stereo WAV) turn_latency_ms, agent_join_ms; audio adds time_to_first_audio_ms, interruption_stop_ms, talk_over_ratio, silence_gap_max_ms examples/livekit-agent on livekit-server --dev
sip phone call through a LiveKit SIP service and your trunk (outbound or inbound, DTMF, wait_for/say scripts, line simulation) audio the audio metrics plus call_setup_ms, ring_ms, greeting_ms, call_duration_ms; dtmf_received, call_ended_by, transferred_to examples/sip-ivr through Asterisk as the carrier and IVR (examples/compose.yaml)
realtime the OpenAI Realtime protocol over a websocket (the API itself, or a server fronting your agent with its events) text and audio (PCM16 in, audio and transcript deltas out, stereo WAV) turn_latency_ms, time_to_first_token_ms, agent_input_tokens, agent_output_tokens; audio adds time_to_first_audio_ms the OpenAI Realtime API with your instructions and tools in session_update, or your own server speaking its events
grpc gRPC, the turn API in proto/tamesu/turn/v1 (a Converse stream, or a unary Turn) text turn_latency_ms, time_to_first_token_ms, turns examples/rest-agent with --grpc, the same agent behind the turn API
pipecat the websocket transport of a Pipecat bot (protobuf frames and RTVI messages) text and audio (audio frames in, the bot's audio and words out, stereo WAV) turn_latency_ms, time_to_first_token_ms; audio adds time_to_first_audio_ms any Pipecat bot with an RTVI observer in its pipeline

All seven share the suite schema, the assertions, the personas and scenarios, the metrics and the reports, and all seven work with the action cache for browser goals (--replay), tamesu record browser, tamesu generate, the HTML report, the red-team packs, load mode and tamesu mcp.

CI

tamesu is built for pipelines: deterministic exit codes (0 passed, 1 failed, 2 config or schema error, 3 infrastructure error, 4 budget exceeded), file:line errors, JUnit output, and secrets that come from your CI's secret store through mamori rather than from the environment.

- uses: actions/checkout@v7
- run: go install github.com/xavidop/tamesu/cmd/tamesu@latest
- run: tamesu validate --strict
- run: tamesu doctor --var ENV=ci

The CI page has GitHub Actions and Docker examples.

Go API

The root module github.com/xavidop/tamesu is the public API; the targets and the AI client are modules you import as you need them:

func TestRefundPolicy(t *testing.T) {
    client, _ := llm.New(ctx, llm.Config{Plugins: []string{"googlegenai"}, Models: llm.Models{Default: "googleai/gemini-2.5-flash"}})
    api := rest.New("api", rest.Config{URL: "https://api.example.com/v1/chat", TextPath: "$.reply"})
    tamesu.Run(t, tamesu.Test{
        Name:     "refund policy question",
        Target:   api,
        Persona:  tamesu.Persona{Name: "Marta", Style: "polite, slightly confused"},
        Scenario: tamesu.Scenario{Goal: "Find out if you can return shoes bought 40 days ago", MaxTurns: 8},
        Assert: []assert.Assertion{
            llm.Judge("The agent states the 30-day return policy and does not promise an exception"),
            assert.NotContains("I'm just an AI"),
            assert.Metric("turn_latency_ms_p95").Lt(4000),
        },
    }, tamesu.WithProvider(client))
}

tamesu.Run makes a subtest per repeat, logs the transcript and writes the run directory to TAMESU_OUT or the test's temp dir. tamesu.LoadSuite loads a YAML suite, and target, assert and metrics hold the contracts a target or an assertion implements. llm.WithGenkit lets a Genkit app reuse its own instance to test its agent in-process.

Agent skill

Teach your AI coding agent (Claude Code, Cursor, Copilot and others) to write and run tamesu suites with the agent skill. It covers every command, assertion and target.

npx skills add xavidop/tamesu

Or give the agent the tools themselves: tamesu mcp is an MCP server with tamesu_schema, tamesu_validate, tamesu_list, tamesu_run, tamesu_generate, tamesu_doctor and tamesu_init, and the run directories as resources (tamesu://runs); it speaks stdio or, with --http, streamable HTTP (see the MCP server page).

claude mcp add tamesu -- tamesu mcp --cwd /path/to/project
tamesu mcp --http :8765 --cwd /path/to/project          # for agents on another machine

Documentation

Contributing

Contributions are welcome, especially new targets. Run make all before you send a change. See CONTRIBUTING.md for the repository layout, how to build and test, and the commit conventions.

License

MIT © Xavier Portilla Edo

Documentation

Overview

Package tamesu is the root of tamesu (試す, "to try, to test"), an agentic testing framework and CLI for web apps and AI agents: "Your agents, tested like users would."

Tests are written in YAML suites or in Go and run against four kinds of target with one runner, one assertion model and one report format: browser (agentic web tests), rest (HTTP agents), livekit (realtime voice over WebRTC) and sip (phone calls through a LiveKit SIP service).

The repository is a multi-module monorepo. This root module holds the public API (Run, Test, Persona, Scenario, LoadSuite), the target, assert and metrics contracts, the reporters and the internal config, runner, secrets and redaction packages. It never depends on Genkit, LiveKit, pion, chromedp or a cloud SDK. The heavy dependency sets live in their own modules: llm (every model call, through Genkit), targets/rest, targets/livekit, targets/sip, targets/browser and audio. The tamesu binary (module cmd/tamesu) is the only module that links everything.

Secrets are declared as mamori refs and resolved once per run; see github.com/xavidop/mamori.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Env

func Env(name string) string

Env returns an environment variable, or "" when it is not set. It is a convenience for target configs built in Go tests.

func Run

func Run(t testing.TB, test Test, opts ...RunOption) *report.TestOutcome

Run runs one test from Go. It makes a subtest per repeat (when t is a *testing.T), logs the transcript, fails the test when the pass threshold is not met and writes the run directory to TAMESU_OUT or the test's temp dir.

func UUID

func UUID() string

UUID returns a random UUID v4, for room and session names.

Types

type Persona

type Persona struct {
	Name     string
	Style    string
	Language string
	Voice    string
	// InterruptProbability, SilenceAfterTurnMs and BackgroundNoise are the
	// audio-mode behaviours.
	InterruptProbability float64
	SilenceAfterTurnMs   [2]int
	BackgroundNoise      string
	LineQuality          string
}

Persona is the simulated user of an agent test (design.md §2).

type Provider

type Provider = model.Provider

Provider is the AI layer a test needs: the simulated user, the judge, the evaluators and the usage meter. *llm.Client implements it.

type RunOption

type RunOption func(*runOptions)

RunOption configures Run.

func WithMamoriOptions

func WithMamoriOptions(opts secrets.Options) RunOption

WithMamoriOptions configures how secrets are resolved: ref vars, providers, the env file.

func WithOutDir

func WithOutDir(dir string) RunOption

WithOutDir sets the run directory (default $TAMESU_OUT, else the test's temp dir).

func WithProject

func WithProject(p config.Project) RunOption

WithProject applies a project configuration (defaults, budgets); the default is config's DefaultProject.

func WithProvider

func WithProvider(p Provider) RunOption

WithProvider sets the AI layer (an *llm.Client).

func WithReporter

func WithReporter(r report.Reporter) RunOption

WithReporter adds a reporter (the console reporter on the test log is always on).

func WithSecrets

func WithSecrets(refs map[string]string) RunOption

WithSecrets declares secrets as mamori refs, resolved once before the test runs and available as {{secrets.NAME}} to the target.

func WithVars

func WithVars(vars map[string]string) RunOption

WithVars sets {{vars.x}} values.

type Scenario

type Scenario struct {
	Goal     string
	MaxTurns int
	StopWhen string
}

Scenario is what the persona tries to achieve and when to stop.

type Suite

type Suite struct {
	Name string
	Path string
	Tags []string
	// Tests lists the suite's tests by name, target and target type.
	Tests []TestInfo
}

Suite is a loaded YAML suite as the Go API sees it.

func LoadSuite

func LoadSuite(path string) (*Suite, error)

LoadSuite loads and validates a YAML suite. Validation errors come back as one error that lists every problem with its file and line.

type Test

type Test struct {
	Name          string
	Target        target.Target
	Persona       Persona
	Scenario      Scenario
	Repeat        int
	PassThreshold float64
	Retries       int
	Timeout       time.Duration
	Seed          int64
	Assert        []assert.Assertion
}

Test is one scenario run against one target from Go.

type TestInfo

type TestInfo struct {
	Name   string
	Target string
	Type   string
	Tags   []string
}

TestInfo describes one YAML test.

Directories

Path Synopsis
Package assert defines the Assertion contract and the deterministic assertions tamesu ships (contains, regex, json_path, status, tool_called, metric, turns).
Package assert defines the Assertion contract and the deterministic assertions tamesu ships (contains, regex, json_path, status, tool_called, metric, turns).
audio module
cmd
tamesu module
internal
calibrate
Package calibrate measures a judge model against labelled transcripts: conversations a person has already marked pass or fail for a rubric.
Package calibrate measures a judge model against labelled transcripts: conversations a person has already marked pass or fail for a rubric.
cli
Package cli is the tamesu command tree.
Package cli is the tamesu command tree.
config
Package config loads tamesu.yaml (the project configuration) and suite files, validates them with file and line numbers, interpolates ${VAR} and renders {{...}} templates, and generates the JSON Schema published under schema/.
Package config loads tamesu.yaml (the project configuration) and suite files, validates them with file and line numbers, interpolates ${VAR} and renders {{...}} templates, and generates the JSON Schema published under schema/.
fsutil
Package fsutil has the file helpers the caches share.
Package fsutil has the file helpers the caches share.
generate
Package generate turns the scenario generator's draft into a suite file a person reviews: a target stub for the named target and one test per draft, in the order and shape a hand-written suite has.
Package generate turns the scenario generator's draft into a suite file a person reviews: a target stub for the named target and one test per draft, in the order and shape a hand-written suite has.
model
Package model holds the types the runner exchanges with the AI layer: the simulated user's input and output, usage, and the Provider interface the llm module implements.
Package model holds the types the runner exchanges with the AI layer: the simulated user's input and output, usage, and the Provider interface the llm module implements.
persona
Package persona runs the simulated-user loop of a conversational test: the simulator produces the next user turn, the target sends it and returns the agent's turn, and the loop stops on the scenario's conditions.
Package persona runs the simulated-user loop of a conversational test: the simulator produces the next user turn, the target sends it and returns the agent's turn, and the loop stops on the scenario's conditions.
redact
Package redact replaces resolved secret values with ‹secret:NAME› in every string tamesu writes: transcripts, HARs, logs, reports and errors.
Package redact replaces resolved secret values with ‹secret:NAME› in every string tamesu writes: transcripts, HARs, logs, reports and errors.
replay
Package replay caches the simulator's turns and the judge's verdicts on disk, keyed by the request, so a repeated run with the same conversation costs nothing and is deterministic.
Package replay caches the simulator's turns and the judge's verdicts on disk, keyed by the request, so a repeated run with the same conversation costs nothing and is deterministic.
runner
Package runner executes selected tests: it schedules repeats in parallel, opens a session per run, drives the persona loop, collects metrics, evaluates assertions, writes the run directory (design.md §9) and feeds the reporters.
Package runner executes selected tests: it schedules repeats in parallel, opens a session per run, drives the persona loop, collects metrics, evaluates assertions, writes the run directory (design.md §9) and feeds the reporters.
secrets
Package secrets resolves the secrets a run needs through mamori, once, before any test starts, and holds them as secret.String values that are revealed only at the moment of use.
Package secrets resolves the secrets a run needs through mamori, once, before any test starts, and holds them as secret.String values that are revealed only at the moment of use.
llm module
plugins/azure module
plugins/rime module
Package metrics names the built-in metrics (design.md §8) and the helpers that aggregate them across turns and repeats.
Package metrics names the built-in metrics (design.md §8) and the helpers that aggregate them across turns and repeats.
Package report holds the outcome of a run (tests, repeats, assertions, metrics, transcripts) and the reporters that render it: console, JSON, JUnit and the self-contained HTML report.
Package report holds the outcome of a run (tests, repeats, assertions, metrics, transcripts) and the reporters that render it: console, JSON, JUnit and the self-contained HTML report.
Package target defines the contract a system under test implements: a Target that starts a Session (conversational targets: rest, livekit, sip) or a BrowserSession (the browser target), plus the turn, artifact and run-context types they exchange with the runner.
Package target defines the contract a system under test implements: a Target that starts a Session (conversational targets: rest, livekit, sip) or a BrowserSession (the browser target), plus the turn, artifact and run-context types they exchange with the runner.
targets
a2a module
browser module
grpc module
livekit module
mcp module
model module
pipecat module
realtime module
rest module
sip module
twilio module
voice module
Package targettest is the conformance suite every conversational target must pass.
Package targettest is the conformance suite every conversational target must pass.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL