Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
docs(sources): lay out sources by who may read them; access is per source, never per page (GBRA-156)
garrytan3f59115b3dcd
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 95116866fc..e33f693fdb 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -33,6 +33,7 @@ identifiers and attribution are available in the pre-removal Git revision- For a bot acting for several members, give each member a token granted only that member's sources (`gbrain auth rescope --token <name> --sources <ids>`, or `--client <client_id>`); `source_ids` narrows inside a grant and is not a separation between members. See [multi-source brains](docs/guides/multi-source-brains.md#a-bot-acting-for-many-members).- A schema-validating client on the starter surface with `mcp.strict_params reject` only sends parameters it was shown; fetch the full schema with `request_tools {tools: [name]}` or serve the full surface when an agent needs a left-out parameter.+- Access is per source, never per page. A bot answering everyone with one unscoped token over a single shared source exposes that whole source to every requester, and neither `source_ids` nor a search limit can narrow inside one source. Put content in one source per channel, team or member, and grant each member's token only its sources ([lay out sources by who may read them](docs/guides/multi-source-brains.md#lay-out-sources-by-who-may-read-them)).- A token the operator granted sources, and every OAuth client (which always carries at least its bound source), never gets `sources_not_readable`: its scope is deliberate. A real miss inside a scope that holds pages gets no notice either.- Nothing is rewritten on upgrade, and there is no schema migration.diff --git a/docs/guides/multi-source-brains.md b/docs/guides/multi-source-brains.mdindex 8f2a80d068..65dbd90349 100644--- a/docs/guides/multi-source-brains.md+++ b/docs/guides/multi-source-brains.md@@ -183,6 +183,36 @@ current member's sources, but a prompt-injected or buggy bot can omit it, soit does not separate members who must not see each other's pages. Useper-member tokens for that, and `source_ids` to narrow further.+### Lay out sources by who may read them++gbrain enforces access per source, never per page. Two pages in one source are+readable by exactly the same tokens. So put content in sources by who may read+it, before any member's bot connects:++- **One source per channel, team or member.** Give a channel's pages a source+ of their own (`channel-a`), a team's documents theirs (`team-a`), and each+ member a private one (`private-alice-example`). Content everyone may read+ goes in a shared source (`public`).+- **One grant per member.** Grant each member's token or client every source+ that member may read, and nothing else:++ ```bash+ gbrain auth rescope --token bot-alice-example --sources private-alice-example,channel-a,team-a,public+ gbrain auth rescope --client <client_id> --sources private-alice-example,channel-a,team-a,public+ ```++ The first id is the token's write source, so a member's saved memories land+ in their own private source.++> **Warning: one shared source has no boundary inside it.** A bot that answers+> everyone with one unscoped token over a single source exposes everything in+> that source to every requester. Neither `source_ids` nor a search limit can+> narrow a read inside one source: `source_ids` chooses whole sources, and a+> limit only shortens a ranked list, which can still start with a page the+> requester should not see. Semantic search makes this more visible, because+> it returns related pages that a keyword search would not match. Split the+> content into sources first, then grant per member.+### Links, backlinks and the graph across sources`gbrain links`, `gbrain backlinks` and `gbrain graph` (MCP: `get_links`,diff --git a/docs/mcp/ADMIN.md b/docs/mcp/ADMIN.mdindex 9108149760..71d442d1c2 100644--- a/docs/mcp/ADMIN.md+++ b/docs/mcp/ADMIN.md@@ -233,6 +233,8 @@ For one bot acting for several members of a shared brain, give each member aseparate client or token restricted to that member's sources. The grant is thesecurity boundary; a request's `source_ids` can only narrow inside it. See[a bot acting for many members](../guides/multi-source-brains.md#a-bot-acting-for-many-members).+Access is per source, never per page, so lay sources out by who may read them+([guide](../guides/multi-source-brains.md#lay-out-sources-by-who-may-read-them)).New `memory-reader`, `memory-writer` and `coding-agent` grants are callable andlisted on the full surface; their operation snapshot is still the ceiling, so a