Skip to main content
Version: 2.x

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 are ClaudeCliAgentLoop, KiroCliAgentLoop, and acp.AcpAgentLoop for 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 deterministic EvalChecks.
  • Judge โ€” Grades the answers of all arms together. AgentLoopJudge is the bundled generative judge, and JevJudge uses TypeSafe AI's Jev model for typed binary grading.
  • EvalRunner โ€” Drives the arms, models, and samples through the AgentLoop, grades each sample, and aggregates the results into ArmResults.
  • Sandbox / Workspace โ€” An isolated, ephemeral place to run untrusted, agent-produced commands, which WorkspaceEvalRunner uses 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.

ZIO Chat

๐Ÿ”ฅ Ignite your ZIO journey with ZIO Chat! ๐Ÿ”ฅ Ready to unravel the intricacies of ZIO? As your trusty sidekick, I'm here to light the way. No matter if you're wandering through functional forests or traversing effectful landscapes, I've got answers to keep you on track. Your ZIO adventure starts here โ€“ ask me anything and let's explore together!