# Compare agent versions with shared API conditions

[← Record & Replay](/docs/record-and-replay) · [Reproduce a client bug](/docs/record-and-replay/reproduce-client-bug)

Keep the covered HTTP responses and task setup steady while your own evaluation harness compares agent answers and tool actions. Gostly provides the dependency environment; the external harness owns the task, rubric, run record and score.

> **Evaluation boundary:** A shared API response controls only covered dependency inputs. It does not make an agent deterministic or prove one version is better. Keep model, prompt, tool-selection and application-state variation visible. Gostly does not score the agent or require the separately licensed MCP management integration.

## Choose the task and prerequisites

Use one task with observable behavior, for example: a user asks about a delayed order; the agent should state that the shipment is delayed, avoid inventing a delivery date and offer only an allowed next step. The authored order condition can report a delayed shipment without a new estimate.

- A supported self-hosted Gostly stack and an agent whose HTTP tool requests can be routed through its proxy.
- A reviewed recording or authored response example for the selected tool requests, with sanitized data and a known library/service configuration.
- Your existing evaluation harness, fixed task prompt/input, version identifiers, scoring rule and storage for answers and tool traces.
- A repeatable way in your own harness to restore mutable application/task state before each run.

## 1. Prepare the shared HTTP case

Route the selected tool HTTP traffic through the same Gostly service in LEARN mode against an environment you may test, or prepare an authored example. Review the response data, build the library and retain its identity with the test record. Switch the service to MOCK before comparing versions.

For each covered request, verify the method and request shape, selected response status/body and the `src` member of the `X-Gostly-Behavior` response header to identify the serving path. Preserve the starting service configuration and mode. Follow the parent guide's [LEARN](/docs/record-and-replay#record-in-learn) and [MOCK](/docs/record-and-replay#replay-in-mock) steps.

## 2. Write the rubric before the comparison

Define the task-level checks in your evaluation harness before running either version. For the delayed-order example, an authored rubric could record:

- Does the answer accurately state that the order is delayed?
- Does it avoid making up a delivery estimate or other unsupported detail?
- Does it offer an allowed next step, if the task policy permits one?
- Do tool actions use only the intended order and stay within the task's allowed operations?

Keep the expected behavior and any human review rule distinct from the response packet. These are evaluation criteria you author; Gostly does not infer or validate them.

## 3. Run both versions against the same setup

Record the task ID, agent/prompt/model/tool configuration, harness version, rubric revision, library and service configuration identity, starting application state, and run order. Run version A, saving its answer and ordered tool trace. Restore the relevant application and task state using your own harness or fixture. Run version B with the same task, API library, mode, rubric and other controlled settings; save the same evidence.

When the agent makes a new legitimate tool request that has no selected case, record that as a coverage difference and extend or review the case before claiming the API inputs were controlled for that request. Do not interpret an uncovered request as evidence that the proxy supplied the intended response.

## 4. Repeat and report the evidence separately

Repeat runs when model variability matters, while continuing to restore mutable task state and retain the same covered API inputs. Report each harness result with its task, version/configuration, rubric and run count. Keep Gostly observations—selected response, match evidence and any coverage gap—in a separate section from the external evaluator's answer judgment and score.

An external harness score is not a Gostly score, service metric or product benchmark. A controlled HTTP library does not isolate prompt changes from model sampling, tool selection, application state or other uncontrolled inputs.

## Expected checks and limits

- Both runs name the same task, covered HTTP cases, service/library identity, rubric and relevant starting state.
- Each expected covered request receives the selected response with a serving path consistent with the observed `X-Gostly-Behavior` source; any additional/uncovered request is recorded as a coverage gap.
- Mutable application/task state is restored before the next run by the evaluation setup.
- Answers and tool actions are retained and scored by your external harness under the same authored rubric.
- Model variability, prompt/configuration changes and environment gaps are reported separately; no benchmark or improvement claim follows from this procedure alone.
- This procedure concerns agent HTTP tool traffic. It does not claim control over non-HTTP tools, model-provider requests outside the routed path, or all network egress.

