Memory-off /v1 turns: memory_remember's answer can echo the user's name and stored memories

Aperta
#547 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@hskl18 ci sta già lavorando.

Dal 2/11/2026.

  • #548 di @hskl18 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-3 ore
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
ai, security

Direzione di ricerca

Start in sentient/memory/facts.py: FactStore.remember runs name_the_user before saving and _hold returns the existing fact's id and content on a SKIP, and both results reach the memory_remember tool. Check how Agent.memory_allowed is passed into that tool's context. The change is to return only a neutral status when ctx.memory_allowed is false, including for helpers. Done when tests/test_openai_api.py has a memory-off test asserting the response contains no renamed text and no stored id or content.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: memory bug priority: P2 size: S

Found while testing #479 (OpenAI-compatible API) on a real engine.

What happens. In a /v1 turn with "Let connected apps use my memories" off (openai_api.allow_memory: false), the memory read tools are gone (as designed, Agent.memory_allowed, #529), but memory_remember stays so the app can still suggest facts for review. Its answer goes back to the model, and through the model to the app, and it can carry things the turn isn't supposed to see:

  1. The user's name. FactStore.remember runs name_the_user (#475) before saving, and the tool returns the rewritten text. In the real test, a helper started from a memory-off /v1 turn called memory_remember("The user works at a tech startup in Bangalore.") and got back {"action": "ADD", "content": "Maya works at a tech startup in Bangalore.", "status": "pending", ...}. The turn's prompt leaves the configured name out, so this is the only way the app learned it.
  2. An existing memory's text. _hold (sentient/memory/facts.py) answers a near-duplicate with {"action": "SKIP", "id": <existing id>, "content": <the existing fact's text>}. An app can guess a fact close to a stored one and read the stored wording back. The bar is memory.duplicate_similarity (0.98) plus same_subject, so it's a narrow oracle, but #339 shows short facts in one script can score that close with real embedding models.

Suggested fix. When ctx.memory_allowed is false, memory_remember answers without stored content: the fact as the app gave it (not renamed), and no id or text of another fact (for example {"saved": "for review", "status": "pending"}, or {"status": "skipped"} for a duplicate). Same for helpers the turn starts (they inherit the decision). A test in tests/test_openai_api.py next to the existing memory-off tests.

Not a blocker for #479: the memory switch is off by default and the key is made by the user for apps on their own computer, but the switch should mean what it says.

Lingua principale
Python
Stelle
716
Fork
132
Merge medio
16h 34m
PR unite (30g)
215

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di existence-master/Sentient

Tutte le issue di existence-master/Sentient

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.