Skip to content

Agent Interaction Contract

This document describes the expected API contract between the AgentV harness and the AI agent.

By default, the harness expects the agent to expose a REST endpoint:

POST /execute_task
FieldTypeRequiredDescription
task_descriptionstringThe current instruction for the agent.
turnintegerCurrent turn number (1 to MAX_TURNS).
conversation_historyarrayHistory of previous turns.
identity_bindingobjectCryptographic proof of agent identity.
span_contextobjectDistributed tracing metadata (OTel 1.40.0).
run_idstringMandatory Run ID for forensic vault affinity.

The agent must return an Action Object indicating its next step.

  • call_tool: Execute a single sandboxed tool.
  • call_multiple_tools: Execute a bundle of tool calls (parallel execution).
  • final_answer: Terminates the session with a summary of accomplishment.
  • hitl_pause: Pause evaluation for human-in-the-loop intervention.
{
"action": "call_multiple_tools",
"tool_calls": [
{
"tool": "run_line_test",
"params": {"port": 8080}
},
{
"tool": "check_firmware",
"params": {"version": "1.4.0"}
}
],
"summary": "Performing remote diagnostics with specific parameters."
}

After an agent issues a call_tool or call_multiple_tools action, the harness executes the tools and returns the results to the agent in the subsequent turn’s conversation_history.

Logical Direction: The agent never returns tool_outputs in its own response. It only requests tool execution. The harness is the sole authoritative source of environment data and tool results.


To ensure that an evaluation trace genuinely reflects the intended scenario logic, AgentV enforces the Forensic Evidence Ledger. This provides a verifiable baseline for the environment state (IDs, API keys, and simulator configurations).

MarkerDescription
topology_hashSHA3-256 hash of the scenario.workflow structure.
tool_dna_hashHash of the tool definitions available to the agent.
fingerprint_v1A cryptographic digest ensuring the behavioral baseline was not tampered with.

v1.6.0 elevates the environment to a First-Class Member of the evaluation trace.

To ensure infrastructure abstraction, scenarios should list required capabilities instead of hardcoded endpoints. The Core resolves these via the Routing Manifest.

Every run.jsonl trace includes:

  1. environmental_snapshot: A point-in-time capture of the final merged registry state.
  2. provisioning_hash: A cryptographic link ensuring the environment hasn’t drifted from the sanctioned baseline.
MarkerLevelPurposeExample
PHASEStrategicHigh-level mission segments.”Reconstruction”, “Targeting”
SUBTASKTacticalDiscrete logical missions within a phase.”Resolve Account”, “Verify Sig”
ACTIONOperationalIndividual decisions or tool invocations.”Call API”, “Parse JSON”
STEPAtomicGranular execution units.”Init Socket”, “Buffer Read”

Agents should include these markers in their response metadata or specific telemetry headers:

{
"action": "call_tool",
"tool_name": "resolve_identity",
"metadata": {
"telemetry": {
"phase": "Public Trust Verification",
"subtask": "Identity Resolution",
"action": "GET /v1/identity/system_id/public_key",
"depth": 2
}
}
}

Harness communicates via Standard I/O.

  • Request: Single-line JSON to agent stdin.
  • Response: Single-line JSON from agent stdout.
  • Logs: Captured from stderr.

Harness connects via TCP or Unix sockets. Payloads are newline-delimited JSON strings. This is recommended for high-performance, low-latency integrations.


The harness automatically discovers the agent’s identity and scenario ID with the following priority (Strict AES v1.4+):

  1. Scenario Metadata (Authoritative): metadata.id and metadata.name.
  2. Scenario Root: Top-level id or run_id.
  3. Dynamic Discovery: metadata.model or metadata.agent_name.
  4. CLI Overrides: The --agent-name CLI flag or endpoint URL.