---
title: Targets
description: Point evals at a local dev server or a deployment with the same eval files.
url: "https://eve.dev/docs/evals/targets"
docs_index: /llms.txt
---

> For an index of all documentation, see [/llms.txt](/llms.txt).

An eval target is the URL of the agent server an eval runs against. `eve eval` starts a local dev server, and `eve eval --url <url>` targets a running server or deployment. The same eval files work for both, so evals also serve as end-to-end tests in CI.

Before running evals, `eve eval` waits for `/eve/v1/health` and checks `/eve/v1/info`. Inside `test`, `t.target` is the target.

## Target helpers

```ts title="evals/heartbeat.eval.ts"
import { defineEval } from "eve/evals";

export default defineEval({
  async test(t) {
    const { sessionIds } = await t.target.dispatchSchedule("heartbeat");
    const session = t.target.attach(sessionIds[0]!);
    await session.nextTurn();
    t.succeeded();
    t.calledTool("send_report");
  },
});
```

- `t.target.fetch(path, init)` sends an [authenticated](#authentication) request to the target, to test channel and webhook routes.
- `t.target.dispatchSchedule(id)` triggers a [schedule](../schedules) through the dev-only schedule route and returns the session ids it created. It throws unless the target has dev routes enabled. The local `eve eval` dev server and a deployment in development mode enable them.
- `t.target.attach(sessionId, { startIndex? })` returns a handle for an existing session without making a request. `startIndex` sets where reading starts. An unknown or inaccessible session fails when you read it, not when you attach it.
- `session.nextTurn()` reads and records the session's next turn. Its events feed both the session's assertions and the run-level assertions. Each read continues where the last one stopped.
- `session.watch()` starts reading right away and returns a [live turn](./cases#in-flight-turns) with `waitForEvent(...)`, `cancel()`, and `result()`. Pass `{ until }` to stop at a matching event instead of the end of a turn, such as `context.settled` for a context change between turns.

Attached sessions are full `EveEvalSession`s. Send them messages and assert on them directly, as in `session.succeeded()` or `session.calledTool(...)`. Assertions on `t` cover the whole run, including every attached session.

To create sessions and send messages, use the [drive API](./cases#the-drive-api).

## Authentication

Requests to a local target carry no credentials, because `eve eval` started that server.

For a remote `--url`, eve finds the expected Vercel team and project from `VERCEL_ORG_ID` and `VERCEL_PROJECT_ID` when both are nonblank. Otherwise it reads the local Vercel project link: `.vercel/project.json`, or the matching project in `.vercel/repo.json` for a linked monorepo.

With a project, eve looks up the exact HTTPS origin under that team, regardless of the Vercel CLI's current team. It sends your Vercel credentials only when the deployment's project ID matches. Without a project, eve checks the URL under the Vercel CLI's current team. A URL that Vercel can't verify gets no credentials.

After verification, eve sends the available Vercel credentials:

- The resolved OIDC token as both the bearer and Vercel trusted-IDP header.
- `VERCEL_AUTOMATION_BYPASS_SECRET`, when set, as the Protection Bypass for Automation header.

Set `EVE_EVAL_AUTH_TOKEN` to send that bearer token instead, for targets that don't use Vercel OIDC. Requests that carry credentials don't follow redirects, so the credentials never reach another origin.

`/eve/v1/info` serves only operator callers, so the credential must authenticate with `principalType: "service"`. Vercel OIDC, `jwtHmac()`, `jwtEcdsa()`, or a custom `AuthFn` can provide it. When the target answers `403`, the run fails before any eval starts and names the credential it needs.

`t.target.fetch(path, init)` sends these same credentials.

## What to read next

- [Running evals](./running): `--url` and the rest of the CLI in practice
- [Schedules](../schedules): the surface `dispatchSchedule` drives
- [Channels](/docs/channels): routes you can test with `target.fetch`

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)