diff --git a/THREAT-MODEL.md b/THREAT-MODEL.md index f40cbe7df..183763415 100644 --- a/THREAT-MODEL.md +++ b/THREAT-MODEL.md @@ -228,7 +228,11 @@ provider (e.g. Ollama on `127.0.0.1`): then nothing leaves your machine ([ADR 0084](docs/adr/0084-red-risk-requires-confirm.md), §3). - **File reads and writes by the AI** appear in the ledger as path, size, SHA-256 and (for writes) backup path only — never the file content or a diff. Paths - are redacted like command text. + are redacted like command text. A SHA-256 of very short or low-entropy + content (a PIN file, a single-token line) can be recovered by brute force, + so the hash is not a secrecy boundary: the protection is the encrypted + database, not the hash + ([ADR 0160](docs/adr/0160-activity-record-file-reads-and-writes.md)). - **Your own chat messages** are stored as you typed them (inside the encrypted database, section 3) and redacted only when they are sent. diff --git a/docs/adr/0160-activity-record-file-reads-and-writes.md b/docs/adr/0160-activity-record-file-reads-and-writes.md index 44e8d04fe..5c625b28e 100644 --- a/docs/adr/0160-activity-record-file-reads-and-writes.md +++ b/docs/adr/0160-activity-record-file-reads-and-writes.md @@ -18,6 +18,7 @@ ADR 0047 point 3 limited the ledger to `SuggestCommand`. A file read or write by | When is `file_written` written? | Only after the write succeeded. A rejected, blocked or failed write leaves no `file_written` entry. | "Written" must mean bytes were written. A failed write is visible as the action error in the chat. | | "Before" values | Size from the stat before the write; hash from the content read for the backup. On the sudo path the old content is read over SFTP once more for the hash; it is absent only when that read itself is denied or fails (size still recorded). A new file has no "before". | No privileged read is added; the extra read on the sudo path is an ordinary SFTP read. | | "After" values | Computed over the bytes sent to the server (after the edition's outgoing transform). | These are the bytes that were written. | +| Keep the hashes? | Yes. The hashes stay, although the SHA-256 of very short or low-entropy content can be guessed by brute force. | They are needed to prove what changed and which version the AI saw. The protection for them is the encrypted database, not the hash; the threat model says so. | | Redaction | Path and backup path go through the same central redaction as command text. | Spec 0057 §1.2. | | Link to the action | Entries carry the `action_id` of the proposed action. | Spec 0057 §1. | | Decision entries for file actions | File writes get confirmed, rejected, auto-approved or blocked decision entries, linked by `action_id` to the `file_written` entry. File reads get none. | Reads need no confirmation; a write's decision is part of the record of who allowed it. |