> ## Documentation Index
> Fetch the complete documentation index at: https://java.agentscope.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Build Agent Harnesses with JEV

> [!NOTE]
>
> This guide covers the dev version. Its APIs and examples may differ from released packages. For AgentScope Java `2.0.4`, see the [2.0 documentation](https://java.agentscope.io/v2/en/jev/index.md).

JEV supplies typed decisions where a Harness needs semantic judgment: which tools fit, whether an answer has evidence, which history to retain or when a task needs verification. Call components directly or integrate them into Agent execution as middleware or read-only tools.

## Capabilities

| Area | Typical task | Guides |
| - | - | - |
| Trace evaluation and reusable definitions | Check tool use, grounding and requirement coverage with shared offline and online metrics | [Review definitions](https://java.agentscope.io/dev/en/docs/harness/jev/guides/judge-api.md), [trace evaluation](https://java.agentscope.io/dev/en/docs/harness/jev/guides/trace-evaluation-api.md), [custom metrics](https://java.agentscope.io/dev/en/docs/harness/jev/guides/metric-definitions.md), [batch evaluation](https://java.agentscope.io/dev/en/docs/harness/jev/guides/evaluator-api.md) |
| Context management and recovery | Preserve constraints, reduce tool history and recover original material | [Compaction and archives](https://java.agentscope.io/dev/en/docs/harness/jev/guides/context-compaction-api.md), [explicit exchange planning](https://java.agentscope.io/dev/en/docs/harness/jev/guides/context-planner-api.md), [memory admission](https://java.agentscope.io/dev/en/docs/harness/jev/guides/memory-api.md) |
| Progress and delivery supervision | Observe drift, stalls, missing verification and readiness for review | [Continuous supervision](https://java.agentscope.io/dev/en/docs/harness/jev/guides/supervision-api.md), [verification evidence](https://java.agentscope.io/dev/en/docs/harness/jev/guides/supervision-evidence.md), [checkpoint review](https://java.agentscope.io/dev/en/docs/harness/jev/guides/task-review.md) |
| Tool selection and execution guards | Narrow a large catalog; check proposed refunds or outbound messages | [Tool selection](https://java.agentscope.io/dev/en/docs/harness/jev/guides/tool-selection-api.md), [pre-execution guards](https://java.agentscope.io/dev/en/docs/harness/jev/guides/tool-guard-api.md) |
| Model, stage and team routing | Choose candidates by complexity, tools, capacity and quota | [Per-call routing](https://java.agentscope.io/dev/en/docs/harness/jev/guides/model-routing-api.md), [explicit stages](https://java.agentscope.io/dev/en/docs/harness/jev/guides/phase-routing-api.md), [team recommendations](https://java.agentscope.io/dev/en/docs/harness/jev/guides/team-routing.md) |
| Retrieval and knowledge answers | Filter injection, retain conflicting evidence, rerank results and check grounding | [Evidence processing](https://java.agentscope.io/dev/en/docs/harness/jev/guides/evidence-pipeline-api.md), [relevance and grounding](https://java.agentscope.io/dev/en/docs/harness/jev/guides/rag-api.md), [Knowledge adapter](https://java.agentscope.io/dev/en/docs/harness/jev/guides/knowledge-adapter-api.md) |
| Content screening and answer revision | Screen input/output before publication; revise only rejected drafts | [Content guardrails](https://java.agentscope.io/dev/en/docs/harness/jev/guides/content-guardrail-api.md), [Agent answer revision](https://java.agentscope.io/dev/en/docs/harness/jev/guides/answer-refinement-api.md), [standalone draft pipeline](https://java.agentscope.io/dev/en/docs/harness/jev/guides/draft-pipeline-api.md) |
| Code review and evidence location | Screen diffs or source snapshots for risk and locate evidence | [Staged code review](https://java.agentscope.io/dev/en/docs/harness/jev/guides/code-review-api.md) |
| Read-only browser navigation and verification | Follow visible links to find information on authorized pages | [Browser execution](https://java.agentscope.io/dev/en/docs/harness/jev/guides/browser-execution-api.md), [action proposals only](https://java.agentscope.io/dev/en/docs/harness/jev/guides/browser-proposals.md) |
| Business classification and support | Route multiple requests and check conditional refunds and reply promises | [Candidate classification](https://java.agentscope.io/dev/en/docs/harness/jev/guides/application-api.md), [support review](https://java.agentscope.io/dev/en/docs/harness/jev/guides/support-api.md) |

## Combine checks in a support workflow

For “refund me if it hasn't shipped,” keep both lookup and refund tools during selection. Before dispatch, check that current evidence supports the refund. Review the final reply for invented payment or omitted conditions. After the invocation, use trace metrics to assess tool use and answer quality.

Enable each capability independently. Start with the [refund tool guard](https://java.agentscope.io/dev/en/docs/harness/jev/guides/tool-guard-api.md) for context, configuration and failure handling, or run the offline example below to see a rejected draft revised without repeating an action.

## Choose an integration

* **Direct API:** If your application already has the input, evidence or draft, call the Judge, evaluator or evidence processor and handle the result.
* **Harness:** Register middleware with `.middleware(...)`, plug into `.compaction(...)`, or register a Toolkit tool at the appropriate execution step.

A JEV decision grants no tool permission and does not prove a business operation succeeded. Your application owns authorization, ACLs, argument validation, idempotency and independent completion checks. Each guide distinguishes recommendations from delivered inputs and actual results.

## Start with an offline example

```bash theme={null}
mvn -pl agentscope-dependencies-bom,agentscope-distribution/agentscope-bom,agentscope-examples/jev -am install -DskipTests
mvn -pl agentscope-examples/jev dependency:build-classpath -Dmdep.outputFile=/tmp/jev-examples-cp.txt
java -cp "agentscope-examples/jev/target/classes:$(cat /tmp/jev-examples-cp.txt)" io.agentscope.examples.jev.JevIntegrationExample
```

[Run the example](https://java.agentscope.io/dev/en/docs/harness/jev/guides/agent-integration-example.md) to see retrieval, review and bounded revision without credentials. Runnable source is under `agentscope-examples/jev` in package `io.agentscope.examples.jev`.

Before connecting a live model, read [Noul, Choice, Score and decision statuses](https://java.agentscope.io/dev/en/docs/harness/jev/concepts.md), then configure the [client](https://java.agentscope.io/dev/en/docs/harness/jev/guides/client.md) and [execution mode](https://java.agentscope.io/dev/en/docs/harness/jev/guides/harness-runtime.md). Calibrate example thresholds on your own samples.

## Adopt decisions explicitly

Middleware defaults to OFF. SHADOW records recommendations while preserving downstream input; ENFORCE applies the component-specific policy. Trace evaluation and ongoing supervision support only OFF/SHADOW. Direct Judge calls evaluate when invoked.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.