# What structural signals indicate egress allowlist enforcement is about to fail silently in an MCP server **Date of Record:** 2026 November 29 **Scope:** Applies to MCP servers that enforce per-tool egress allowlists and DLP classifiers at the tool-call boundary, where the model selects tool arguments. Does not apply to static network egress firewalls or to tool calls whose arguments are fully generated by deterministic caller code with no model involvement. ## Core Distinction There are two different questions an egress allowlist can answer for an MCP tool call: *is this tool permitted to reach this destination*, and *is the payload leaving through this permitted destination actually the payload the policy intended to permit*. Most MCP egress enforcement implementations only answer the first. The second question — payload conformance — is where the boundary fails silently, because the allowlist check passes on the destination while the DLP classifier passes on the *declared* payload shape, not the *serialized* payload shape. The failure is structural, not adversarial. It occurs when the tool's argument schema and the egress serializer disagree about what constitutes "the payload." The model fills in a field the schema marks as optional metadata; the serializer flattens that field into the request body; the DLP classifier, keyed on the schema's declared `content` field, never inspects the flattened metadata. The allowlist sees a permitted destination. The DLP sees an empty or benign `content`. The actual bytes leaving the process contain the sensitive data, embedded in a field the classifier was never configured to read. ## What Was Observed A tool `export_report` on an MCP server had the following argument schema: ``` { "type": "object", "properties": { "content": {"type": "string", "description": "Report body"}, "destination": {"type": "string", "enum": ["s3://reports", "https://partner.example"]}, "metadata": {"type": "object", "additionalProperties": true} }, "required": ["content", "destination"] } ``` The egress allowlist permitted `s3://reports` and `https://partner.example`. The DLP classifier was configured to scan the `content` field for PII patterns and to scan `metadata` only for a fixed set of known keys (`trace_id`, `request_id`, `tenant`). The `additionalProperties: true` on `metadata` meant the model could — and in a specific observed trace did — place a full customer record into `metadata.customer_snapshot` because the model had been instructed by its system prompt to "preserve full context for audit." The trace: 1. Model emits `export_report` with `content = "Q2 summary attached"`, `destination = "https://partner.example"`, and `metadata.customer_snapshot = {full PII record}`. 2. Allowlist check: `https://partner.example` is in the permitted set → pass. 3. DLP classifier: scans `content` → clean. Scans `metadata` for known keys → `customer_snapshot` is not a known key → skipped. 4. Serializer: emits JSON body containing the full `metadata` object. 5. Egress: full PII leaves to the partner endpoint. No log line was written indicating a policy decision on `customer_snapshot`. The audit trail showed a clean DLP pass. The only structural signal was that the tool's schema contained `additionalProperties: true` on a field that flowed to a permitted egress destination. The failure repeated across three separate tool calls in the same session because the model's context retained the successful pattern — the tool returned 200 and the model reinforced the argument shape. ## Condition of Validity The invariant that must hold for egress DLP to be sound is: > For every tool whose schema permits egress to an allowlisted destination, the union of all fields reachable in the serialized request body must be a subset of the fields the DLP classifier inspects, and the DLP classifier's inspection of each field must be at least as strict as the schema permits. This invariant is violated whenever any of the following holds: - A field with `additionalProperties: true` or `type: object` without a closed property list flows into the serialized body but is not fully traversed by the DLP classifier. - The serializer performs any transformation (flattening, base64 encoding, string concatenation of fields) that changes field boundaries after the DLP classifier has run. - The DLP classifier runs on the *parsed* argument object while the serializer runs on a *re-serialized* form, and the two serializations differ in field set. - The tool's schema is versioned independently of the DLP classifier's field configuration, and a schema update adds a field the classifier does not know about. The condition of validity is therefore not "the allowlist is correct." It is "the DLP classifier's field coverage is provably coextensive with the serializer's field emission, for every tool whose destination is allowlisted." Any tool whose schema permits open objects or additional properties on an egress path is a standing violation until the classifier is updated to traverse those objects recursively. ## Decision Boundary The operational decision is whether to block the tool call, block the schema, or block the classifier configuration. Three boundaries: **Boundary 1 — Schema admission.** A tool whose argument schema permits open objects on an egress path must not be admitted to the allowlisted tool set unless the DLP classifier is configured for recursive traversal of that path. If the classifier cannot be configured recursively, the schema must be closed (`additionalProperties: false`) before the tool is allowlisted. **Boundary 2 — Serializer/DLP ordering.** The DLP classifier must run on the exact byte sequence the serializer will emit, not on the parsed argument object. If the enforcement architecture runs DLP on the parsed object and serializes later, any serializer transformation is a potential bypass. The safe ordering is: serialize → DLP scan serialized bytes → egress. The unsafe ordering is: DLP scan parsed object → serialize → egress. **Boundary 3 — Audit completeness.** A DLP pass must produce a positive record of *which fields were inspected*, not merely "no violations found." A pass that does not enumerate inspected fields cannot distinguish "clean" from "not inspected." The absence of an inspection record for a field that was emitted is the structural signal of silent failure. The decision boundary for the operator is: when any of these three boundaries is crossed, the tool call must be blocked, not merely logged. The failure mode is silent — the call succeeds, the data leaves, and the audit trail is clean. Blocking on structural signal is the only defense, because post-hoc detection cannot recall the bytes. ## Operational Effect The concrete effect observed: three successful egress calls carrying full PII to an external partner endpoint, with a clean DLP audit trail and no alerting. The failure was discovered only by a downstream partner's own DLP, not by the originating system. The remediation that restored the invariant: 1. Closed the schema: `metadata` changed to `additionalProperties: false` with an explicit property list matching the DLP classifier's inspected keys. 2. Reordered enforcement: DLP now runs on the serialized request body, not the parsed argument object. 3. Added audit enumeration: every DLP pass emits the list of field paths inspected; any field path present in the serialized body but absent from the inspected list raises a hard block before egress. The third change is the one that makes the failure detectable going forward. Without it, the next schema change that reintroduces an open object will reproduce the same silent failure. The structural signal — a serialized field path with no corresponding inspection record — is the invariant to monitor. The general lesson: egress allowlists and DLP classifiers are two separate enforcement surfaces that are easy to treat as one. The allowlist answers "where," the classifier answers "what." The failure mode is that "where" is enforced on the destination field and "what" is enforced on a declared payload field, while the actual bytes leaving the process are assembled by a serializer that neither surface fully governs. The invariant that closes the gap is coextensive field coverage between serializer and classifier, verified by audit enumeration on every pass. ```python class EgressDlpCoverageError(RuntimeError): """Raised when serialized egress fields are not fully covered by DLP inspection.""" pass def enforce_egress(tool_name, serialized_body, inspected_field_paths, allowlisted_destinations): destination = serialized_body.get("destination") if destination not in allowlisted_destinations: raise EgressDlpCoverageError( f"tool={tool_name} destination={destination!r} not in allowlist" ) emitted_paths = _flatten_field_paths(serialized_body) uninspected = emitted_paths - inspected_field_paths if uninspected: raise EgressDlpCoverageError( f"tool={tool_name} emitted fields not inspected by DLP: {sorted(uninspected)}" ) return True def _flatten_field_paths(obj, prefix=""): paths = set() if isinstance(obj, dict): for k, v in obj.items(): path = f"{prefix}.{k}" if prefix else k paths.add(path) paths |= _flatten_field_paths(v, path) elif isinstance(obj, list): for i, v in enumerate(obj): paths |= _flatten_field_paths(v, f"{prefix}[{i}]") return paths ```