Repository navigation
audit: record focused window title and screenshot hash on every action - #4
Conversation
8d9b7e7 to
dcbe9b1
Compare
|
Thanks, recording the target window and the screenshot hash is a useful addition and the sanitising and opt-out are the right shape. Before merge:
Also, please sign off the commit ( |
dcbe9b1 to
cb4d036
Compare
|
All three addressed in cb4d036, rebased on current
Measured on Windows 11 (debug build, 15 top-level windows open): So roughly 0.6 ms per action against a 1.4 s screenshot. I don't have macOS or Hyprland to measure; |
|
Thanks. Rebase, changelog and sign-off are all in, and the Windows and Hyprland lookups are the cheap ones we wanted. Three things before it can go in:
Branch: we moved to release branches (see CONTRIBUTING). This will go into 0.5.0. Please rebase onto |
|
0.4.0 is released and this PR's base is now |
cb4d036 to
006789a
Compare
|
All three fixed, rebased onto
Also for the rebase: Router tests added in
I can measure Windows only: the lookup is ~0.6 ms there against a ~1.4 s screenshot. |
|
Thanks for the updates. CI is green and the router tests are good. Before this goes into 0.5.0: Please fix
Tests to add. Please apply the patch below. It adds four router tests:
They pass on your current head. Run tests.patch (apply with
|
006789a to
5f1090a
Compare
|
All four fixed, rebased onto
Your four router tests applied as given and pass. 56 tests green on Linux and Windows. |
Signed-off-by: mrigbozurike <drbillionbook@gmail.com>
5f1090a to
7e07e04
Compare
Bump the version to 0.5.0 and move Unreleased under a dated 0.5.0 section. The root refusal from #5 is listed under Changed as a breaking change; the window-title entry from #4 states that titles are on by default and reach audit streams. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H6FWzFP6qZXMn5TXipJPRw Signed-off-by: Brian Scott <claudeai@bscott.email>
Why
The audit log said what was asked (
input.click 640,400) but not what it was aimed at or which image the agent was looking at. For after-the-fact review of an agent's actions, both matter.What
window: the focused window'sapp: title, captured before the action runs so it records the target rather than the result, truncated to 160 characters and passed through the existingsanitize()so a hostile title cannot inject control sequences into the log (test added).screenshot_sha256of the returned bytes. Every MCP action ends with a fresh screenshot, so every agent tool call leaves at least one hashed line, and a saved image can be matched to the line that produced it.[serve.audit].window_titles = falseomits the title (titles can carry document names or mail subjects).rdc auditshows the window in brackets and the first 12 hex digits of the hash;--jsonhas the full fields. Old log files still parse.Testing
cargo clippy --all-targets,cargo teston Linux and Windows; new tests cover SHA-256 vectors, focused-window description/truncation, serialisation of the new fields, and sanitisation of a title containing an OSC escape.sha2.