feat(hindsight): add enable_retain_tool config to gate hindsight_retain exposure - #66417
feat(hindsight): add enable_retain_tool config to gate hindsight_retain exposure#66417kumaxs wants to merge 1 commit into
Conversation
…in exposure Add a user-facing config toggle so the destructive hindsight_retain tool (full-overwrite, not append) can be hidden from the agent while auto_retain continues to work internally. Default is true for backward compatibility; set to false to eliminate the risk of accidental session-document overwrites. Follow-up to NousResearch#55819 — the upstream fix (skip_memory=True for background review) isolates one call path, but the main conversation agent can still invoke hindsight_retain. This config gives users the final say.
|
Thanks for the focused Hindsight safety proposal. Automated hermes-sweeper review is closing this under the standing
The existing context mode preserves Closed as not-planned per standing maintainer policy ( |
Summary
Add
enable_retain_toolconfig option to the Hindsight memory plugin, giving users control over whether thehindsight_retaintool is exposed to the agent.Follow-up to #55819 (closed as
implemented_on_main), which identified the destructive risk ofhindsight_retainbut was resolved upstream by isolating background review forks (skip_memory=True). That fix prevents background review from calling memory tools, but the main conversation agent still has access tohindsight_retain— and if the model calls it without understanding the tool's semantics, it will overwrite the entire session document, silently destroying all auto-retained memories.Problem
hindsight_retainis a full-overwrite operation, not an incremental append. When the agent calls it:RETAIN_SCHEMA) reads "Store important information" — it does NOT disclose the destructive nature.Most users rely on
auto_retain+auto_recallfor memory — these work internally without the model ever touching thehindsight_retaintool. Exposing a destructive manual write tool to the agent is an unnecessary risk vector for those users.Changes
Single file:
plugins/memory/hindsight/__init__.py(+7 / −1 lines)enable_retain_tool(default:true, backward-compatible)enable_retain_toolfrom config, falling back toTrueget_tool_schemas()— filters outhindsight_retainwhenenable_retain_toolisfalseConfig in
hindsight/config.json:{ "enable_retain_tool": false }When disabled:
hindsight_retain— it's removed from the tool listauto_retaincontinues to work internally and is completely unaffectedhindsight_recallandhindsight_reflect(read-only tools) remain exposedWhy this matters
Background review isolation (#27190) is a good fix for one call path, but it doesn't address the broader risk: any agent turn can invoke
hindsight_retain. This PR gives users a simple config toggle to eliminate that risk entirely, without sacrificing the automatic memory functionality they already rely on.