Project Plan A: Deterministic Agent Mock & Replay Harness (VCR for AI Agents)

Overview

A lightweight, high-performance recording and replay harness designed to eliminate non-determinism, third-party API costs, and network latency during AI agent CI/CD testing. Inspired by VCR-style HTTP mocking, this tool intercepts tool calls and external API interactions during an initial agent run, serializing them into deterministic test fixtures for rapid offline regression testing.

Key Technical Objectives

System Architecture & Workflow

[ Agent Under Test ] 
        |
        v  (Outbound Tool Request)
+-----------------------------------------------------------+
|                   Mock & Replay Proxy                     |
|                                                           |
|  Mode: RECORD  ---> Save request/response to local trace  |
|  Mode: REPLAY  ---> Match against fixture & inject response|
+-----------------------------------------------------------+
        |                                    |
        v (RECORD Mode)                      v (REPLAY Mode)
[ Live External API ]              [ Saved Local Fixtures ]
      

Core Components

  1. Interceptor Proxy Engine: Middleware interceptor written in Go or Python that acts as a local gateway for outbound agent tool execution.
  2. Fixture Serialization Engine: Converts execution traces into structured, version-controlled mock files containing sequence indexes and payload hashes.
  3. Sequence Matcher: Ensures tool invocations happen in the exact expected sequence, raising immediate regression flags if an agent skips steps or changes tool call order.

Deliverables & Milestones