Skip to main content
ASSERT is Microsoft’s open-source framework for spec-driven evaluation and regression testing of AI systems. It turns a natural-language behavior specification into a staged evaluation pipeline: taxonomy generation, test-case generation, target inference, and LLM judging. Use ASSERT with HoneyHive to run trace-aware behavioral tests locally or in CI while keeping the agent runs visible in HoneyHive for debugging and review.

Quick start

You need:
  • A HoneyHive API key in HH_API_KEY
  • Model provider credentials for the ASSERT pipeline, such as OPENAI_API_KEY or Azure OpenAI credentials
Install the packages for a plain OpenAI target:
Create a .env file:

Wrap your agent as an ASSERT target

ASSERT’s recommended integration for agents is a callable target: a Python function with the signature chat(message, history=None) that ASSERT drives through generated conversations. HoneyHive captures the runs with the standard OpenInference instrumentor: initialize the tracer and instrument once at module top, and every OpenAI call your agent makes is traced.
The history argument follows the OpenAI chat-messages format and already contains the current user turn at history[-1], so pass it straight through and don’t re-append message. This example uses the OpenAI SDK directly. For another provider or framework, swap in the matching OpenInference instrumentor and keep the chat_sync(message, history=None) boundary. If your app already initializes HoneyHive and instrumentors at startup, import that setup here instead of duplicating it.
The @trace(event_type="chain", event_name="support_agent") decorator is an optional HoneyHive touch, not an ASSERT requirement. It groups each target call (and its model calls) under a named support_agent span so your agent stands out from ASSERT’s own calls in the trace view. Remove it and the integration still works.

Configure ASSERT

Save this as eval_config.yaml. Point pipeline.inference.target.callable at the wrapper and enable target.trace:
Run the pipeline:
ASSERT prints the run directory (something like artifacts/results/support-agent-v1/baseline-1/) when the pipeline completes.

What you see in HoneyHive

Each assert-ai run produces one HoneyHive session (named by session_name) on the project tied to HH_API_KEY. Open the Traces page to inspect it. The session contains the full inference and judging loop:
  • Your agent under named support_agent chain spans, each grouping the model calls for one turn.
  • ASSERT’s tester (the simulated user) and judge calls, captured automatically because they run through the OpenAI SDK. These appear as ungrouped ChatCompletion events alongside your chains.
ASSERT runs the tester and judge through LiteLLM. They show up here because LiteLLM routes OpenAI models through the OpenAI SDK that OpenAIInstrumentor patches. If you point tester.model or judge.model at a non-OpenAI provider, add the LiteLLM instrumentor so those calls are still captured:
ASSERT evaluation session in the HoneyHive trace view, showing support_agent chain spans and the judge ChatCompletion with its scored dimensions

An ASSERT run in HoneyHive: one session with the agent's calls grouped under support_agent chains, alongside ASSERT's tester and judge ChatCompletion events

What ASSERT adds

Operational notes

  • Keep tools safe. ASSERT can generate adversarial and multi-turn probes. Use sandboxed tools, scoped credentials, and synthetic data for evaluation runs.
  • Review generated artifacts. Read taxonomy.json and test_set.jsonl before trusting the final score.
  • Use new run IDs or force stages. ASSERT does not overwrite every artifact automatically. Change run or run from the earliest changed stage with --force-stage.
  • Start small. Lower sample_size and max_turns while validating the wrapper, then expand coverage once traces and scores look correct.

OpenAI integration

The OpenInference instrumentor pattern used here

Experiments quickstart

Run HoneyHive evaluations with evaluate()

Framework attribute mapping

See how OpenInference spans map into HoneyHive

Tracer initialization

Choose where to initialize HoneyHive tracing

Resources