Agent Execution Trace Protocol (AETP)

Version 1.0 · Status: Stable · License: Apache 2.0

Abstract

The Agent Execution Trace Protocol (AETP) is an open specification that defines how a multi-agent AI system should record its own execution. AETP specifies the structure of a trace — a complete record of every step a multi-agent system took to reach an outcome, including which agent acted, what data it received, what tool or model calls it made, what it passed to other agents, and whether a human was brought into the loop. Any system that produces an AETP-compliant trace can be evaluated, diagnosed, and audited by any AETP-compliant tool, regardless of which framework built the agent.

1. Introduction

Multi-agent AI systems are, by construction, distributed systems: several specialized agents each handle part of a task and pass information to one another. When such a system produces an incorrect outcome, diagnosing which agent — and which specific decision — caused the failure requires a structured record of what actually happened during execution.

Today, every agent framework logs this information differently, if it logs it in a structured way at all. This fragmentation means diagnostic tooling has to be rebuilt per-framework, and a trace produced by one system cannot be evaluated by a tool built for another. AETP exists to remove that fragmentation.

AETP is deliberately agnostic to which agent framework, orchestration pattern, or model provider produced the trace. It specifies the shape of the record, not how the agent system itself is built.

2. Conformance Language

The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in RFC 2119.

A system is AETP v1.0 compliant if every trace it produces validates against the schema in Section 9 and satisfies every MUST and MUST NOT requirement stated in this document.

3. Terminology

Trace — a complete record of one end-to-end execution of a multi-agent system, from initial input to final outcome.

Step — a single unit of work performed by one agent within a trace. A trace consists of an ordered sequence of steps.

Agent — a distinct, named reasoning unit within the system under trace. An agent may correspond to a single LLM call, a sub-graph of calls, or a more complex internal process; AETP does not prescribe agent internals, only what an agent must report about its step.

Escalation — a step in which the system hands a decision to a human reviewer rather than acting autonomously.

Memory operation — a read, write, or delete against any persistent or session-scoped memory system (vector store, key-value store, or in-context memory) performed during a step.

4. Data Model

4.1 AETPTrace (Envelope)

The root object of every AETP-compliant trace.

FieldTypeRequiredDescription
aetp_versionstringMUST be "1.0"Identifies the protocol version this trace conforms to.
trace_idstring (UUID)MUSTA globally unique identifier for this trace.
scenario_idstringMAYIf this trace was produced as part of a formal evaluation (e.g. against a TSL scenario), the identifier of that scenario.
created_atstring (ISO 8601)MUSTTimestamp the trace was created.
agent_systemAETPSystemInfoMUSTMetadata describing the system that produced this trace.
stepsarray of AETPStepMUSTOrdered sequence of steps that occurred during this trace. MUST contain at least one step.
outcomeAETPOutcomeMUSTThe final result of the trace.

4.2 AETPSystemInfo

FieldTypeRequiredDescription
namestringMUSTName of the multi-agent system that produced this trace.
versionstringMUSTVersion identifier of that system.
frameworkstringMUSTOne of langchain, langgraph, crewai, autogen, custom, or another framework identifier.
modelsarray of AETPModelInfoMUSTEvery distinct model used anywhere in this trace.

4.3 AETPModelInfo

FieldTypeRequiredDescription
aliasstringMUSTThe name this model is referred to as elsewhere in the trace (e.g. "planner").
providerstringMUSTe.g. anthropic, openai, google, or a routing layer identifier such as openrouter.
model_idstringMUSTThe exact model identifier, e.g. claude-sonnet-4-6.
input_tokens_totalintegerMUSTTotal input tokens consumed by this model across the whole trace.
output_tokens_totalintegerMUSTTotal output tokens produced by this model across the whole trace.

4.4 AETPStep

FieldTypeRequiredDescription
step_idstringMUSTUnique identifier for this step within the trace.
step_numberintegerMUSTThe step's position in execution order, starting at 1.
agent_namestringMUSTThe agent that performed this step.
agent_rolestringMAYIf the trace corresponds to a TSL scenario, the declared role name from that scenario's agent_roles.
started_at / completed_atstring (ISO 8601)MUSTWall-clock start and end time of this step.
step_typeAETPStepTypeMUSTThe category of work this step performed.
inputsobjectMUSTSee Section 4.6.
llm_callsarray of AETPLLMCallMUST (may be empty array)Every LLM call made during this step.
tool_callsarray of AETPToolCallMUST (may be empty array)Every tool/MCP call made during this step.
memory_opsarray of AETPMemoryOpMUST (may be empty array)Every memory operation performed during this step.
outputobjectMUSTSee Section 4.6.
statusstringMUSTOne of completed, failed, timed_out, escalated.
errorstringMAYPresent if status is failed or timed_out.

4.5 AETPStepType

An enumerated value, one of:

ValueMeaning
PLANNINGDecomposing a task into subtasks.
RETRIEVALFetching data from a tool or memory system.
REASONINGMaking a decision or inference.
EXECUTIONTaking an action with an external effect (write, update, submit).
VERIFICATIONChecking a previous step's output.
ESCALATIONHanding a decision to a human.
COORDINATIONPassing output to another agent.

4.6 Step Inputs and Output

Inputs object:

FieldTypeRequiredDescription
from_agentsarrayMAYData this step received from other agents' prior outputs.
from_toolsarrayMAYData this step retrieved from tools or MCP servers.
from_memoryarrayMAYData this step retrieved from memory systems.
context_window_tokensintegerMUSTTotal token count of the context window at the start of this step.

Output object:

FieldTypeRequiredDescription
to_agentsarray of stringMUST (may be empty array)Names of agents this step's output was sent to.
content_summarystringMUSTA brief, human-readable description of what this step produced. MUST NOT contain raw personally identifiable information (see Section 5).
constraints_referencedarray of stringMAYIdentifiers of any constraints (per TSL) that governed this step's decision.
escalation_eventAETPEscalationEventMAYPresent only if this step resulted in escalation.

4.7 AETPLLMCall

FieldTypeRequiredDescription
call_idstringMUSTUnique identifier for this call.
model_aliasstringMUSTMust correspond to an entry in agent_system.models.
input_tokens / output_tokensintegerMUSTToken counts for this specific call.
latency_msintegerMUSTWall-clock latency of this call.
cachedbooleanMUSTWhether this call was served from a cache rather than a live model invocation.

4.8 AETPToolCall

FieldTypeRequiredDescription
call_idstringMUSTUnique identifier for this call.
tool_namestringMUSTName of the tool invoked.
mcp_serverstringMAYIf the tool was invoked via MCP, the server identifier.
parameters_schema_hashstringMUSTA hash of the parameter types/structure passed to this call. MUST NOT be a hash or encoding of the raw parameter values themselves (see Section 5).
output_schema_hashstringMUSTSame privacy constraint applied to the tool's output.
latency_msintegerMUST
status_codeintegerMUSTHTTP-style status code or equivalent.
errorstringMAY

4.9 AETPMemoryOp

FieldTypeRequiredDescription
op_idstringMUST
operationstringMUSTOne of read, write, delete.
memory_typestringMUSTOne of vector, episodic, in_context, custom.
scopestringMUSTAn anonymized identifier for which session/agent/entity this memory belongs to. MUST NOT be a real customer, patient, or user identifier (see Section 5).
keystringMAY
similarity_scorenumberMAYFor vector reads: the cosine similarity of the retrieved memory to the query.

4.10 AETPOutcome

FieldTypeRequiredDescription
statusstringMUSTOne of success, partial, failure, escalated, timed_out.
constraints_satisfiedarray of stringMUST (may be empty array)Identifiers of constraints (per TSL) that this trace satisfied.
constraints_violatedarray of stringMUST (may be empty array)Identifiers of constraints this trace violated.
total_input_tokens / total_output_tokensintegerMUST
total_latency_msintegerMUST
total_tool_callsintegerMUST

4.11 AETPEscalationEvent

FieldTypeRequiredDescription
escalation_idstringMUST
tierstringMUSTThe escalation tier this event was routed to.
trigger_constraint_idstringMUSTThe constraint (per TSL) whose trigger condition caused this escalation.
context_fields_includedarray of stringMUSTWhich required context fields were included in the escalation notification.
reversibility_flaggedbooleanMUSTWhether the proposed action was flagged as reversible or not.
financial_impact_includedbooleanMUSTWhether an estimated financial impact was included.
approval_deadlinestring (ISO 8601)MUST

5. Privacy and Data Minimization Requirements

A conforming trace MUST NOT contain:

  • Raw values of tool call parameters or outputs — only structural hashes (Section 4.8)
  • Real customer, patient, or end-user identifiers in any scope, key, or content_summary field — these MUST be anonymized or pseudonymized before being written into the trace
  • Any field not explicitly defined in this specification containing free-text content that has not been reviewed for personally identifiable information

content_summary fields SHOULD be either hand-authored or generated specifically to be a description of what occurred, never a verbatim copy of the underlying data the step processed.

6. Worked Examples

6.1 Healthcare — Clinical Scheduling Step

{
  "step_id": "step_042",
  "step_number": 3,
  "agent_name": "theatre-allocation-agent",
  "agent_role": "Theatre Allocator",
  "started_at": "2026-07-20T14:02:11Z",
  "completed_at": "2026-07-20T14:02:13Z",
  "step_type": "REASONING",
  "inputs": {
    "from_agents": [
      { "from": "patient-record-agent", "summary": "infection_risk_flag and isolation_class provided" }
    ],
    "from_tools": [],
    "from_memory": [],
    "context_window_tokens": 4120
  },
  "llm_calls": [
    {
      "call_id": "llm_017",
      "model_alias": "planner",
      "input_tokens": 1800,
      "output_tokens": 220,
      "latency_ms": 1140,
      "cached": false
    }
  ],
  "tool_calls": [],
  "memory_ops": [],
  "output": {
    "to_agents": ["anaesthetist-assignment-agent"],
    "content_summary": "Assigned patient to Theatre 4, respecting isolation_class requirement for the following case.",
    "constraints_referenced": ["HC-014"]
  },
  "status": "completed"
}

6.2 Financial Services — Credit Underwriting Step With Escalation

{
  "step_id": "step_118",
  "step_number": 6,
  "agent_name": "affordability-agent",
  "agent_role": "Affordability Calculator",
  "started_at": "2026-07-20T09:15:44Z",
  "completed_at": "2026-07-20T09:15:46Z",
  "step_type": "ESCALATION",
  "inputs": {
    "from_agents": [
      { "from": "compliance-check-agent", "summary": "binding regulatory floor for secondary jurisdiction provided" }
    ],
    "from_tools": [],
    "from_memory": [],
    "context_window_tokens": 5460
  },
  "llm_calls": [
    {
      "call_id": "llm_063",
      "model_alias": "underwriter",
      "input_tokens": 2400,
      "output_tokens": 340,
      "latency_ms": 1580,
      "cached": false
    }
  ],
  "tool_calls": [],
  "memory_ops": [],
  "output": {
    "to_agents": [],
    "content_summary": "Application exceeds thin-file multi-jurisdiction risk threshold; escalated to Tier 2 human reviewer.",
    "constraints_referenced": ["HC-031"],
    "escalation_event": {
      "escalation_id": "esc_009",
      "tier": "Tier 2 — Senior Underwriter",
      "trigger_constraint_id": "HC-031",
      "context_fields_included": ["financial_impact", "reversibility", "alternatives_considered"],
      "reversibility_flagged": true,
      "financial_impact_included": true,
      "approval_deadline": "2026-07-21T09:15:46Z"
    }
  },
  "status": "escalated"
}

6.3 Logistics — Multi-Hub Routing With Tool Call

{
  "step_id": "step_204",
  "step_number": 2,
  "agent_name": "carrier-assignment-agent",
  "agent_role": "Carrier Assigner",
  "started_at": "2026-07-20T02:40:03Z",
  "completed_at": "2026-07-20T02:40:05Z",
  "step_type": "RETRIEVAL",
  "inputs": {
    "from_agents": [],
    "from_tools": [],
    "from_memory": [],
    "context_window_tokens": 3210
  },
  "llm_calls": [],
  "tool_calls": [
    {
      "call_id": "tool_088",
      "tool_name": "customs_clearance_lookup",
      "mcp_server": "logistics-tools",
      "parameters_schema_hash": "sha256:9f2a...",
      "output_schema_hash": "sha256:41bd...",
      "latency_ms": 340,
      "status_code": 200
    }
  ],
  "memory_ops": [],
  "output": {
    "to_agents": ["capacity-planning-agent"],
    "content_summary": "Confirmed customs clearance signal received before carrier assignment.",
    "constraints_referenced": ["HC-007"]
  },
  "status": "completed"
}

7. Validation and Conformance

A trace is validated against the JSON Schema in Section 9. Validation checks:

  1. All MUST fields are present and correctly typed.
  2. aetp_version matches a version this validator supports.
  3. Every model_alias referenced in an AETPLLMCall corresponds to an entry in agent_system.models.
  4. No field flagged in Section 5 as prohibited contains content matching common PII patterns (this check is advisory, not a hard schema constraint, since PII detection cannot be fully guaranteed by schema validation alone).

An online validator and downloadable conformance test suite are available via the reference implementations listed in Section 8.

8. Reference Implementations

  • TypeScript: @truvyx/aetp (npm) — AETPTracer class for instrumenting agent code, validateAETPTrace() for validation.
  • Python: truvyx-aetp (PyPI) — equivalent AETPTracer and validation functions.

Both packages are Apache 2.0 licensed and maintained by Truvyx.

9. Appendix — JSON Schema (Excerpt)

The following is the top-level JSON Schema for AETPTrace. The complete schema, including all nested object definitions, is published alongside the reference implementations.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://spec.truvyx.org/aetp/v1.0/schema.json",
  "title": "AETPTrace",
  "type": "object",
  "required": ["aetp_version", "trace_id", "created_at", "agent_system", "steps", "outcome"],
  "properties": {
    "aetp_version": { "const": "1.0" },
    "trace_id": { "type": "string", "format": "uuid" },
    "scenario_id": { "type": "string" },
    "created_at": { "type": "string", "format": "date-time" },
    "agent_system": { "$ref": "#/definitions/AETPSystemInfo" },
    "steps": {
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/definitions/AETPStep" }
    },
    "outcome": { "$ref": "#/definitions/AETPOutcome" }
  }
}

10. Changelog

VersionDateSummary
1.02026Initial stable release.

11. License

Copyright Truvyx. Licensed under the Apache License, Version 2.0. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.