nanocoder
nanocoder copied to clipboard
[Feature] Audit Log
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.tsxto log everytool.executeevent. - 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)
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:
- 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 inconversation-loop.tsx. - 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