Skip to content

Commit 9493e98

Browse files
authored
Route restricted owner mail through fixed agent-zone brokers (#86)
1 parent d53c44b commit 9493e98

3 files changed

Lines changed: 1060 additions & 18 deletions

File tree

‎sandbox/README.md‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ always refuses in this generation: the `ai` client cannot yet open a guest sessi
2222
| [`codex_gateway.py`](ai_zones/codex_gateway.py) | Typed Responses requests, fixed model catalogue and validated streaming for Codex. |
2323
| [`anthropic_gateway.py`](ai_zones/anthropic_gateway.py) | Typed Messages requests and validated streaming for Claude. |
2424
| [`cloud_service.py`](ai_zones/cloud_service.py) | Unprivileged internal-only Unix HTTP service with fixed provider roles and protected configuration. |
25-
| [`broker.py`](ai_zones/broker.py) | Per-zone Unix HTTP broker for approved local files, Pi inference and fixed internal cloud-service routes. |
25+
| [`broker.py`](ai_zones/broker.py) | Per-zone Unix HTTP broker for approved local files, Pi inference, fixed internal cloud-service routes and optional restricted mail. |
2626

2727
[`policy.example.json`](policy.example.json) contains synthetic paths and model
2828
settings. Schema validation alone grants no authority. Protected loading requires
@@ -189,7 +189,26 @@ paths or destinations. The confidential broker always denies cloud routes.
189189

190190
Both providers retain bounded, allowlisted retry and rate-limit headers.
191191
Cancellation, response bounds and strict child framing apply before forwarding
192-
successful completion. Mail and Helpy are not exposed through this broker.
192+
successful completion.
193+
194+
Optional `POST /mail/mcp` connects each zone to its own fixed restricted owner
195+
endpoint. Missing `config/<zone>/mail.json` disables it; an enabled configuration
196+
contains only `enabled`, `uid`, `gid` and `socket_group`. Protected configuration,
197+
separate role identities, exact socket permissions and connected kernel peer
198+
credentials are checked before forwarding request bytes. Guests cannot supply
199+
an owner address, credential or configuration path.
200+
201+
Only bounded Model Context Protocol (MCP) initialization, ping, tool listing and
202+
calls to the three `agent_mail_*` read tools and optional saved-draft tool are
203+
accepted. The owner must
204+
enforce current-read status and confidential-folder/descendant exclusion for
205+
internal mail, including metadata and attachments. No general tool registry is
206+
exposed; message status, folder and filtering changes are unavailable.
207+
Complete JSON replies have matching request
208+
identifiers and bounded numbers; owner errors lose their diagnostic message
209+
and data. Strict HTTP framing, deadlines and cancellation also apply to mail.
210+
Helpy is not exposed through this broker.
211+
193212
Dedicated service identities, socket permissions and OS confinement must still
194213
be installed and tested; the current host foundation does not activate them.
195214

0 commit comments

Comments
 (0)