mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1565] [Issue]: Long-Term Memory: any installed package can read and change the whole memory vault through the storage service #1546
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#1546
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1565
Originally assigned to: @Promansis on GitHub.
Summary
Long-Term Memory registers an Engine service,
long-term-memory:storage, that hands out the vault folder path, the whole memory store and the suggestion store. Since Engine 2.5.1 any installed package can look up another package's service, so any package can list, change or delete every memory, including memories limited to one chat, and read or change pending suggestions. The Engine doesn't use this service. Slurp reads one thing through it: a character's own memory, for its flavour brief. Shrink the service to that one read, limited to memories available to the character everywhere.Affected package
long-term-memory1.4.82server-entry.ts(service registration), a newservices/storage-read.ts,tests/long-term-memory-runtime.regression.ts,tests/long-term-memory-routes.regression.ts,docs/ARCHITECTURE.mdExpected behavior
Another package can list the memories available to a character everywhere, which is all Slurp asks for. It can't get the vault folder, write or delete memories, see memories limited to a chat or group, imported sources, archived or game-only memories, or touch suggestions.
Actual behavior
runtime.services.get("long-term-memory:storage")returns{ root, storage, drafts }: the vault path, every method of the memory store (create, update, permanent delete, a list with any filter) and the suggestion store.Steps to reproduce
api.runtime.services.get("long-term-memory:storage").root,storageanddrafts.storage.listNotes({})lists every memory, including memories limited to one chat, andstoragecan create, change and delete memories.Minimal fix
One PR, patch bump. S =
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory.S/services/storage-read.ts: the filter is checked with zod (typeoptional,characterIds1 to 100 ids); onlytypeandcharacterIdsreach the store, so a chat or group id in the filter can't open chat-limited memories. A read without character ids, or with a malformed filter, lists nothing. A malformed file elsewhere in the vault is skipped, as in chat recall.S/server-entry.tsregisters the read in place of{ root, storage, drafts }.type: "character"and the character's id and already skips archived memories; the one difference is that a game-only character memory no longer reaches a feed post.docs/ARCHITECTURE.mdnames the newservices/folder and the rule that anything handed to other packages lists only memories available everywhere.## Unreleased: other installed Agents can no longer reach the memory vault itself; the storage service now offers one read, the memories available to a character everywhere, which is what Slurp's flavour brief uses; memories limited to a chat or group, imported sources, archived and game-only memories, suggestions and the vault folder stay private.Regression proof
tests/long-term-memory-runtime.regression.ts:storage.listNotes;typefilter, a filter without character ids, an empty character list, and a filter carrying a chat id behave as above.With the regression change but staging's
server-entry.ts, the suite fails at "the storage service must not hand out the vault folder or drafts"; with the fix it passes. Letting sources through, or allowing an empty character list, fails the matching assertion.Environment
staging010829b36)upstream/staginga6e2b20ce)Logs, screenshots, or video
None.
Additional context
The service has been registered since 1.0.0, when only the Engine could look services up. Engine 2.5.1 opened the lookup to packages. Package server code already runs inside the Engine with file access, so this is not a way past a sandbox; it is a ready-made way to change memories that a well-meaning package could use by mistake. This is the groundwork for a recall service other Agents can use, which follows in a separate issue.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: