-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Feature]: Add metadata-only audit records for agent runs and tool actions #98521
Copy link
Copy link
Closed
Closed
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.maintainerMaintainer-authored PRMaintainer-authored PRmaturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.maintainerMaintainer-authored PRMaintainer-authored PRmaturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Type
Fields
Priority
None yet
Summary
Add a small, metadata-only audit ledger for agent runs and tool actions so operators can answer who acted, what action ran, when it happened, and how it ended without reading transcripts or enabling raw-content telemetry.
Problem to solve
OpenClaw already has the right source signals, but they serve different jobs:
There is no single durable, bounded query path for interactive agent runs and their tool actions. Reconstructing that history from transcripts or logs risks exposing prompt, argument, result, and error content, while task records intentionally do not cover every interactive run.
Proposed solution
Add one canonical shared-SQLite audit event table and a typed read contract with:
Project records from the existing sequenced agent run/tool lifecycle rather than creating another conversation or transcript store. Use the shared state database and Kysely. Keep retention fixed and bounded; do not add configuration in this foundation.
Initial scope:
Non-goals:
Alternatives considered
Impact
Operators gain a privacy-preserving local history for run and tool accountability. The main risks are write amplification, unbounded retention, accidental content capture, and ambiguous terminal classification; the implementation should address those with selective lifecycle projection, fixed pruning, a column-only metadata schema, and tests against failure/cancellation/timeout paths.
Evidence/examples
Related requests and current candidates:
/var/log/openclaw-events.jsonl#73603 asks for lifecycle event logging; this keeps persistence in the shared state database rather than adding a file sink.Current source provides sequenced lifecycle events with run/session context, normalized run terminal outcomes, sanitized tool result handling, and a shared Kysely-backed state database. Those seams are sufficient for a bounded first implementation without a new dependency.