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.
| Field | Type | Required | Description |
|---|---|---|---|
aetp_version | string | MUST be "1.0" | Identifies the protocol version this trace conforms to. |
trace_id | string (UUID) | MUST | A globally unique identifier for this trace. |
scenario_id | string | MAY | If this trace was produced as part of a formal evaluation (e.g. against a TSL scenario), the identifier of that scenario. |
created_at | string (ISO 8601) | MUST | Timestamp the trace was created. |
agent_system | AETPSystemInfo | MUST | Metadata describing the system that produced this trace. |
steps | array of AETPStep | MUST | Ordered sequence of steps that occurred during this trace. MUST contain at least one step. |
outcome | AETPOutcome | MUST | The final result of the trace. |
4.2 AETPSystemInfo
| Field | Type | Required | Description |
|---|---|---|---|
name | string | MUST | Name of the multi-agent system that produced this trace. |
version | string | MUST | Version identifier of that system. |
framework | string | MUST | One of langchain, langgraph, crewai, autogen, custom, or another framework identifier. |
models | array of AETPModelInfo | MUST | Every distinct model used anywhere in this trace. |
4.3 AETPModelInfo
| Field | Type | Required | Description |
|---|---|---|---|
alias | string | MUST | The name this model is referred to as elsewhere in the trace (e.g. "planner"). |
provider | string | MUST | e.g. anthropic, openai, google, or a routing layer identifier such as openrouter. |
model_id | string | MUST | The exact model identifier, e.g. claude-sonnet-4-6. |
input_tokens_total | integer | MUST | Total input tokens consumed by this model across the whole trace. |
output_tokens_total | integer | MUST | Total output tokens produced by this model across the whole trace. |
4.4 AETPStep
| Field | Type | Required | Description |
|---|---|---|---|
step_id | string | MUST | Unique identifier for this step within the trace. |
step_number | integer | MUST | The step's position in execution order, starting at 1. |
agent_name | string | MUST | The agent that performed this step. |
agent_role | string | MAY | If the trace corresponds to a TSL scenario, the declared role name from that scenario's agent_roles. |
started_at / completed_at | string (ISO 8601) | MUST | Wall-clock start and end time of this step. |
step_type | AETPStepType | MUST | The category of work this step performed. |
inputs | object | MUST | See Section 4.6. |
llm_calls | array of AETPLLMCall | MUST (may be empty array) | Every LLM call made during this step. |
tool_calls | array of AETPToolCall | MUST (may be empty array) | Every tool/MCP call made during this step. |
memory_ops | array of AETPMemoryOp | MUST (may be empty array) | Every memory operation performed during this step. |
output | object | MUST | See Section 4.6. |
status | string | MUST | One of completed, failed, timed_out, escalated. |
error | string | MAY | Present if status is failed or timed_out. |
4.5 AETPStepType
An enumerated value, one of:
| Value | Meaning |
|---|---|
PLANNING | Decomposing a task into subtasks. |
RETRIEVAL | Fetching data from a tool or memory system. |
REASONING | Making a decision or inference. |
EXECUTION | Taking an action with an external effect (write, update, submit). |
VERIFICATION | Checking a previous step's output. |
ESCALATION | Handing a decision to a human. |
COORDINATION | Passing output to another agent. |
4.6 Step Inputs and Output
Inputs object:
| Field | Type | Required | Description |
|---|---|---|---|
from_agents | array | MAY | Data this step received from other agents' prior outputs. |
from_tools | array | MAY | Data this step retrieved from tools or MCP servers. |
from_memory | array | MAY | Data this step retrieved from memory systems. |
context_window_tokens | integer | MUST | Total token count of the context window at the start of this step. |
Output object:
| Field | Type | Required | Description |
|---|---|---|---|
to_agents | array of string | MUST (may be empty array) | Names of agents this step's output was sent to. |
content_summary | string | MUST | A brief, human-readable description of what this step produced. MUST NOT contain raw personally identifiable information (see Section 5). |
constraints_referenced | array of string | MAY | Identifiers of any constraints (per TSL) that governed this step's decision. |
escalation_event | AETPEscalationEvent | MAY | Present only if this step resulted in escalation. |
4.7 AETPLLMCall
| Field | Type | Required | Description |
|---|---|---|---|
call_id | string | MUST | Unique identifier for this call. |
model_alias | string | MUST | Must correspond to an entry in agent_system.models. |
input_tokens / output_tokens | integer | MUST | Token counts for this specific call. |
latency_ms | integer | MUST | Wall-clock latency of this call. |
cached | boolean | MUST | Whether this call was served from a cache rather than a live model invocation. |
4.8 AETPToolCall
| Field | Type | Required | Description |
|---|---|---|---|
call_id | string | MUST | Unique identifier for this call. |
tool_name | string | MUST | Name of the tool invoked. |
mcp_server | string | MAY | If the tool was invoked via MCP, the server identifier. |
parameters_schema_hash | string | MUST | A 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_hash | string | MUST | Same privacy constraint applied to the tool's output. |
latency_ms | integer | MUST | |
status_code | integer | MUST | HTTP-style status code or equivalent. |
error | string | MAY |
4.9 AETPMemoryOp
| Field | Type | Required | Description |
|---|---|---|---|
op_id | string | MUST | |
operation | string | MUST | One of read, write, delete. |
memory_type | string | MUST | One of vector, episodic, in_context, custom. |
scope | string | MUST | An anonymized identifier for which session/agent/entity this memory belongs to. MUST NOT be a real customer, patient, or user identifier (see Section 5). |
key | string | MAY | |
similarity_score | number | MAY | For vector reads: the cosine similarity of the retrieved memory to the query. |
4.10 AETPOutcome
| Field | Type | Required | Description |
|---|---|---|---|
status | string | MUST | One of success, partial, failure, escalated, timed_out. |
constraints_satisfied | array of string | MUST (may be empty array) | Identifiers of constraints (per TSL) that this trace satisfied. |
constraints_violated | array of string | MUST (may be empty array) | Identifiers of constraints this trace violated. |
total_input_tokens / total_output_tokens | integer | MUST | |
total_latency_ms | integer | MUST | |
total_tool_calls | integer | MUST |
4.11 AETPEscalationEvent
| Field | Type | Required | Description |
|---|---|---|---|
escalation_id | string | MUST | |
tier | string | MUST | The escalation tier this event was routed to. |
trigger_constraint_id | string | MUST | The constraint (per TSL) whose trigger condition caused this escalation. |
context_fields_included | array of string | MUST | Which required context fields were included in the escalation notification. |
reversibility_flagged | boolean | MUST | Whether the proposed action was flagged as reversible or not. |
financial_impact_included | boolean | MUST | Whether an estimated financial impact was included. |
approval_deadline | string (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, orcontent_summaryfield — 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:
- All MUST fields are present and correctly typed.
aetp_versionmatches a version this validator supports.- Every
model_aliasreferenced in anAETPLLMCallcorresponds to an entry inagent_system.models. - 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) —AETPTracerclass for instrumenting agent code,validateAETPTrace()for validation. - Python:
truvyx-aetp(PyPI) — equivalentAETPTracerand 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
| Version | Date | Summary |
|---|---|---|
| 1.0 | 2026 | Initial 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.