Skip to main content

Getting Started

The fastest path is the connect-agent skill. Install it in your coding agent (Claude Code, Cursor, or any agent with shell access), or copy the full prompt, and the agent performs the whole setup, from finding the endpoint to running the first suite:
Connect my agent to LangWatch simulations
Install via CLI
npx skills add langwatch/skills/connect-agent
Skill Usage
/connect-agent
Copy Full PromptRun skill without installing
Download SKILL.mdManual installation
The steps below are the same setup by hand, and what to check when the skill’s run needs a correction.

1. Expose an endpoint LangWatch can reach

Scenario runs call your agent from the LangWatch backend, so the agent needs a URL that backend can reach. A staging deployment is the recommended target: it exercises the real system without touching production data. Any reachable URL works. For the agent running on your own machine, langwatch agent dev opens a tunnel to a local port and points the registered agent at it for the session. See Local development. The endpoint receives one HTTP request per conversation turn and returns the agent’s reply. It does not need to know anything about LangWatch: you configure the request body and the response parsing on the LangWatch side, in step 3.

2. Authenticate the scenario traffic

Your endpoint’s existing authentication passes through the HTTP agent’s header rows and its auth block (bearer, api_key, or basic). Store the credential as a project secret and reference it as {{ secrets.NAME }}, so it stays encrypted at rest instead of readable in the agent’s configuration. When the normal authentication is built for human users (sessions, OAuth redirects), add a dedicated API key for scenario traffic instead: your server reads the expected key from an environment variable and checks it on each request, and the HTTP agent sends it from a secret. A dedicated key is also the one you revoke to close the testing path.
Also check: Testing agents behind authentication lists exactly which fields resolve secret references, and covers OAuth2 client-credentials exchange with a code agent.

3. Define the request and the response contract

The body template renders as a Liquid template on every turn, and outputPath is a JSONPath expression that picks the reply text out of the response.
Body template
The URL and the header values render the same variables. For the response, set outputPath to where the reply text lives. If the endpoint answers {"reply": "It ships on Tuesday."}, set outputPath to $.reply. The platform reads the reply text at that path; the response needs no other fields.

4. Adopt the trace context

The platform sends a W3C traceparent header on every call, one trace per conversation turn. When your server adopts it, the spans your agent produces land in that same trace, and the judge reads them before its verdict: tool calls, database writes, retrievals. A criterion like “the agent looked up the order before answering” then passes on evidence instead of on the reply’s wording. With standard OpenTelemetry HTTP auto-instrumentation, adoption already happens and you keep the code unchanged. Without it, attach the extracted context in a middleware that runs before any tracing starts. Do not extract inside the handler body: a handler decorated with @langwatch.trace() opens its root span before the body runs, so an extraction there comes too late and the agent’s spans land in a separate trace. The middleware placement covers every tracing style: decorators, with langwatch.trace(), autotrack, community instrumentations, and plain OpenTelemetry spans.
For Flask, attach in before_request (keep the token on g) and detach in teardown_request.
The agent must report its traces to the same LangWatch project that runs the scenarios. Traces sent to another project, or to another observability backend only, are invisible to the judge.
Also check: Linking your traces explains what the judge sees, how long it waits for traces, and what happens when they do not arrive.

5. Register the agent and run the first scenario

In the platform, create the agent on the Agents page: type HTTP, then the URL, authentication, body template and output path from the steps above. The same registration is available as POST /api/agents.
The HTTP agent editor with the endpoint URL, request body template and output path
The Test tab of the agent editor sends one real request to your endpoint with the current configuration. Use it to confirm the endpoint answers and the output path extracts the reply text before you run any scenario:
The Test tab showing a 200 response from the agent endpoint and the extracted reply
With the CLI:
Then create a scenario, file it into a test suite, and run the test suite against the agent:
--test-suite files the scenario into a test suite that exists, by name or by id. The run goes under the run plan named after the test suite and the target, so the next run of the same pair joins the same history.

6. Verify the run

Open the run in Agent Testing > Results. A connected setup shows:
  • The conversation transcript, with the reply text your outputPath extracted.
  • A trace link on each turn in the run detail, opening the agent’s own spans for that turn.
  • Judge reasoning that cites spans, naming the tool call or lookup that satisfied a criterion.
The run detail with the conversation transcript and a View trace link on the turn
The run results with the verdict and the judge reasoning citing a tool call span from the trace
The trace link on a turn opens the full trace: the simulation’s own steps first, then your agent’s spans for that turn, adopted through the traceparent header. This is the evidence the judge reads:
The trace waterfall with the simulation spans and the agent's own spans in one trace
A trace-dependent criterion that comes back inconclusive means the traces did not arrive; see the failures below.

Common failures

Last modified on August 28, 2026