Skip to content
DataDogPublic

About

A tool to run developer experience focused experiments around your AI harness

Topics

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

airedale

Config-driven evaluation harness for agentic LLM runs, reporting to Datadog LLM Observability Experiments.

License: Apache 2.0

airedale runs an evaluation matrix of model × scenario × task through provider-native agentic SDKs, exposes MCP servers and Agent Skills to the model, and reports every run to Datadog LLM Observability Experiments.


What it does

Given two TOML files the harness:

  1. Builds the matrix — every combination of model × scenario × task, optionally filtered by --model, --scenario, and --task flags.
  2. Runs each cell with a provider-native agentic SDK: Anthropic models use claude-agent-sdk (Claude Code); OpenAI models use openai-codex. A scenario with harness = "pi" runs its models through the pi coding agent instead. MCP servers and skills are passed natively — no custom tool-calling loop.
  3. Scores each run with a per-criterion LLM-as-judge (RubricEvaluator). Each criterion is an independent judge call; the final score is the mean across criteria.
  4. Reports to LLMObs — one async_experiment per cell, with the run's token usage, tool calls, judge scores, and gateway metadata.

Provider-native execution

Provider Engine LLMObs spans
anthropic claude-agent-sdk Native integration (ddtrace owns spans)
openai openai-codex Decorator spans (@agent / @llm)

Pi harness

Set harness = "pi" on a scenario (or in [defaults]) to run every model of that scenario through the pi coding agent (anthropic and openai models). To compare Claude Code with pi for the same model, define two scenarios that are the same except for harness.

Scenario harness Engine LLMObs spans
native (default) Selected from the model provider (table above) See above
pi pi --mode json subprocess @agent span, then one llm span per model call, one tool span per tool execution and one task span per compaction, with real times

Pi is not a Python package. Install it separately so that pi is on PATH, or set AIREDALE_PI_COMMAND (for example AIREDALE_PI_COMMAND="npx -y @earendil-works/pi-coding-agent"). See Pi isolation for how a run is kept hermetic.

MCP server URLs with the pi harness. Before a run starts, Airedale checks the MCP servers of the scenario the way pi will read them. A URL whose host it cannot check exactly is refused with a clear message, before any server is contacted: a non-ASCII (IDNA) host name such as http://exämple.test/mcp, or an IPv6 literal it cannot decide. Write the host in ASCII (http://xn--exmple-cua.test/mcp). The same limit does not apply to the other harnesses.

When an MCP server is itself LLMObs-instrumented, its spans link back to the experiment so the tokens it consumes are rolled into the experiment's total. See How distributed tracing works for details.

Private report of a failed run

The raw text that pi, the Claude CLI, a provider or a gateway writes about a failed run (stderr, error messages, request IDs) can hold credentials. A failed run writes it to one private file, and the error (or the log line) gives the name of that file.

  • Pi: the raw text never goes to an error message, a log line or a span.

  • Claude: the Airedale log line of the failed run, the logs of the Claude Agent SDK, and the progress text of an error result and of an api_retry message are protected. The raw text of the other outputs stays: see "Claude runs" below.

  • File name: pi-run-<time>-<id>.log for a pi run, claude-run-<time>-<id>.log for a Claude run. The file has mode 0600.

  • Directory: $AIREDALE_OUTPUT_DIR if it is set, else airedale-<uid> in the temporary directory of the system. The directory must belong to you, and it must have mode 0700. If it does not, no file is written, and Airedale logs a fixed warning.

  • When: only for a run that failed and has raw text to keep. Airedale does not delete the file. Remove it yourself when you no longer need it.

  • Windows: no file is written, and Airedale logs a fixed warning.

  • Claude runs: two kinds of output still have raw text: the error that the run raises (it also goes to the ddtrace experiment span and status, and to the native ddtrace Claude spans), and the retry summary of ddtrace (only when retries are on; Airedale does not use retries). Romain accepted this; DD-65 (ddtrace retry summary) follows it. Other progress lines can also show raw text: the description and summary of a nested agent, and tool inputs. The progress text of an error result and of an api_retry message shows only fixed values, numbers and counts (DD-64).

Windows support

Windows is not a supported platform yet. Some code is written for it: the lookup of the pi program, the start of pi, and a Windows Job Object that stops the whole process tree of a run. The required CI checks run on Linux only, so the tests of these three parts use a fake Windows API: they only simulate the real behavior.

A separate CI job, test-windows (py3.13), runs the test suite on windows-latest. It is not a required check and does not run in the merge queue, but a failed run is a regression. The tests that need POSIX (shell scripts, file modes, process groups) are skipped on Windows, and so are the tests of the private report, which Windows does not write. The stderr reader of the MCP probe (it stops when a child process keeps stderr open, and leaves no thread or file descriptor behind) is tested on Windows by this job, with no skip.


Installation

# From source (development)
uv pip install -e .

# From PyPI (once published)
# uv pip install airedale

The provider execution engines (claude-agent-sdk, openai-codex) are regular dependencies and are installed automatically.

Environment variables

Variable Purpose Required when
DD_API_KEY Datadog API key for LLMObs Always
DD_APP_KEY Datadog App key (datasets & experiments API) Always
DD_SITE Datadog site (default datadoghq.com) Only for a non-default site
ANTHROPIC_API_KEY Anthropic API key Anthropic models, without a gateway
OPENAI_API_KEY OpenAI API key OpenAI models, without a gateway
AIREDALE_PI_COMMAND Command that starts pi: a command line (split with shell rules, or Windows rules on Windows) or a JSON array of arguments; default pi Optional, harness = "pi" only
AIREDALE_OUTPUT_DIR Directory of the private reports of failed runs (mode 0700, yours); default airedale-<uid> in the system temporary directory Optional

Quickstart

1. Write your experiment config

# experiment.toml
project = "my-evals"
models   = ["anthropic/claude-sonnet-4-6", "openai/gpt-4.1"]
judge_model = "anthropic/claude-sonnet-4-6"
runs = 1

[defaults]
max_turns = 64
effort    = "medium"

# Shared skills and MCP servers are defined once and referenced by name.
[skills]
apm = "./skills/apm"

[mcp_servers.apm]
url          = "http://localhost:8000/mcp"
headers      = { source = "evals" }
tool_names   = ["search_apm_libraries"]

[scenarios.fat-mcp]
description = "Full MCP orchestrator"
skills      = ["apm"]   # reference by name
mcp_servers = ["apm"]   # reference by name

[tasks.ssi_overview]
prompt   = "What is Single Step Instrumentation?"
criteria = [
  "Correctly defines SSI",
  "Mentions supported languages",
]

2. Optionally write a gateway config

# gateway.toml
[providers.anthropic]
base_url           = "https://ai-gateway.example.com"
credentials_helper = "mytool auth token --datacenter us1"
headers            = { source = "evals", provider = "anthropic", "x-target-account" = "eval" }

[providers.openai]
base_url           = "https://ai-gateway.example.com/v1"
credentials_helper = "mytool auth token --datacenter us1"
headers            = { source = "evals", provider = "openai", "x-target-account" = "eval" }

3. Run

airedale experiment.toml \
  --gateway-config gateway.toml

Preview the matrix without running:

airedale experiment.toml --dry-run

See examples/ for fully-worked configs and a sample skill directory.


Configuration reference

experiment.toml

Key Type Required Description
project string yes LLMObs ml_app / project name
models list of strings yes Provider-qualified models ("<provider>/<model>")
scenarios table yes Named scenario blocks (see below)
tasks table yes Prompt + criteria definitions, keyed by task id (see below)
description string no Human description applied to the dataset
judge_model string no Model for normal rubric scoring (default anthropic/claude-sonnet-4-6)
judge_type string no rubric (default) or opt-in decisions
decisions_threshold float no Predicate probability threshold for judge_type = "decisions" (default 0.5)
runs int no Runs per cell (default 1)
dataset_name string no Stable LLMObs dataset name (default: project)
skills table no Skill registry: each <name> maps to an Agent Skill directory path (referenced by name from scenarios)
mcp_servers table no MCP server registry: each <name> maps to a server block (referenced by name from scenarios; see below)
defaults table no Defaults applied to every scenario (see below)

When judge_type = "decisions", each criterion is a predicate. A probability at or above decisions_threshold scores 1; otherwise it scores 0. The threshold must be a number in [0, 1]. The evaluator score is the mean of the binary scores and passes at 0.8. The request supports at most 400 criteria. Refusals and invalid or missing answers fail the evaluation. Metadata records refusal_count, invalid_answer_count, criterion status, and valid probabilities. Provider request failures raise a safe evaluator error. Decisions does not provide per-criterion free-text explanations.

Shared registries (skills / mcp_servers)

Skills and MCP servers are defined once at the top level and referenced by name from scenarios (and from [defaults]), so they can be reused across scenarios without copy-paste. Scenarios reference registry entries by name only: they cannot define an MCP server inline or give a raw skill path, and naming an entry absent from the registry is a configuration error.

Defaults ([defaults])

Defaults are applied to every scenario that does not set the same field. When a scenario sets a field it overrides the default entirely — values are never merged (e.g. a scenario skills list replaces, rather than extends, the default list).

Key Type Description
harness string Default engine: "native" (default) or "pi"
max_turns int Default outer agent loop cap (default 64)
effort string Reasoning effort hint: "low" / "medium" / "high" (default "medium")
system_prompt string Default appended system prompt
skills list of strings Default skill names (from the skills registry)
allowed_builtin_tools list of strings Default built-in tool allow-list
mcp_servers list of strings Default MCP server names (from the mcp_servers registry)

Scenario fields ([scenarios.<name>])

Key Type Description
description string Human description
harness string "native" (default: engine selected from the model provider) or "pi" (pi coding agent for every model)
system_prompt string Optional; appended to the base system prompt
skills list of strings Skill names referencing the skills registry
allowed_builtin_tools list of strings Built-in tool allow-list. Omitted = all built-in tools allowed; an explicit empty list [] = no built-in tools; a list = exactly those (e.g. ["Read", "Grep"]). For pi, Claude names (Read, Grep, Glob, Bash, Edit, Write, LS) map to the pi tools (read, grep, find, ...); other names go to pi unchanged. For pi, this list is the complete set of tools declared to the model (plus the MCP tools): a tool of a repo .pi/extensions extension is declared only when the list names it
max_turns int Per-scenario override for defaults.max_turns
effort string Per-scenario override for defaults.effort
mcp_servers list of strings MCP server names referencing the mcp_servers registry
workdir table Optional working-directory config (see Working directories)

MCP server fields ([mcp_servers.<name>])

Server blocks use the same field model as a standard .mcp.json file. Two transports are supported:

  • stdio — the agent SDK launches a local process and speaks MCP over its standard streams.
  • http — the agent connects to an MCP endpoint over HTTP. This is the only transport that participates in distributed tracing: when the server is LLMObs-instrumented, the trace headers injected into its requests let its agent and sub-agent spans link back to the experiment (see How distributed tracing works).

An http server may additionally carry command/args/env, which the harness uses to auto-start the server when it is unreachable; url must then resolve to localhost. Reachability is probed through the MCP protocol itself with a tools/list call.

Key Type Description
type string "stdio" or "http"; inferred from url/command when omitted
command string Stdio executable, or (http) command to auto-start the server
args list of strings Arguments for command
env table Extra environment variables for command
url string HTTP(S) MCP endpoint (enables trace-header injection)
headers table Static HTTP headers (http transport only)
tool_names list of strings Allow-list of MCP tools; empty = all tools

Task fields ([tasks.<id>])

Each task is its own table keyed by a stable task id ([tasks.ssi_overview]). The id is used in experiment names and datasets, and must be unique — TOML forbids duplicate keys, so a repeated id is a parse error.

Key Type Required Description
prompt string yes User prompt sent to the model
criteria list of strings yes Rubric criteria (one judge call each; must be non-empty)
description string no Human-readable task description
context string no Extra context appended to the prompt
latency_threshold_ms int no Latency threshold (reported in metadata only)

Working directories

By default every (model, scenario, task) repetition runs in a fresh empty temporary directory — a hermetic sandbox. A scenario can instead configure a workdir so the agent runs inside a checkout of a git repository (optionally at a ref), with files staged in. Each run/repetition gets its own fresh workspace, so file mutations never leak between repetitions.

[scenarios.regression.workdir]
repo = "self"          # "self" (repo containing experiment.toml) | a git URL | a local path
ref  = "v2.3.0"        # optional; default = the source repo's current HEAD

# Ordered setup steps applied inside each fresh worktree (all optional):
[[scenarios.regression.workdir.steps]]
op    = "restore"      # git restore --source=<from> -- <paths...> (requires a repo)
from  = "v2.2.0"
paths = ["src/api/**", "README.md"]

[[scenarios.regression.workdir.steps]]
op    = "remove"       # delete matching globs from the worktree
paths = ["secrets/**"]

[[scenarios.regression.workdir.steps]]
op      = "write"      # create/overwrite a file; exactly one of content/source
path    = "NOTES.md"
content = "Evaluate the migration."

[[scenarios.regression.workdir.steps]]
op     = "write"
path   = "fixtures/input.json"
source = "./fixtures/input.json"   # resolved relative to experiment.toml's dir
Key Type Description
repo string "self", a git URL, or a local path. Omitted = start from an empty directory
ref string Branch/tag/commit to check out; default = source repo's current HEAD
steps array of tables Ordered setup steps, each discriminated by op (restore / remove / write)

Notes:

  • repo = "self" refers to the git repository that contains experiment.toml (validated at load — an error if the config is not inside a git repo). It is cloned (--no-hardlinks) into an isolated cache, so the eval never mutates your real checkout.
  • A repo source is cloned once, lazily; each workspace is a git worktree of that clone. The whole cache is deleted at the end of the run.
  • restore requires a repo; remove/write work with or without one. A write path must stay inside the workspace (no ../absolute paths).
  • The repo's own project config is honored. If a cloned repo ships .claude/, .codex/, AGENTS.md/CLAUDE.md, project subagents/skills, or a .mcp.json, those are discovered automatically. Claude's .mcp.json servers are merged in (and get distributed-trace headers); a scenario-configured MCP server wins on a name collision. Codex does not read .mcp.json.
  • Codex hermeticity. Codex reads MCP servers (and other global config) from $CODEX_HOME/config.toml (global, default ~/.codex). The harness always isolates CODEX_HOME to a fresh per-run directory so the operator's global Codex config never leaks into a run. Authentication still works: env auth (a gateway token or OPENAI_API_KEY) is used directly, and when relying on codex login the harness copies only auth.json into the isolated home — so login auth keeps working without pulling in the global config.toml. A repo-committed .codex/config.toml is not read by Codex for MCP servers.
  • Pi isolation. Pi reads user-level config (settings, packages, extensions, MCP servers, models, skills, AGENTS.md, credentials) from its agent directory (default ~/.pi/agent). The harness always points PI_CODING_AGENT_DIR at a fresh private temp directory outside the workspace (deleted after the run; also when TMPDIR, TEMP or TMP points into the workspace), so none of the operator's pi config loads. It holds only the generated models.json (gateway), mcp.json (scenario MCP servers) and, when no gateway credential or provider API-key env var is set, a copy of the operator's pi auth.json. Pi also runs with --no-session, --no-skills (so ~/.agents/skills does not load; scenario skills, the skills paths of .pi/settings.json, and the skills that pi finds in .pi/skills and .agents/skills (also in subdirectories) are passed with --skill), --approve (a cloned repo's .pi/ files load, like .claude/ for Claude), --no-context-files (an AGENTS.md/CLAUDE.md in a parent directory of the workspace does not load; the workspace's own file is added to the system prompt) and PI_OFFLINE=1 (no model-catalog refresh). Pi does not read .mcp.json; it reads a repo's .pi/mcp.json (its direct tools stay available; for its codemode tools, add codemode to allowed_builtin_tools). Because pi lets a project server replace a same-named scenario server, such a name collision fails the run. The boundary: the project configuration is part of the experiment, and the user configuration is not. Everything that the evaluated repo carries loads and counts: .pi/extensions and the tools they register (also tools with the name of an MCP tool), .pi/mcp.json servers, .pi/skills, .agents/skills and .pi/settings.json. Airedale does not filter those tools, so a repo extension can add tools to the run. The operator's own configuration must not load: ~/.pi/agent extensions, skills, prompt templates, themes, settings, packages and mcp.json, ~/.agents/skills and context files above the workspace. tests/test_pi_isolation.py checks only part of this against the installed pi: it observes extension commands, skill and prompt template names, and extension and MCP marker files, for a fake home and a project that both have them. It does not observe settings, themes, packages, auth.json or the content of context files. Context files are checked only through the --no-context-files flag. Trust: with --approve, a cloned repo's .pi/extensions and project packages run inside the pi process with its environment (as .claude/settings.json hooks do for Claude). Only evaluate repositories you trust. The pi process gets no Datadog variable from the operator: every DD_*, DATADOG_* and _DD_* variable is removed (an allowlist, PI_DATADOG_ENV_ALLOWLIST in harness/pi.py, is empty). These variables are for the airedale process (LLMObs). They hold credentials, some inside the value (DD_ADDITIONAL_ENDPOINTS, DD_PROXY_HTTPS), and settings that would make Datadog-instrumented repo code report to your account. So pi, its tools and stdio MCP servers do not inherit them. Other variables are not filtered: a Datadog key stored under another name (for example in OTEL_EXPORTER_OTLP_HEADERS) still reaches pi. This is not a sandbox (repo code runs as the same OS user). A gateway api_key_env credential goes to pi only in its private models.json: the api_key_env variables of all gateway providers are removed from the pi environment (except the native key variable of the evaluated provider, ANTHROPIC_API_KEY or OPENAI_API_KEY, without a gateway base_url: pi reads it to authenticate). The provider key variables (ANTHROPIC_API_KEY, OPENAI_API_KEY) are also removed, except the one of the evaluated provider when pi needs it (no gateway token in models.json). With LLMObs, airedale first starts each scenario stdio MCP server once to read its tool list; the MCP SDK gives that probe only HOME, LOGNAME, PATH, SHELL, TERM, USER and the server's own env. Compatibility: a pi stdio MCP server or repo code that used OPENAI_API_KEY in an Anthropic run (or the reverse) does not get it any more. Also, a pi stdio MCP server that used an inherited Datadog variable (for example DD_API_KEY) does not get it any more. There is no safe way to give it one at this time: $NAME in an MCP env value is not expanded, and a literal key in env goes to the LLMObs experiment metadata. The task prompt goes to pi on stdin, so a prompt that starts with @ is not read as a file.

gateway.toml

Pass via --gateway-config PATH; omit it to use the standard provider APIs and env-var keys (ANTHROPIC_API_KEY / OPENAI_API_KEY).

Key Type Description
providers.<name>.base_url string Gateway base URL for this provider
providers.<name>.credentials_helper string Shell command yielding a bearer token (UTF-8 output)
providers.<name>.api_key_env string Env var holding a static API key (alternative to helper)
providers.<name>.headers table Static extra headers for every request to this provider
providers.<name>.pi_models array of tables Pi harness only: extra pi model definitions (pi models.json models entries, passed as-is)

headers, credentials_helper and an api_key_env other than the provider's own variable apply only to a gateway: setting one without base_url is a load error (ConfigError naming the provider and the keys). Set base_url, or remove them.

Credential resolution priority (per provider):

  1. credentials_helper → runs the command once, caches for 30 minutes, prefers JWT-shaped output. The output of the command must be UTF-8 on all platforms (on Windows too: the code page of the system is not used). One leading UTF-8 byte order mark is accepted. If the helper exits with 0 and its output is not valid UTF-8, Airedale raises a RuntimeError with a fixed decode-error message, and does not retry. A helper that exits with a non-zero code is retried as before, and the error names its exit code. Airedale never reads the error output (stderr) of the helper.
  2. api_key_env → reads the named environment variable.
  3. Falls back to the provider SDK default (ANTHROPIC_API_KEY / OPENAI_API_KEY).

Pi and model details. Pi needs model details (API type, context window, output limit, cost) that a gateway model list does not give. The pi harness does not define models: it changes pi's built-in anthropic / openai provider (baseUrl, headers, credential), and pi's built-in model catalog supplies the details. Use the same base_url as for the native harness (no /v1 for Anthropic, /v1 for OpenAI). A credentials_helper token is sent as Authorization: Bearer. Only for a model that is not in pi's catalog, add its definition:

[[providers.anthropic.pi_models]]
id = "claude-next"            # sent to the API; must equal the model name in experiment.toml
reasoning = true
input = ["text", "image"]
contextWindow = 200000
maxTokens = 64000
cost = { input = 3, output = 15, cacheRead = 0.3, cacheWrite = 3.75 }

pi_models entries go to pi as-is, and pi resolves $NAME and !command in their values, so treat gateway.toml as trusted input (it already holds credentials_helper commands). The run fails if pi reports a model other than the one requested, if the final answer is incomplete (stop reason other than stop, for example length), or if pi exits before the run settles.


Skills

Scenarios can expose Agent Skills (SKILL.md packages) to both execution engines. Define each skill directory once in the top-level skills registry (<name> = "<path>") and reference it by name from scenario.skills — the harness stages each referenced skill into the engine's discoverable location within the per-run temporary working directory before the agent starts.

For Claude (claude-agent-sdk), skills are copied to <cwd>/.claude/skills/<name> and allow-listed in ClaudeAgentOptions. For Codex (openai-codex), skills are copied to <cwd>/.codex/skills/<name> and approved via the thread config. For pi, nothing is copied: each skill directory is passed with --skill, together with the project skills in <cwd>/.pi/skills and <cwd>/.agents/skills. All engines share the same SKILL.md package format, so a single configured directory works for whichever engine the model uses.

See examples/skills/example-skill/SKILL.md for a minimal skill template.


How distributed tracing works

Before each run the harness calls LLMObs.inject_distributed_headers() and merges the resulting trace-context headers into the static HTTP headers sent to every HTTP-transport MCP server (McpServerSpec.merged_headers). When the MCP server is itself LLMObs-instrumented, its spans (including any sub-agent or LLM spans inside the server) link to the experiment span, making the experiment's token_count a true full-stack count. Stdio-transport servers cannot receive per-request headers; for those servers, only the tokens reported directly by the provider SDK are counted.


CLI reference

airedale CONFIG [options]

  CONFIG                     experiment TOML file (required positional argument)
  --gateway-config PATH      gateway TOML file; omit to use provider default APIs
  --model M                  run only these models (repeatable / comma-separated)
  --scenario S               run only these scenarios (repeatable / comma-separated)
  --task T                   run only these task ids (repeatable / comma-separated)
  --runs N                   override runs per cell
  --judge-model M            override rubric judge model; rejected for Decisions
  --jobs N                   total cells run concurrently across the matrix (default 1 = sequential)
  --dry-run                  print the matrix and exit without running
  --no-progress              disable the live progress display
  --[no-]agentless           LLMObs submission mode (default: agentless)
  --fail-fast                stop on the first task/evaluator error

Each cell runs its runs repetitions sequentially, so --jobs is the total number of in-flight agent runs at any time.

Exit codes: 0 success, 1 runtime error, 2 configuration error.


Contributing

Contributions are welcome. See CONTRIBUTING.md for the development environment, dependency policy, testing requirements, coding style, and pull-request conventions, and AGENTS.md for the architectural contract.


License

Licensed under the Apache License 2.0.

About

A tool to run developer experience focused experiments around your AI harness

Topics

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages