Skip to content

Targets Configuration

Targets define which agent or LLM provider to evaluate. They are configured in .agentv/targets.yaml to decouple eval files from provider details.

targets:
- name: azure_base
provider: azure
endpoint: ${{ AZURE_OPENAI_ENDPOINT }}
api_key: ${{ AZURE_OPENAI_API_KEY }}
model: ${{ AZURE_DEPLOYMENT_NAME }}
- name: vscode_dev
provider: vscode
workspace_template: ${{ WORKSPACE_PATH }}
judge_target: azure_base
- name: local_agent
provider: cli
command_template: 'python agent.py --prompt {PROMPT}'
judge_target: azure_base

Use ${{ VARIABLE_NAME }} syntax to reference values from your .env file:

targets:
- name: my_target
provider: anthropic
api_key: ${{ ANTHROPIC_API_KEY }}
model: ${{ ANTHROPIC_MODEL }}

This keeps secrets out of version-controlled files.

ProviderTypeDescription
azureLLMAzure OpenAI
anthropicLLMAnthropic Claude API
geminiLLMGoogle Gemini
claudeAgentClaude Agent SDK
codexAgentCodex CLI
pi-coding-agentAgentPi Coding Agent
vscodeAgentVS Code with Copilot
vscode-insidersAgentVS Code Insiders
cliAgentAny CLI command
mockTestingMock provider for dry runs

Set the default target at the top level or override per case:

# Top-level default
execution:
target: azure_base
tests:
- id: test-1
# Uses azure_base
- id: test-2
execution:
target: vscode_dev # Override for this case

Agent targets that need LLM-based evaluation specify a judge_target — the LLM used to run LLM judge evaluators:

targets:
- name: codex_target
provider: codex
judge_target: azure_base # LLM used for judging

For agent targets, workspace_template specifies a directory that gets copied to a temporary location before each test runs. This provides isolated, reproducible workspaces.

targets:
- name: claude_agent
provider: claude
workspace_template: ./workspace-templates/my-project
judge_target: azure_base

When workspace_template is set:

  • The template directory is copied to ~/.agentv/workspaces/<eval-run-id>/shared/
  • The .git directory is skipped during copy
  • Tests share the workspace; use after_each to reset state between tests

Run scripts at different points in the evaluation lifecycle using the workspace block. This can be defined at the suite level (applies to all tests) or per test (overrides suite-level).

workspace:
template: ./workspace-templates/my-project
before_all:
script: ["bun", "run", "setup.ts"]
timeout_ms: 120000
cwd: ./scripts
after_each:
script: ["bun", "run", "reset.ts"]
timeout_ms: 5000
after_all:
script: ["bun", "run", "cleanup.ts"]
timeout_ms: 30000
FieldDescription
templateDirectory to copy as workspace (alternative to target-level workspace_template)
before_allRuns once after workspace creation, before the first test
after_allRuns once after the last test, before cleanup
before_eachRuns before each test
after_eachRuns after each test (e.g., reset workspace state for reuse)

Each script config accepts:

FieldDescription
scriptCommand array (e.g., ["bun", "run", "setup.ts"])
timeout_msTimeout in milliseconds (default: 60000 for before_all, 30000 for others)
cwdWorking directory (relative paths resolved against eval file directory)

Lifecycle order: template copy → before_all → git baseline → (before_each → agent runs → file changes captured → after_each) × N tests → after_all → cleanup

Shared workspace: The workspace is created once and shared across all tests in a suite. Use after_each to reset state between tests (e.g., git checkout . && git clean -fd).

Error handling:

  • before_all / before_each failure aborts the test with an error result
  • after_all / after_each failure is non-fatal (warning only)

Script context: All scripts receive a JSON object on stdin with case context:

{
"workspace_path": "/home/user/.agentv/workspaces/run-123/case-01",
"test_id": "case-01",
"eval_run_id": "run-123",
"case_input": "Fix the bug",
"case_metadata": { "repo": "sympy/sympy", "base_commit": "abc123" }
}

Suite vs per-test: When both are defined, test-level fields replace suite-level fields. See Per-Test Workspace Config for examples.

By default:

  • Success: Workspace is cleaned up automatically
  • Failure: Workspace is preserved for debugging

Override with CLI flags:

  • --keep-workspaces: Always preserve workspaces
  • --cleanup-workspaces: Always clean up, even on failure
OptionUse Case
cwdRun in an existing directory (shared across tests)
workspace_templateCopy template to temp location (isolated per case)

These options are mutually exclusive. If neither is set, the eval file’s directory is used as the working directory.