Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(security/egress): add README for egress module

Steven Enamakel0413a017545e
diff --git a/crates/openhuman-core/src/security/egress/README.md b/crates/openhuman-core/src/security/egress/README.md
index 572306861e..464f1816aa 100644
--- a/crates/openhuman-core/src/security/egress/README.md
+++ b/crates/openhuman-core/src/security/egress/README.md
@@ -8,39 +8,39 @@ plus the `LocalOnly` enforcement chokepoint built on top of it.
| File | Purpose |
| --- | --- |
-| `types.rs` | `EgressDescriptor`, `DataKind`, `EgressReason`, `IdentificationRisk` — the descriptor contract |
+| `types.rs` | `EgressDescriptor`, `DataKind`, `EgressReason`, `IdentificationRisk`: the descriptor contract |
| `emit.rs` | `emit_external_transfer`, the single publish chokepoint, plus per-turn dedup |
| `enforce.rs` | `local_only_blocks` (pure decision) and its two side-effecting wrappers, `enforce_egress` / `local_only_tool_block` |
## Public surface
-- `EgressDescriptor` — `provider_slug` (destination, e.g. `"openai"`,
+- `EgressDescriptor`: `provider_slug` (destination, e.g. `"openai"`,
`"composio"`, `"openhuman_backend"`, `"network"`), `service` (endpoint/model/
- host), `is_external` (false for local runtimes — never published),
+ host), `is_external` (false for local runtimes, never published),
`reason: EgressReason`, `data_kinds: Vec<DataKind>`, and the S5 forward-compat
fields `risk_level: IdentificationRisk` / `risk_categories: Vec<String>`
(default `Unknown`/empty until the PII/identification-risk detector
- populates them). Built via semantic constructors —
+ populates them). Built via semantic constructors,
`EgressDescriptor::inference`, `::composio`, `::integration`, `::embedding`,
- `::network_fetch` — rather than the struct literal.
-- `emit_external_transfer(descriptor)` — the one call every external-egress
+ `::network_fetch`, rather than the struct literal.
+- `emit_external_transfer(descriptor)`: the one call every external-egress
point makes right before a transfer leaves the device. It drops non-external
transfers, attaches best-effort chat routing from
`security::approval::APPROVAL_CHAT_CONTEXT`, and fire-and-forget publishes
- `DomainEvent::ExternalTransferPending` on `crate::core::bus::BUS` — this
+ `DomainEvent::ExternalTransferPending` on `crate::core::bus::BUS`. This
never blocks or fails the caller.
-- `dedup_turn_scope(f)` — runs `f` with a per-turn dedup ledger so a single
+- `dedup_turn_scope(f)`: runs `f` with a per-turn dedup ledger so a single
managed chat turn's multi-model fan-out (primary + workload-tier + summarizer
builds) collapses repeated disclosures of the same destination into one
event; every other call path emits unconditionally.
-- `local_only_blocks(mode, desc) -> bool` — pure decision: blocks only when
+- `local_only_blocks(mode, desc) -> bool`: pure decision, blocks only when
`mode == PrivacyMode::LocalOnly`, `desc.is_external`, and the transfer is not
an exempt backend control-plane round-trip (`is_control_plane`, private).
`Standard` and `Sensitive` never block here.
-- `enforce_egress(desc) -> anyhow::Result<()>` — thin wrapper for
+- `enforce_egress(desc) -> anyhow::Result<()>`: thin wrapper for
`anyhow`-returning egress sites (composio, integrations, cloud embeddings);
`Err` with a clean, non-sensitive message when blocked.
-- `local_only_tool_block(desc) -> Option<String>` — thin wrapper for agent
+- `local_only_tool_block(desc) -> Option<String>`: thin wrapper for agent
tools that return `Ok(ToolResult::error(..))` on denial; the message is
prefixed with `POLICY_BLOCKED_MARKER` so the harness treats it as a
permanent, non-retryable block.
@@ -52,25 +52,25 @@ Both `enforce_egress` and `local_only_tool_block` read the live mode via
## Relates to
-- `config/schema/privacy.rs` — `PrivacyMode` (`Standard` / `Sensitive` /
+- `config/schema/privacy.rs`: `PrivacyMode` (`Standard` / `Sensitive` /
`LocalOnly`), the config-facing enum `local_only_blocks` matches on.
-- [`../pii/README.md`](../pii/README.md) — the identification-risk detector
+- [`../pii/README.md`](../pii/README.md): the identification-risk detector
that will eventually populate `EgressDescriptor::risk_level` /
`risk_categories` via `EgressDescriptor::with_risk`.
-- `core/events.rs` — `DomainEvent::ExternalTransferPending { descriptor,
+- `core/events.rs`: `DomainEvent::ExternalTransferPending { descriptor,
thread_id, client_id }`, the event `emit_external_transfer` publishes.
## Used by
-- `memory/guard/policy.rs` — memory-write egress guard.
+- `memory/guard/policy.rs`: memory-write egress guard.
- `integrations/client/requests.rs`, `integrations/composio/client/execute.rs`,
- `integrations/composio/execute_dispatch.rs` — backend and Composio calls.
-- `tools/impl/network/{curl,http_request,web_fetch}.rs` — agent network-fetch
+ `integrations/composio/execute_dispatch.rs`: backend and Composio calls.
+- `tools/impl/network/{curl,http_request,web_fetch}.rs`: agent network-fetch
tools.
- `search/tools/{tavily/client,exa}.rs`, `embeddings/cloud_adapter.rs`,
- `inference/provider/factory.rs` and its `factory/` submodules — search and
+ `inference/provider/factory.rs` and its `factory/` submodules: search and
cloud inference/embedding providers.
-- `web_chat/event_bus.rs` — subscribes to `ExternalTransferPending` and
+- `web_chat/event_bus.rs`: subscribes to `ExternalTransferPending` and
bridges it to the `external_transfer_pending` socket event for the frontend.
## Tests