Agent evaluation

georgeguimaraes/

tribunal

ExUnit-native LLM evaluation for Elixir: faithfulness, relevance and safety assertions that run in mix test, plus dataset evals and red-team generation.

What’s new here

Tribunal treats LLM output quality as something you assert in a normal test file. It puts faithfulness, relevance and safety checks into ExUnit, so a quality failure becomes an ExUnit failure in mix test.

What it does

You write assertions such as assert_faithful, assert_relevant and refute_toxicity next to your usual ones. Judge-based checks ask a model for a verdict, a score and a reason. Deterministic checks (contains, regex, JSON, word count, Levenshtein distance, latency) need no extra dependency. assert_similar compares meaning with embeddings.

There are two modes. Test mode uses ExUnit and fails on any violation, which suits CI gates and safety checks. Evaluation mode is a Mix task (mix tribunal.eval) that runs JSON or YAML datasets, repeats each case, and applies pass thresholds, group gates or a versioned policy file. Output can be a console report, JSON, or GitHub Actions annotations.

It also generates red-team cases. Static templates wrap a prompt in encoding, injection and jailbreak attacks. LLM-driven plugins (policy, excessive_agency, prompt_extraction, imitation, hijacking) write a reviewable dataset you commit and run like any other eval suite.

Who it’s for

Elixir teams shipping LLM features who want regression checks in the same test suite and CI they already run. It fits RAG apps and assistants that need refusal detection, safety checks or policy rules.

Try it

Add the dependency to mix.exs. The two extra deps are optional: req_llm for LLM-as-judge checks and alike for embedding similarity.

def deps do
  [
    {:tribunal, "~> 3.0"},
 
    # Optional: for LLM-as-judge evaluations
    {:req_llm, ">= 1.2.0 and < 2.0.0"},
 
    # Optional: for embedding-based similarity
    {:alike, ">= 0.4.0 and < 0.5.0"}
  ]
end

Then use it in a test:

defmodule MyApp.RAGTest do
  use ExUnit.Case
  use Tribunal.ExUnit
 
  @context ["Returns are accepted within 30 days with receipt."]
 
  test "response is faithful to context" do
    response = MyApp.RAG.query("What's the return policy?")
 
    assert response =~ "30 days"
    assert_faithful response, context: @context
  end
end

For evaluation mode:

mix tribunal.init
mix tribunal.eval
mix tribunal.eval --threshold 0.8

The LLM-as-judge macros require req_llm.

How mature is it

About 11 months old (created 2026-01-12), with 121 stars, 3 forks and 4 contributors. It has 15 releases, the latest being v3.1.0 on 2026-10-16. The last push was 2026-11-30, with 25 commits in the past 90 days, 0 open issues and 2 open PRs. MIT licensed. The README’s roadmap lists curated red-team datasets and multi-turn attacks as next up, and retries, caching and cost budgets as deferred. The README also documents removed safety assertions (refute_harmful, refute_bias and others) with no compatibility aliases.