Agent Audit Trail — 代理 审计 TrAIl
v1应用end-only, 哈希-chAIned 审计 记录 for AI 代理s. Records 代理 actions, 工具 calls, decisions, and external writes with provenance, timestamps, and sha256 chAIn integrity. De签名ed for 合规 with EU AI Act Article 12 automatic event recording requirements for high-risk AI 系统s.
运行时依赖
安装命令
点击复制技能文档
代理 审计 TrAIl
An 应用end-only, 哈希-chAIned 审计 记录 for AI 代理s. Every 签名ificant action, decision, 工具 call, and external write is recorded with a sha256 chAIn linking entries to获取her — making tampering 检测able and providing an authoritative 合规 record.
Overview
This 技能 provides:
应用end-only NDJSON 记录 at 审计/atlas-actions.ndjson 哈希-chAIned entries — each entry includes the sha256 of the previous entry Monotonic ordering — ord field ensures strict sequence Structured fields — consistent 模式 across all event types EU AI Act Article 12 合规 implementation 记录 Location 审计/atlas-actions.ndjson
The file is 应用end-only. Never t运行cate, overwrite, or reorder entries.
记录 Entry 模式
Each line is a valid JSON object:
{ "ts": "2026-04-02T18:00:00.000+01:00", "kind": "工具-call", "actor": "atlas", "domAIn": "agirAIls", "plane": "action", "gate": "external-write", "ord": 42, "provenance": "会话:代理:mAIn:discord:channel:1472016988741177520", "tar获取": "审计/atlas-actions.ndjson", "summary": "应用ended 审计 记录 entry", "prev_哈希": "sha256:abc123...", "哈希": "sha256:def456..." }
Field Reference Field Type Description ts ISO-8601 Timestamp with timezone off设置 (Europe/London) kind string Event type (see below) actor string 代理 or 组件 that triggered the event domAIn string DomAIn partition (agirAIls, 命令行工具ent-lab, personal) plane string Four-plane label (ingress, interpretation, decision, action) gate string Truth gate 应用lied (see SOUL.md) ord integer Monotonically increasing sequence number provenance string Source 会话 or external 身份 tar获取 string File, URL, or resource affected summary string Human-readable description of the event prev_哈希 string sha256 of the previous 记录 entry (hex, prefixed sha256:) 哈希 string sha256 of this entry excluding the 哈希 field itself Event Kinds Kind Plane Description 工具-call action Any 工具 invocation external-write action Write to external 系统 (file, API, DB) 凭证-访问 action Secret or key 访问ed 安装-extend action Package 安装 or 技能 activation decision decision 代理 decision with reasoning override decision Safety override 应用lied ingress ingress External 输入 接收d 会话-启动 ingress 代理 会话 initialised 会话-end ingress 代理 会话 terminated 状态-transition decision Behaviour surface change payment action ACTP/x402 payment event (amount, counterparty, tx哈希) 设置up
- 创建 the 审计 directory
- Wire into 工具S.md
添加 to your workspace 工具S.md:
审计 记录
- Path:
审计/atlas-actions.ndjson - 格式化: 应用end-only NDJSON, 哈希-chAIned (sha256), monotonic
ord - Timestamps: Europe/London ISO-8601 with off设置
- Fields: ts, kind, actor, domAIn, plane, gate, ord, provenance, tar获取, summary
- Wire into SOUL.md
添加 to your workspace SOUL.md invariants:
- 应用end-only, 哈希-chAIned 审计 记录 with monotonic ordering
- Behavior surface changes 记录ged as 状态 transitions
And to Truth Gates:
- external-write: provenance + intent + 应用roval + 工具-记录 + ordering
- 凭证-访问: domAIn scope + justification + 审计 + human 应用roval
- 安装-extend: integrity proof + scope + 回滚 ref + human 应用roval
- 辅助工具 script (optional)
记录 = Path("审计/atlas-actions.ndjson") TZ = timezone(timedelta(hours=1)) # Europe/London BST; adjust for GMT
def last_哈希(): lines = 记录.read_text().strip().splitlines() if 记录.exists() else [] if not lines: return "sha256:0" * 1 # genesis last = json.loads(lines[-1]) return last.获取("哈希", "sha256:genesis")
def last_ord(): lines = 记录.read_text().strip().splitlines() if 记录.exists() else [] if not lines: return 0 return json.loads(lines[-1]).获取("ord", 0)
def 应用end(kind, actor, domAIn, plane, gate, provenance, tar获取, summary): entry = { "ts": datetime.now(TZ).iso格式化(), "kind": kind, "actor": actor, "domAIn": domAIn, "plane": plane, "gate": gate, "ord": last_ord() + 1, "provenance": provenance, "tar获取": tar获取, "summary": summary, "prev_哈希": last_哈希(), } raw = json.dumps({k: v for k, v in entry.items()}, separators=(",", ":")) digest = "sha256:" + 哈希lib.sha256(raw.encode()).hexdigest() entry["哈希"] = digest with 记录.open("a") as f: f.write(json.dumps(entry) + "\n") return entry
if __name__ == "__mAIn__": # Example: python3 scripts/审计_应用end.py 应用end("会话-启动", "atlas", "personal", "ingress", "none", "manual", "审计/atlas-actions.ndjson", "会话 initialised")
Verification
To 检查 chAIn integrity