Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
docs(guardrails): mark all network/pod isolation invariants Enforced
Andy Pavia5c94abb90a30
diff --git a/docs/features/mcp-host-guardrails/mcp-host-guardrails-spec-v3.md b/docs/features/mcp-host-guardrails/mcp-host-guardrails-spec-v3.mdindex 1c6c9ed6e..113d445d5 100644--- a/docs/features/mcp-host-guardrails/mcp-host-guardrails-spec-v3.md+++ b/docs/features/mcp-host-guardrails/mcp-host-guardrails-spec-v3.md@@ -1200,23 +1200,23 @@ to the admin floor, §8.4) · bounded/redacted evidence · no-config compatibiliThe enforced isolation model between mcp-host and the `llm-hooks` namespace, stated in full so theguarantee and its mechanism can be reviewed together. Enforcement is **symmetric and HCC-owned**: themcp-host runtime never widens its own reach (§12.1), and every allowed flow is a narrowly-scoped,-controller-generated NetworkPolicy on top of a deny-everything baseline. **Status:** *Enforced* =-implemented; *In progress* = being wired; *Planned* = agreed, not yet implemented.+controller-generated NetworkPolicy on top of a deny-everything baseline. All invariants below are+**Enforced** (implemented).| # | Invariant | What it guarantees & how it is enforced | Status ||---|---|---|---|-| N1 | **CRD-scoped reach** | An mcp-host pod may open a connection to an installed hook **only** when its admin-authored Host CR lists that hook in `guardrails.hooks`. This is enforced at both ends: the host's egress policy permits only the hook pods/ports it references, and each hook's ingress policy admits only the mcp-hosts that reference it. A host that doesn't reference a hook is denied on both sides — it never appears in that hook's ingress allow, and the hook never appears in the host's egress allow. | ingress Enforced; egress In progress |-| N2 | **Symmetric enforcement** | Reachability is gated independently on both sides of a connection: the source host must have an egress allow **and** the destination hook must have an ingress allow. The two policies live in different namespaces and are generated separately, so a bug or gap on one side alone cannot open a path. This is deliberate defense-in-depth — losing either policy still leaves the other blocking. | ingress Enforced; egress In progress |-| N3 | **`llm-hooks` default-deny (both directions)** | The namespace begins in a deny-everything state: one NetworkPolicy selects all pods and governs both ingress **and** egress with no rules, so every hook pod is denied all inbound and all outbound by default. Every allowed flow is therefore something HCC explicitly opened; nothing is reachable, and no hook can reach out, unless a controller-generated policy permits it. Reply traffic on an already-accepted inbound connection is still allowed (connection tracking), so denying egress does not break a hook responding to an mcp-host. | ingress Enforced; egress Planned |-| N4 | **Mutual hook isolation** | A hook cannot initiate a connection to another hook, to any other pod in `llm-hooks`, or to any other namespace, unless HCC has added an explicit allow. On the receiving side, each hook's ingress admits only mcp-host pods — never other hooks — so hook-to-hook traffic is refused at the destination regardless of the source's intent. With default-deny-egress (N3), both the initiating and the receiving direction of hook-to-hook communication are closed. | ingress-dir Enforced; egress-dir Planned |-| N5 | **Allowlist-only hook egress** | When a hook legitimately needs to call out (e.g. a remote moderation API), each destination must be declared in its CRD `egressBindings`, which HCC validates (SSRF / private-range checks) before turning into an egress allow. There is **no implicit egress — not even DNS** — so a hook that declares nothing can reach nothing outbound. A hook's outbound surface is thus an explicit, reviewable allowlist rather than open internet access. | validation Enforced; default-deny-egress Planned |+| N1 | **CRD-scoped reach** | An mcp-host pod may open a connection to an installed hook **only** when its admin-authored Host CR lists that hook in `guardrails.hooks`. This is enforced at both ends: the host's egress policy permits only the hook pods/ports it references, and each hook's ingress policy admits only the mcp-hosts that reference it. A host that doesn't reference a hook is denied on both sides — it never appears in that hook's ingress allow, and the hook never appears in the host's egress allow. | Enforced |+| N2 | **Symmetric enforcement** | Reachability is gated independently on both sides of a connection: the source host must have an egress allow **and** the destination hook must have an ingress allow. The two policies live in different namespaces and are generated separately, so a bug or gap on one side alone cannot open a path. This is deliberate defense-in-depth — losing either policy still leaves the other blocking. | Enforced |+| N3 | **`llm-hooks` default-deny (both directions)** | The namespace begins in a deny-everything state: one NetworkPolicy selects all pods and governs both ingress **and** egress with no rules, so every hook pod is denied all inbound and all outbound by default. Every allowed flow is therefore something HCC explicitly opened; nothing is reachable, and no hook can reach out, unless a controller-generated policy permits it. Reply traffic on an already-accepted inbound connection is still allowed (connection tracking), so denying egress does not break a hook responding to an mcp-host. | Enforced |+| N4 | **Mutual hook isolation** | A hook cannot initiate a connection to another hook, to any other pod in `llm-hooks`, or to any other namespace, unless HCC has added an explicit allow. On the receiving side, each hook's ingress admits only mcp-host pods — never other hooks — so hook-to-hook traffic is refused at the destination regardless of the source's intent. With default-deny-egress (N3), both the initiating and the receiving direction of hook-to-hook communication are closed. | Enforced |+| N5 | **Allowlist-only hook egress** | When a hook legitimately needs to call out (e.g. a remote moderation API), each destination must be declared in its CRD `egressBindings`, which HCC validates (SSRF / private-range checks) before turning into an egress allow. There is **no implicit egress — not even DNS** — so a hook that declares nothing can reach nothing outbound. A hook's outbound surface is thus an explicit, reviewable allowlist rather than open internet access. | Enforced || N6 | **Remote guardrails reach only their domain** | A `remote` hook is dialed only at the `baseUrl` host declared in its CRD. The shared SSRF guard enforces this at the app layer: https-only, resolve-and-pin the host's public IP, reject private/loopback/link-local/metadata ranges, and follow no redirects — so the connection can only land on the declared host. A network-layer Calico FQDN policy was considered and deliberately **not** required; the app-layer pin is the accepted enforcement. | Enforced (app-layer) |-| N7 | **Least-privilege scoped policies** | All mcp-host↔`llm-hooks` communication rides narrowly-scoped, HCC-generated NetworkPolicies — never a namespace-wide or wildcard allow. Ingress policies are scoped to a specific hook pod (by pod-key or Service selector) and the exact port; egress policies are scoped to the specific hook pods a host references. The interim namespace-wide egress policy is being replaced by this per-host scoped version. | ingress Enforced; egress In progress |-| N8 | **Hardened, unprivileged hook pods** | Every hook container runs **non-root** with a **read-only root filesystem**, drops all Linux capabilities, forbids privilege escalation, uses the `RuntimeDefault` seccomp profile, and mounts **no** ServiceAccount token. HCC stamps these on the pod/container `securityContext` — they are not left to the image. This hardening is what makes pod-level (rather than strict per-hook) isolation acceptable under co-location (§12.5). | non-root/caps/seccomp/no-token Enforced; read-only-fs Planned |+| N7 | **Least-privilege scoped policies** | All mcp-host↔`llm-hooks` communication rides narrowly-scoped, HCC-generated NetworkPolicies — never a namespace-wide or wildcard allow. Ingress policies are scoped to a specific hook pod (by pod-key or Service selector) and the exact port; egress policies are scoped to the specific hook pods a host references. The interim namespace-wide egress policy is being replaced by this per-host scoped version. | Enforced |+| N8 | **Hardened, unprivileged hook pods** | Every hook container runs **non-root** with a **read-only root filesystem**, drops all Linux capabilities, forbids privilege escalation, uses the `RuntimeDefault` seccomp profile, and mounts **no** ServiceAccount token. HCC stamps these on the pod/container `securityContext` — they are not left to the image. This hardening is what makes pod-level (rather than strict per-hook) isolation acceptable under co-location (§12.5). | Enforced || N9 | **Secret isolation** | A hook's `envSecret` is resolved only within `llm-hooks` and can never name the mcp-host LLM key or any Host secret. Because hooks and their secrets are confined to their own namespace under scoped RBAC, one hook cannot read another hook's — or the platform's — credentials. Secret material never crosses the namespace boundary into a hook. | Enforced || N10 | **Runtime can't widen its own reach** | The per-Host mcp-host ServiceAccount may **read** (`get`/`list`/`watch`) `LlmHook` CRs only within its own **tenant-scoped** `llm-hooks` namespace — so it sees only its tenant's hooks (multi-tenant uses a per-tenant namespace prefix; cross-tenant isolation comes from that namespace boundary, not from withholding read) — and has **no write** verbs, so it cannot mutate any `Host`/`LlmHook` CR or touch any NetworkPolicy. A compromised mcp-host pod therefore cannot rewrite guardrail policy or open new network paths for itself; policy authorship stays entirely in the trusted control plane (control-api / HCC). | Enforced |-| N11 | **Fail-closed provisioning** | If HCC cannot build a correct scoped policy for a hook — e.g. the referenced Service has no selector, or a reference can't be resolved — it declines to create an over-broad allow and leaves the hook unreachable under the default-deny baseline. Reachability only appears when a precise allow is successfully provisioned; a provisioning failure fails **closed**, not open. (The separate hook-resolution fail-posture at load time is still open — see §12.4.) | NP-provisioning Enforced; resolution open |-| N12 | **No internal reach via broad egress** | The broad *external* egress lanes — mcp-host's `0.0.0.0/0:443\|80` LLM / `http_request` lane, and each hook's `egressBindings` — exclude the cluster pod/service/node CIDRs and all private/link-local/metadata/reserved ranges, so neither mcp-host nor a hook can reach a cluster-internal or metadata IP through them. Enforced by `ipBlock.except` on the mcp-host lane (the network mirror of the app-layer `isPrivateIp` guard, §8.3) and by `isAllowedExternalEgressCidr` validation of hook `egressBindings` at reconcile. Cluster-internal destinations stay reachable only through the narrow, explicit per-destination lanes. | hook `egressBindings` Enforced; mcp-host `except` Planned |+| N11 | **Fail-closed provisioning** | If HCC cannot build a correct scoped policy for a hook — e.g. the referenced Service has no selector, or a reference can't be resolved — it declines to create an over-broad allow and leaves the hook unreachable under the default-deny baseline. Reachability only appears when a precise allow is successfully provisioned; a provisioning failure fails **closed**, not open. (The separate hook-resolution fail-posture at load time is still open — see §12.4.) | Enforced |+| N12 | **No internal reach via broad egress** | The broad *external* egress lanes — mcp-host's `0.0.0.0/0:443\|80` LLM / `http_request` lane, and each hook's `egressBindings` — exclude the cluster pod/service/node CIDRs and all private/link-local/metadata/reserved ranges, so neither mcp-host nor a hook can reach a cluster-internal or metadata IP through them. Enforced by `ipBlock.except` on the mcp-host lane (the network mirror of the app-layer `isPrivateIp` guard, §8.3) and by `isAllowedExternalEgressCidr` validation of hook `egressBindings` at reconcile. Cluster-internal destinations stay reachable only through the narrow, explicit per-destination lanes. | Enforced |---