Governance
Execution Graph

Execution Graph

Every agent run produces an execution accountability graph — a directed acyclic graph (DAG) that records every turn, tool call, model invocation, policy check, and approval decision.

Structure

interface ExecutionGraph {
  nodes: ExecutionNode[];
  edges: ExecutionEdge[];
  rootId: string;
}
 
interface ExecutionNode {
  id: string;
  type: 'turn' | 'tool_call' | 'model_call' | 'policy_check' | 'approval';
  timestamp: number;
  data: Record<string, unknown>;
}
 
interface ExecutionEdge {
  from: string;
  to: string;
  type: 'triggered' | 'required' | 'produced';
}

Node Types

TypeDescriptionExample Data
turnA full agent turn (model call + tool calls){ turnIndex, input, output }
tool_callTool invocation{ toolName, arguments, result, durationMs }
model_callLLM inference{ model, provider, tokensUsed, responseSeal }
policy_checkPolicy evaluation{ ruleId, verdict, toolName }
approvalApproval decision{ approver, approved, reason }

Edge Types

TypeMeaning
triggeredSource node caused target to execute
requiredTarget was a prerequisite for source
producedSource produced target as output

Accessing the Graph

const result = await agent.run('Transfer $500 to savings');
 
// The execution graph is available on the run result
const graph = result.executionGraph;
 
console.log(`Nodes: ${graph.nodes.length}`);
console.log(`Root: ${graph.rootId}`);
 
// Find all tool calls
const toolCalls = graph.nodes.filter(n => n.type === 'tool_call');
 
// Find all policy checks that blocked
const blocked = graph.nodes.filter(
  n => n.type === 'policy_check' && n.data.verdict === 'deny'
);

Trace Integration

Execution graphs are stored as part of the trace record in the control plane:

const trace = await controlPlane.getTrace(traceId);
const graph = trace.executionGraph;

They are also included in evidence bundles for compliance review.

Use Cases

  • Post-incident investigation: Trace exactly which model call produced a problematic output, which policy approved it, and which tool executed
  • Performance analysis: Identify bottleneck nodes by durationMs
  • Policy audit: Verify that all required policy checks were executed before sensitive tool calls
  • Accountability: Prove the chain of decisions that led to any agent action

Related