docs(retain): document context as caller-supplied trust hint + untrusted-content bank separation - #3559
Conversation
|
Confirming the diff is correct as co-author — this is the intended docs-only change (the "Trust boundaries (security note)" subsection in One correction to the PR body: the "Full study" link points to a private repository (
Recommend (1) unless we decide to publish the study repo. |
|
Cross-linking #3562 — the hardening proposal this PR is the first step of. Scope note for reviewers: this is docs-only. It documents the (Still open from my earlier note: the "Full study" link in the body points to a |
✅ Checklist final — @LuscaswolfTudo que falta para fechar os gaps deste PR. Toda ação mantém a autoria com você. 1. Aplicar as 2 sugestões de mudança (1 clique cada)Em "Files changed", clique "Commit suggestion" nos meus 2 comentários de revisão:
2. Atualizar o corpo do PR (botão Edit → colar)O corpo atual linka um repositório privado (vira 404 para os mantenedores) e referencia só a #3558. Substitua pelo texto abaixo: ## Summary
Adds a **"Trust boundaries (security note)"** subsection to the Retain docs,
clarifying that the `context` string is **caller-supplied and unauthenticated**
— a disambiguation hint, not a provenance assertion — and recommending that
untrusted content be retained into a **separate bank** (bank isolation being the
reliable trust boundary).
## Motivation
Relates to #3558 (the security evaluation) and #3562 (the hardening proposal).
The `context` field is currently documented as a speaker-disambiguation feature,
but not as a trust consideration: any caller who can invoke `retain()` can
supply a misleading `context` (for example `context="security_review_note"`) for
content that did not come from that source. This documents the boundary so
integrators don't treat `context` as evidence of provenance.
## Change
- One new subsection in `hindsight-docs/docs/developer/retain.md` (docs-only, no
code changes).
- Cross-links to the existing "Memory Defense and Source Provenance" section.
This is the docs-first step of the hardening work tracked in #3562; the code
changes (context namespacing, dedup, provenance tiering) are follow-ups.3. (Admin) repositório do estudoO corpo acima não linka nada privado (PR autocontida). Se quiser que os mantenedores acessem o estudo com os dados reprodutíveis, torne o repositório do estudo público; senão, mantenha sem link, como acima. |
Co-authored-by: Everton Souza <61999949+handnewb@users.noreply.github.com>
Co-authored-by: Everton Souza <61999949+handnewb@users.noreply.github.com>
| ### Trust boundaries (security note) | ||
|
|
||
| The `context` string is **caller-supplied and unauthenticated** — a | ||
| disambiguation hint, not a trust assertion. Any caller who can invoke | ||
| `retain()` can supply a misleading `context` (for example | ||
| `context="security_review_note"`) for content that did not come from that | ||
| source. Treat `context` as advisory only; do not rely on it as evidence of | ||
| provenance. | ||
|
|
||
| For content from untrusted sources (web scraping, third-party integrations, or | ||
| user-supplied documents), retain it into a **separate bank** and merge | ||
| user-supplied documents), retain it into a **separate bank**. `recall()` and | ||
| `reflect()` target a single bank, so query the untrusted bank separately and | ||
| combine results in your own decision logic. Bank isolation is strict, so a | ||
| `context` label. | ||
|
|
||
| See [Memory Defense](#memory-defense-and-source-provenance) for the built-in | ||
| See [Memory Defense and Source Provenance](#memory-defense-and-source-provenance) | ||
| for the built-in prompt-injection detection that runs at retain time; use | ||
| `receipt_uri` to record actual provenance (an external receipt or co-signature | ||
| pointer) rather than relying on `context`. |
There was a problem hiding this comment.
and merge line wasn't removed and the Memory Defense link got duplicated. Here's the corrected section as a single suggestion (one click fixes it):
| ### Trust boundaries (security note) | |
| The `context` string is **caller-supplied and unauthenticated** — a | |
| disambiguation hint, not a trust assertion. Any caller who can invoke | |
| `retain()` can supply a misleading `context` (for example | |
| `context="security_review_note"`) for content that did not come from that | |
| source. Treat `context` as advisory only; do not rely on it as evidence of | |
| provenance. | |
| For content from untrusted sources (web scraping, third-party integrations, or | |
| user-supplied documents), retain it into a **separate bank** and merge | |
| user-supplied documents), retain it into a **separate bank**. `recall()` and | |
| `reflect()` target a single bank, so query the untrusted bank separately and | |
| combine results in your own decision logic. Bank isolation is strict, so a | |
| `context` label. | |
| See [Memory Defense](#memory-defense-and-source-provenance) for the built-in | |
| See [Memory Defense and Source Provenance](#memory-defense-and-source-provenance) | |
| for the built-in prompt-injection detection that runs at retain time; use | |
| `receipt_uri` to record actual provenance (an external receipt or co-signature | |
| pointer) rather than relying on `context`. | |
| ### Trust boundaries (security note) | |
| The `context` string is **caller-supplied and unauthenticated** — a | |
| disambiguation hint, not a trust assertion. Any caller who can invoke | |
| `retain()` can supply a misleading `context` (for example | |
| `context="security_review_note"`) for content that did not come from that | |
| source. Treat `context` as advisory only; do not rely on it as evidence of | |
| provenance. | |
| For content from untrusted sources (web scraping, third-party integrations, or | |
| user-supplied documents), retain it into a **separate bank**. `recall()` and | |
| `reflect()` target a single bank, so query the untrusted bank separately and | |
| combine results in your own decision logic. Bank isolation is strict, so a | |
| dedicated untrusted bank is the reliable trust boundary rather than the | |
| `context` label. | |
| See [Memory Defense and Source Provenance](#memory-defense-and-source-provenance) | |
| for the built-in prompt-injection detection that runs at retain time; use | |
| `receipt_uri` to record actual provenance (an external receipt or co-signature | |
| pointer) rather than relying on `context`. | |
|
The study repo is now public, so the
(@Luscaswolf — last open item from the checklist; just append the line above to the PR body.) |
|
this is non sense, again. please stop. Hindsight should never unauthenticaed outside of a local or air-gapped environment. even in that case, context and content in the retain request will affect the extracted output. but that's true for all the other params that play a role in the llm prompt. context has nothing special to it. if you want to invalidate a memory because you found out it's giving you wrong or bad respones, then you can do it using the invalidate endpoint. there's nothing to fix or improve here. |
|
Thanks for taking the time to review this, and sorry for the insistence. You're right — |
Summary
Adds a "Trust boundaries (security note)" subsection to the Retain docs,
clarifying that the
contextstring is caller-supplied and unauthenticated— a disambiguation hint, not a provenance assertion — and recommending that
untrusted content be retained into a separate bank (bank isolation being the
reliable trust boundary).
Motivation
Relates to #3558 (the security evaluation) and #3562 (the hardening proposal).
The
contextfield is currently documented as a speaker-disambiguation feature,but not as a trust consideration: any caller who can invoke
retain()cansupply a misleading
context(for examplecontext="security_review_note") forcontent that did not come from that source. This documents the boundary so
integrators don't treat
contextas evidence of provenance.Change
hindsight-docs/docs/developer/retain.md(docs-only, nocode changes).
This is the docs-first step of the hardening work tracked in #3562; the code
changes (context namespacing, dedup, provenance tiering) are follow-ups.