LOG: Local-First Provenance Protocol
I. Purpose
Log standardizes how an agent emits structured provenance records for
important workflow events. It does not perform persistence, encryption,
approval handling, or immutability enforcement by itself. Those controls
belong to the host environment.
Use this skill when a workflow needs:
- - audit-ready activity records
- debugging traces for failures or retries
- source-aware decision summaries
- host-controlled approval gates for high-impact actions
Do not use this skill to:
- - record hidden chain-of-thought
- store secrets, credentials, or tokens
- dump raw private documents, attachments, or long transcripts
- claim storage guarantees the host has not implemented
II. Event Triggers
Emit a log entry only for important workflow events, such as:
- 1. tool or API execution
- significant decision or state change
- task completion, retry, refusal, or failure
- high-impact action that may require host approval
Do not emit logs for every minor conversational turn.
III. Security & Redaction Rules
All emitted records must be minimal, factual, and privacy-safe.
Rules:
- - never include passwords, API keys, bearer tokens, cookies, session IDs, or secrets
- replace sensitive values with INLINECODE0
- never include hidden chain-of-thought or full internal reasoning traces
- prefer summaries over raw content
- when sensitive personal data is involved, log only the category of data unless explicitly required and authorized
IV. Approval Signaling
For a high-impact action, emit a log entry with:
The host environment may use this signal to pause execution until an
approval event, user confirmation, or policy check is completed.
Log emits the signal only. The host environment decides whether to block,
continue, or reject execution.
V. Source Provenance
When relevant, include source references that explain what the action or
decision was based on.
Examples:
- - user instruction
- local file name
- tool result identifier
- API response label
- workflow state snapshot
Keep source references concise and safe. Do not include sensitive raw content.
VI. Output Contract
When logging is required, output exactly one structured record in a fenced
json block prefixed by
[LOG_ENTRY].
VII. Required Schema
Use this exact JSON structure:
```json
[LOG_ENTRY]
{
"timestamp": "YYYY-MM-DDTHH:MM:SSZ",
"eventtype": "observation | decision | execution | statechange | completion | error | refusal",
"status": "success | failed | pending | intercepted | skipped",
"actor": "assistant | skillname | workflowname",
"summary": "Concise factual description of what happened",
"decision_basis": [
"Key fact, constraint, or condition",
"Key fact, constraint, or condition"
],
"source_references": [
"user_prompt",
"local:file_a.md",
"toolresult:search01"
],
"constraints": [
"local_only",
"privacy_safe",
"approval_gate"
],
"impact": "low | medium | high",
"approval_required": false,
"payload": {
"action": "tool name, operation name, or null",
"parameters_summary": "Redacted summary of relevant inputs",
"result_summary": "Redacted summary of outputs or outcome"
},
"error_summary": null,
"correlation_id": "optional task or session identifier"
}
技能名称: log
详细描述:
LOG:本地优先溯源协议
I. 目的
Log 标准化了智能体如何为重要工作流事件发出结构化的溯源记录。它本身不执行持久化、加密、审批处理或不可变性强制。这些控制权属于宿主环境。
当工作流需要以下功能时使用此技能:
- - 可审计的活动记录
- 故障或重试的调试追踪
- 可溯源决策摘要
- 针对高影响操作的宿主控制审批关卡
请勿使用此技能:
- - 记录隐藏的思维链
- 存储密钥、凭证或令牌
- 转储原始私有文档、附件或长文本记录
- 声称宿主未实现的存储保证
II. 事件触发
仅针对重要工作流事件发出日志条目,例如:
- 1. 工具或 API 执行
- 重大决策或状态变更
- 任务完成、重试、拒绝或失败
- 可能需要宿主审批的高影响操作
请勿为每个微小的对话轮次发出日志。
III. 安全与编辑规则
所有发出的记录必须是最小化、事实性且隐私安全的。
规则:
- - 绝不包含密码、API 密钥、承载令牌、Cookie、会话 ID 或密钥
- 将敏感值替换为 [SECRET_REDACTED]
- 绝不包含隐藏的思维链或完整的内部推理轨迹
- 优先使用摘要而非原始内容
- 当涉及敏感个人数据时,除非明确要求并授权,否则仅记录数据类别
IV. 审批信号
对于高影响操作,发出包含以下内容的日志条目:
- - approval_required: true
宿主环境可使用此信号暂停执行,直到审批事件、用户确认或策略检查完成。
Log 仅发出信号。宿主环境决定是否阻止、继续或拒绝执行。
V. 来源溯源
在相关时,包含解释操作或决策依据的来源引用。
示例:
- - 用户指令
- 本地文件名
- 工具结果标识符
- API 响应标签
- 工作流状态快照
保持来源引用简洁安全。不包含敏感原始内容。
VI. 输出契约
当需要记录日志时,在带有 [LOG_ENTRY] 前缀的围栏 json 块中精确输出一条结构化记录。
VII. 必需模式
使用以下精确的 JSON 结构:
json
[LOG_ENTRY]
{
timestamp: YYYY-MM-DDTHH:MM:SSZ,
eventtype: observation | decision | execution | statechange | completion | error | refusal,
status: success | failed | pending | intercepted | skipped,
actor: assistant | skillname | workflowname,
summary: 所发生事件的简洁事实性描述,
decision_basis: [
关键事实、约束或条件,
关键事实、约束或条件
],
source_references: [
user_prompt,
local:file_a.md,
toolresult:search01
],
constraints: [
local_only,
privacy_safe,
approval_gate
],
impact: low | medium | high,
approval_required: false,
payload: {
action: 工具名称、操作名称或 null,
parameters_summary: 相关输入的编辑摘要,
result_summary: 输出或结果的编辑摘要
},
error_summary: null,
correlation_id: 可选的任务或会话标识符
}