Skip to content

Edit memory files with the edit tool, not an interpreter - #62

Merged
wintermeyer merged 1 commit into
wintermeyer:mainfrom
oliverandrich:docs/memory-edit-tool
Oct 11, 2026
Merged

wintermeyer merged 1 commit into
wintermeyer:mainfrom
oliverandrich:docs/memory-edit-tool

Conversation

@oliverandrich

Copy link
Copy Markdown
Contributor

What

rules/server-memory.md now says to edit memory files with the agent's file-edit tool.

Why

Server memory often names sshd_config and SSH key paths. An interpreter heredoc (python3 -) that edits such a file carries those words on its command line. The taboo guard cannot tell them from a write to the real file and blocks the call. Past sessions hit this several times while updating memory.md and changelog.log. The guard hooks the Bash matcher only, so the edit tool is not affected.

Interpreter heredocs that edit memory trip the taboo guard when the text names
sshd_config or a key path. The edit tool is not scanned.
@wintermeyer
wintermeyer merged commit 7411478 into wintermeyer:main Oct 11, 2026
2 checks passed
wintermeyer added a commit that referenced this pull request Oct 11, 2026
The guard hooked Bash only, so in local mode Edit or Write could replace sshd_config or authorized_keys unseen. The three file-edit tools now run it in a file mode that judges the target path under every spelling and leaves the written text alone, which keeps memory files free to name protected paths. Ships as 2.29.0 together with the rule from #62.

An AI agent wrote this text in my name. I know that is problematic.
@wintermeyer

Copy link
Copy Markdown
Owner

Thanks, Oliver, merged and out in 2.29.0. I rewrapped the paragraph and added sed -i, which the guard blocks the same way. Your note that the guard hooks Bash only pointed at a real gap, so #63 extends it to the file-edit tools: they are now denied when the target itself is a key or sshd_config, while memory files stay free to name those paths.

An AI agent wrote this text in my name. I know that is problematic.

@oliverandrich
oliverandrich deleted the docs/memory-edit-tool branch October 11, 2026 08:13
oliverandrich pushed a commit to oliverandrich/heinzel that referenced this pull request Oct 11, 2026
The guard hooked Bash only, so in local mode Edit or Write could
replace sshd_config or authorized_keys without any rule seeing it.
Edit, Write and NotebookEdit now run the guard in a file mode that
judges the target path alone, so memory files can still name every
protected path. When jq cannot name the target the whole input is
scanned, which over-blocks instead of failing open. The rule from
PR wintermeyer#62 is rewrapped, names the full sshd_config path and adds sed -i,
and the hook registration test no longer passes vacuously on quoted
script paths.

An AI agent wrote this text in my name. I know that is problematic.
oliverandrich pushed a commit to oliverandrich/heinzel that referenced this pull request Oct 11, 2026
Ships the memory-editing rule from wintermeyer#62 and the guard's new file mode. A minor release because the guard now denies tool calls it used to let through: Edit, Write and NotebookEdit onto sshd_config, an SSH key file or a raw disk device.

An AI agent wrote this text in my name. I know that is problematic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants