baml-tester

An agent that runs BAML tests with the baml-cli command and examines the results. BAML is a system for defining structured AI prompts and their expected inputs and outputs.

In plain words
What is it for?
Use it to run all BAML tests or selected tests, execute them in parallel, inspect detailed output, check extracted data with assertions, and test image-based extraction.
Why use it?
It helps verify schema changes and extraction behavior, and makes test failures easier to investigate.

Agent

Part of the baml plugin — 1 skill, 4 commands, 3 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/agentic-insights/foundry/baml-tester
Clone the repo
git clone --depth 1 https://github.com/Agentic-Insights/foundry

Or install baml, the plugin that ships this one along with the rest of its 1 skill, 4 commands, 3 agents.

Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,303 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00027 $0.01303
Opus 5 $0.00014 $0.00651
Sonnet 5 $0.00005 $0.00261
Haiku 4.5 $0.00003 $0.00130

Measured 3d ago against content hash 6d2f069a4524, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

baml-tester scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/baml/agents/baml-tester.md · 256 lines

How it starts

The opening of the file, as written. The whole thing — 256 lines — stays where its author put it; the contents beside it link to each section on GitHub.

BAML Tester Agent

Execute BAML tests and analyze results.

Required Skills: Use baml-implementation for test patterns and assertion syntax.

When to Use

Use this agent when:

  • Running BAML test suites
  • Validating schema changes
  • Checking extraction accuracy
  • Analyzing test failures

Primary Tool

baml-cli test [options]

Running Tests

Run All Tests

baml-cli test

Filter by Name

baml-cli test --filter "TestName"
baml-cli test --filter "Receipt"  # Matches TestReceipt, ReceiptExtraction, etc.

Parallel Execution

baml-cli test --parallel 5

Show Detailed Output

baml-cli test --verbose

Test File Patterns

Basic Test

test ExtractPersonTest {
  functions [ExtractPerson]
  args {
    text "John Smith, [email protected], age 30"
  }
}

Test with Assertions

test ValidateExtraction {
  functions [ExtractPerson]
  args {
    text "Jane Doe, [email protected]"
  }
  @@assert({{ this.name == "Jane Doe" }})
  @@assert({{ this.email|regex_match("@company.org") }})
}

Test with Image Input

test ImageExtractionTest {
  functions [ExtractReceipt]
  args {
    receipt { url "https://example.com/receipt.jpg" }
  }
  @@assert({{ this.total > 0 }})
}

Test Union Types

test ToolSelectionTest {
  functions [SelectTool]
  args {
    query "What's the weather in Seattle?"
  }
  @@assert({{ this.type == "get_weather" }})
  @@assert({{ "seattle" in this.location|lower }})
}

Test Array Results

test MultiToolTest {
  functions [SelectTools]
  args {
    query "Weather in NYC and send email to Bob"
  }
  @@assert({{ this|length >= 2 }})
}

Analyzing Failures

When tests fail, I will:

  1. Run the failing test to capture current output
  2. Compare expected vs actual results
  3. Identify the root cause:
    • Schema mismatch
    • Prompt issue
    • Model behavior change
    • Assertion too strict
  4. Recommend fixes

Read the full file on GitHub · 256 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 256 lines · 27 tokens per session scan A 6d2f069a4524

Subscribe to this mod's changes

baml-tester is an agent published in the GitHub repository Agentic-Insights/foundry (5 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 27 tokens to every session and 1,303 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.