Every action an AI agent takes — tool calls, policy decisions, trust handshakes — must be recorded in a tamper-proof log. Without it, you cannot answer the question every auditor asks: “What exactly did this agent do, and who authorized it?” AGT records every governance decision with full context: what policy was active, what the agent requested, the rule that matched, and the outcome. Each entry is hash-chained to its predecessor, making retroactive modification immediately detectable. This page covers the audit entry structure, the Merkle chain integrity mechanism, the Decision BOM, the pluggableDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/microsoft/agent-governance-toolkit/llms.txt
Use this file to discover all available pages before exploring further.
GovernanceEventSink, export formats, and compliance framework mapping.
Audit Entry Structure
Agent OS Audit Entry
The base audit entry captures a single governance decision:| Field | Type | Required | Description |
|---|---|---|---|
timestamp | string (ISO 8601 UTC) | Required | When the event occurred |
event_type | string | Required | Category of the audit event (e.g., governance_decision) |
agent_id | string | Required | Identifier of the agent that triggered the event |
action | string | Required | The action being audited |
decision | string | Required | Governance decision outcome: allow, deny, escalate, warn |
reason | string | Optional | Human-readable explanation of the decision |
latency_ms | float | Optional | Time in milliseconds to reach the decision |
metadata | dict | Optional | Arbitrary key-value pairs for extension data |
Agent Mesh Audit Entry
The full mesh-level entry adds chain integrity fields and cross-component correlation:| Field | Type | Description |
|---|---|---|
entry_id | string | Unique identifier — format: audit_{uuid4_hex[:16]} |
timestamp | datetime (UTC) | Entry creation time |
event_type | string | Category of the audit event |
agent_did | string | DID of the acting agent |
action | string | The action being audited |
resource | string | Target resource of the action |
data | dict | Additional structured data |
outcome | string | Result: success, failure, denied, error |
policy_decision | string | Policy engine decision |
matched_rule | string | Rule that matched |
policy_version | string | Version of the policy bundle that produced this decision |
previous_hash | string | Hash of the previous entry in the chain |
entry_hash | string | SHA-256 hash of this entry’s canonical form |
trace_id | string | OTel trace ID for distributed correlation |
session_id | string | Session scope identifier |
arguments_hash | string | SHA-256 hash of the action arguments (tamper defense) |
approver_did | string | DID of the principal whose approval authorized this action |
| Event Type | When |
|---|---|
tool_invocation | Agent successfully called a tool |
tool_blocked | Policy denied a tool call |
policy_evaluation | Policy engine evaluated a request |
policy_violation | Agent violated a governance policy |
rogue_detection | Anomaly detection flagged an agent |
agent_invocation | Agent-to-agent delegation occurred |
trust_handshake | IATP handshake performed |
Entry Hash Computation
The entry hash is computed deterministically so any modification is detectable:- Construct a dictionary with exactly:
entry_id,timestamp(ISO format),event_type,agent_did,action,resource,data,outcome,previous_hash. - Serialize to JSON with keys sorted alphabetically and no extra whitespace.
- Compute SHA-256 of the UTF-8 encoded JSON bytes.
- Encode as lowercase hexadecimal string.
hmac.compare_digest to prevent timing side-channel attacks.
Decision BOM (Bill of Materials)
The Decision BOM enables post-hoc reconstruction of all inputs, context, and outputs that contributed to a governance decision. This supports regulatory audits, incident investigation, and reproducible compliance evidence. Every Decision BOM is assembled in four phases:Phase 1 — Audit Query
Query the
AuditSource for events within a ±5-second window around the decision timestamp, filtered by trace ID or agent ID.Phase 2 — Trust Enrichment
Query the
TrustSource for the agent’s trust score at decision time and recent score history.Phase 3 — Policy Enrichment
Query the
PolicySource for policy evaluations associated with the trace, and active policies at the time of decision.BOM Field Categories
| Category | Description |
|---|---|
IDENTITY | Agent identity and authentication information |
TRUST | Trust scores, reputation, and vouching data |
POLICY | Policy rules, evaluations, and configurations |
ACTION | The requested action and its parameters |
CONTEXT | Environmental context (session, trace, resources) |
OUTCOME | Decision result and enforcement actions |
LINEAGE | Causal chain and delegation history |
Required BOM Fields
Every Decision BOM must include:| Field Name | Category | Description |
|---|---|---|
agent_identity | IDENTITY | The verified identity of the acting agent |
trust_score_at_decision | TRUST | The agent’s trust score at decision time |
policy_rules_evaluated | POLICY | List of policy rules that were evaluated |
action_type | ACTION | The type of action requested |
decision_outcome | OUTCOME | The final governance decision |
completeness_score (0.0–1.0) indicates the fraction of required fields that were successfully populated.
Decision BOM Schema
| Field | Type | Description |
|---|---|---|
decision_id | string | Unique identifier for this BOM |
timestamp | datetime (UTC) | When the decision was made |
agent_id | string | Agent that requested the action |
action_requested | string | What action was requested |
outcome | string | Decision outcome (allow/deny/escalate/warn) |
fields | list[BOMField] | All collected BOM fields with source and confidence |
reconstructed_at | datetime (UTC) | When this BOM was reconstructed |
sources_queried | list[string] | Data sources that were consulted |
completeness_score | float | Score (0.0–1.0) indicating data completeness |
Merkle Chain
Every entry inAuditLog is added to an internal MerkleAuditChain. The chain builds a Merkle tree over all entries:
- Append-only: entries cannot be removed or reordered.
- Tamper-evident: changing any entry changes the root hash, and all subsequent hashes become invalid.
- Efficient proofs: proving an entry exists requires O(log n) hashes, not the full log.
Verifying the Chain
External Proof Verification
A third party who only has the root hash can verify inclusion without the full log:- Start with the entry’s hash.
- For each
(sibling_hash, position): ifleft, computeSHA-256(sibling || current); ifright, computeSHA-256(current || sibling). - Compare the final hash against the known root hash.
Commitment Anchoring
The Commitment Engine produces summary records that anchor a session’s delta chain, enabling third-party verification without requiring access to the full delta history.CommitmentRecord schema:
| Field | Type | Description |
|---|---|---|
session_id | string | The session being committed |
hash_chain_root | string | Root hash of the session’s delta chain |
participant_dids | list[string] | DIDs of all agents in the session |
delta_count | int | Number of deltas in the committed chain |
committed_at | datetime (UTC) | Timestamp of commitment creation |
blockchain_tx_id | string or None | External blockchain transaction ID |
committed_to | string | Where the commitment was anchored (default: "local") |
GovernanceEventSink
GovernanceEventSink is the pluggable interface for routing governance events to external systems. Any object implementing emit(), shutdown(), and force_flush() can serve as a sink — no inheritance required (structural typing).
| Code | Value | Description |
|---|---|---|
SUCCESS | 0 | Events were successfully exported |
FAILURE | 1 | Export failed; events may be retried |
DROPPED | 2 | Events were intentionally dropped (e.g., circuit breaker open) |
Built-in Sinks
JSONL File Sink
Writes one JSON object per line to a
.jsonl file with 0o600 permissions (owner read/write only). Thread-safe with a lock on writes.OTel Logs Backend
Emits audit entries as OTel
LogRecords with the agt.* attribute namespace. No-op if the OpenTelemetry SDK is not installed.In-Memory Backend
Stores entries in a Python list. For testing and development only — not for production.
REST API Sink
Submits entries to the Audit Collector REST API (
POST /api/v1/audit/log). For centralized multi-agent deployments.The Event Processor
TheGovernanceEventProcessor runs a background daemon thread that batches events and exports them to all registered sinks. It implements circuit-breaker semantics: after 5 consecutive export failures, the breaker opens and skips export for 60 seconds before attempting again.
Custom Sink Example
Export Formats
Plain Dictionary Export
CloudEvents Envelope
Audit entries can be exported as CloudEvents v1.0 envelopes for routing to CNCF-compatible event infrastructure:| Event Type | CloudEvents Type |
|---|---|
tool_invocation | ai.agentmesh.tool.invoked |
tool_blocked | ai.agentmesh.tool.blocked |
policy_evaluation | ai.agentmesh.policy.evaluation |
identity_verification | ai.agentmesh.identity.verified |
data_access | ai.agentmesh.data.accessed |
delegation | ai.agentmesh.delegation.created |
| Extension | Description |
|---|---|
agentmeshentryhash | Cryptographic hash of the entry |
agentmeshprevioushash | Hash chain link (previous entry hash) |
traceid | OTel trace correlation |
sessionid | Session correlation |
Compliance Mapping
AGT maps governance controls to four compliance frameworks out of the box:OWASP ASI 2026
The
agt verify CLI checks all 10 OWASP Agentic Security Issues. Outputs a human-readable summary, JSON report, or Shields.io badge.SOC 2
SOC2-CC6.1 (Access Control) and SOC2-CC7.2 (System Monitoring) are satisfied by AGT’s identity verification, policy logging, anomaly detection, and tamper-evident audit trail.NIST AI RMF
Risk management, transparency, and monitoring requirements map to AGT’s trust scoring, Decision BOM, and compliance engine.
EU AI Act / GDPR
EUAI-ART9 (Risk Management), EUAI-ART13 (Transparency), GDPR-ART5 (Data Principles), and GDPR-ART22 (Automated Decisions) are addressed by the compliance engine.