nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Feature] Audit Log

Open akramcodez opened this issue 3 months ago • 1 comments

Description

Implement a persistent audit log that records all tool executions and agent actions.

Use Case

Essential for enterprise users and security compliance. Users need to be able to answer "what did the agent actually do on my machine while I stepped away?".

Proposed Solution

  • Create source/services/audit-log.ts.
  • Hook into source/hooks/chat-handler/conversation/conversation-loop.tsx to log every tool.execute event.
  • Write to ~/.nanocoder/audit.log (JSONL format: timestamp, session.id, toolName, argsHash).
  • Ensure sensitive data can be redacted.

Alternatives Considered

  • Relying on the session chat history (hard to parse programmatically, UI-focused).

Additional Context

  • [x] I have searched existing issues to ensure this is not a duplicate
  • [x] This feature aligns with the project's goals (local-first AI assistance)

akramcodez avatar Aug 28 '26 09:08 akramcodez

Hey @akramcodez, I'd like to pick this one up.. I already worked on the lifecycle hooks (#1047), so I know the tool execution path pretty well.. could you assign it to me?

Quick plan:

  1. Add source/services/audit-log.ts, which appends one JSONL entry per tool call (timestamp, sessionId, toolName, argsHash, status) to ~/.nanocoder/audit.log. It'll be called from the tool execution step in conversation-loop.tsx.
  2. Arguments are hashed by default, with config-driven redaction (key patterns like token/secret/password) and an opt-in for logging full args. Writes won't block the loop, and AVA specs will cover redaction and file output.

Happy to change the scope if you'd rather go a different way

addyCooks avatar Sep 22 '26 09:09 addyCooks