ZIO Evals
ZIO Evals is a ZIO 2 / Scala 3 toolkit for running agent evals: we give an agent a task, run it through several arms (different tool loadouts), grade the answers with a judge, and compare the results.
Introductionโ
The orchestration engine is persistence-free and host-agnostic. Network and process I/O belong to the selected agent, judge, and sandbox implementations. ZIO Evals works both inside an application, where we persist the results via an observer, and as integration tests, where we assert on the returned results.
Key concepts of ZIO Evals:
AgentLoopโ The provider-agnostic seam to the agent under test. The bundled backends areClaudeCliAgentLoop,KiroCliAgentLoop, andacp.AcpAgentLoopfor any Agent Client Protocol agent.EvalArmโ One configuration under test, such as the model alone or the model with an MCP server.EvalSpecโ The definition of an eval: the task, the criteria for the judge, and deterministicEvalChecks.Judgeโ Grades the answers of all arms together.AgentLoopJudgeis the bundled generative judge, andJevJudgeuses TypeSafe AI's Jev model for typed binary grading.EvalRunnerโ Drives the arms, models, and samples through theAgentLoop, grades each sample, and aggregates the results intoArmResults.Sandbox/Workspaceโ An isolated, ephemeral place to run untrusted, agent-produced commands, whichWorkspaceEvalRunneruses to verify the end state of a workspace.
Installationโ
In order to use this library, we need to add the following line to our build.sbt file:
libraryDependencies += "com.jamesward" %% "zio-evals" % "<version>"
Exampleโ
Here is an eval that runs one task through two arms, the agent alone and the agent with an MCP server, grades them with a judge, and prints the results:
import com.jamesward.zio_evals.*
import com.jamesward.zio_evals.cli.KiroCliAgentLoop
import zio.*
object MyEval extends ZIOAppDefault:
val spec = EvalSpec(
task = "What is the capital of France?",
criteria = "The answer must name Paris.",
checks = List(EvalCheck.AnswerContains("Paris")),
)
val arms = List(
EvalArm.modelOnly(),
EvalArm.mcp("atlas", "Agent with Atlas", List(McpServerConfig("atlas", "http://localhost:8080/mcp"))),
)
def run =
val agentLoop = KiroCliAgentLoop()
val judge = AgentLoopJudge(agentLoop, judgeModelId = "claude-opus-4.8")
for
results <- EvalRunner.run(spec, arms, modelIds = List("claude-opus-4.8"), samples = 1, agentLoop, judge)
_ <- ZIO.foreachDiscard(results)(r => Console.printLine(s"${r.arm.label}: ${r.verdict} (pass=${r.passRate})"))
yield ()
For the full documentation, see the ZIO Evals README.