Skip to content

CoreEvents Reference

The AgentV event bus is the central nervous system of the evaluation harness. It facilitates decoupled communication between the engine, plugins, and forensic collectors.

Behavioral DNA markers allow the engine and agents to provide high-fidelity traces of their internal decision-making process.

LevelMarkerSourceDescription
0STRATEGYEngineMission-level intent (e.g., Pass@K, Consistency).
1PHASEEngineMacro segments of the evaluation lifecycle.
2MANEUVEREngineOrchestration logic for a specific workflow node.
3CHAINEngineA sequence of reasoning links within a task.
4NODEEngineA single atomic reasoning/execution turn.
5SUBTASKAgent/EngineDiscrete logic units (e.g., “Dependency Check”).
6ACTIONAgentIndividual tool decisions and reasoning leaps.
7STEPAgentAtomic environment interactions.

These events track the lifecycle of the evaluation run.

  • Trigger: Called when a mission (multiple attempts) starts or finishes.
  • Payload: run_id, id, k_attempts.
  • Trigger: Called when a specific task node within a scenario starts.
  • Payload: task_id, attempt.
  • Trigger: Called for every interaction turn between the agent and environment.
  • Payload: turn, task_id.

  • Trigger: Emitted when an agent requests a tool execution.
  • Payload: tool_name, arguments.
  • Trigger: Emitted after a tool has executed.
  • Payload: tool_name, result, status (success/error/policy_violation).
  • Trigger: Emitted when a state-parity check is performed.
  • Payload: metric, success, diff (structural state difference).
  • Trigger: Emitted when an agent reads a value from the SharedStateRegistry.
  • Payload: agent, path, value.
  • Trigger: Emitted when an agent successfully writes a value to the SharedStateRegistry.
  • Payload: agent, path, value (Crucial for Taint Tracking).

  • Trigger: Emitted when human intervention is requested.
  • Payload: agent_request, human_message.
  • Trigger: Emitted during sandbox lifecycle transitions.
  • Payload: action (create/teardown/limit), resource_id.

⚡ Asynchronous Subscription & Concurrency

Section titled “⚡ Asynchronous Subscription & Concurrency”

To prevent “eval-drag”—where intensive telemetry logging, compliance checking, or database updates slow down the agent’s turn latency—AgentV’s central EventEmitter supports asynchronous subscriber callbacks.

  1. Asynchronous Coroutine Execution: When an event is emitted within an active event loop, async subscriber callbacks are wrapped in task wrappers (asyncio.create_task) and run non-blockingly.
  2. Threaded Execution: Synchronous subscriber callbacks are offloaded to an internal thread pool executor (concurrent.futures.ThreadPoolExecutor) to avoid blocking the main execution loop.

The event system automatically captures and attaches the active OpenTelemetry tracing context (otel_context) to background execution threads and async tasks, ensuring parent-child span alignment is preserved across turn boundaries.

If an evaluation session or test requires waiting for all scheduled asynchronous subscriber actions to complete (for example, to write final audit trails before terminating the runner process), invoke events.flush():

from eval_runner.events import EventEmitter
# Emit event (schedules background tasks)
EventEmitter.get_global().emit("CUSTOM_COMPLIANCE_CHECK", {"run_id": "xyz"})
# Block until all scheduled background tasks complete
EventEmitter.get_global().flush(timeout=5.0)