whatisgithub

What is agentspec?

ozperium/agentspec — explained in plain English

Analysis updated 2026-05-18

3TypeScriptAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

A YAML-based testing framework that catches behavior regressions in non-deterministic AI agents, similar to Jest.

Mindmap

mindmap
  root((AgentSpec))
    What it does
      Regression testing
      YAML test specs
      Behavior diffs
      LLM as judge
    Tech stack
      TypeScript
      Node CLI
      YAML
    Use cases
      Test AI agents
      CI CD gating
      HTTP endpoint testing
    Audience
      Developers
      AI agent builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Write regression tests for an AI agent's responses using simple YAML

USE CASE 2

Catch behavior shifts after changing a prompt or swapping a model

USE CASE 3

Use a local LLM as a judge to score response quality without API costs

USE CASE 4

Gate deployments in CI by failing the build when agent behavior regresses

What is it built with?

TypeScriptNode.jsYAMLCLI

How does it compare?

ozperium/agentspec000madz000/payload-test-api-route-handlerakash-sr/memobsidian
Stars333
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasyeasymoderate
Complexity2/52/53/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

So what is it?

AgentSpec is a testing framework built specifically for AI agents, the way Jest is a testing framework for regular JavaScript code. The problem it solves is that AI agents behave differently every time you change a prompt, swap a model, or update a tool, and those shifts are hard to predict or catch before they reach production. AgentSpec lets you write tests in a YAML file that check the agent's behavior and catch regressions early. After installing it globally with npm, running agentspec init creates a starter YAML file with example tests, and agentspec run executes them. Because AI output is not exact text every time, the assertions are built for that reality: you can check that a response contains certain words, does not contain others, matches one of several possible phrases, matches a regular expression, calls a specific tool, or is semantically similar to an expected answer. It can also check JSON structure and response latency. One notable feature is an LLM as judge mode, where a local model such as one running through Ollama evaluates whether a response meets a written quality description, with no API costs and full privacy since nothing leaves your machine. AgentSpec also keeps the last passing output for each test, so when a test starts failing it can show you a behavior diff report of exactly what words were added or removed compared to the previous passing run. AgentSpec can test any agent reachable over HTTP by pointing it at an endpoint that accepts a JSON input and returns a JSON output. It fits into continuous integration with a CI flag that sets an exit code on failure, plus JUnit XML and JSON output formats, and there is an official GitHub Action for running it in a pipeline. The project is released under the MIT license.

Copy-paste prompts

Prompt 1
Walk me through installing agentspec and running agentspec init
Prompt 2
Show me how to write a YAML test that checks for a tool_called assertion
Prompt 3
Explain how to set up LLM-as-judge testing with a local Ollama model
Prompt 4
How do I wire agentspec into a GitHub Actions CI pipeline with JUnit output

Frequently asked questions

What is agentspec?

A YAML-based testing framework that catches behavior regressions in non-deterministic AI agents, similar to Jest.

What language is agentspec written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, YAML.

What license does agentspec use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is agentspec to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is agentspec for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.