The Ingress Filter (src/main/services/proxy/ingress-filter.ts) scans HTTP response bodies for sensitive content before they reach the agent. It's the ingress half of the Latch Proxy's bidirectional enforcement.
Binary (skip):image/*, application/octet-stream, application/gzip, application/x-git-*, etc.
Unknown (null): Skip scanning
Binary responses still pass through domain/service gating and audit logging — only body scanning is skipped.
Scanning Pipeline
Check Content-Type → skip if binary
For each redaction pattern in the service definition, regex-match the body
Each match is tokenized via the session's TokenMap with same-origin metadata
Return processed body + statistics (tokenizations applied, redactions applied)
Key API
isScannable(contentType) — Classify a Content-Type header
scanResponse(contentType, body, service, endpoint) — Full scan pipeline
Token Same-Origin
Tokens created by the ingress filter carry { service, tier, endpoint } origin metadata. They can only be de-tokenized when sent back to the originating service. See the enclave-token-map skill for details.
Testing
Run: npx vitest run src/main/services/proxy/ingress-filter.test.ts
1---2name: enclave-ingress-filter3description: Enclave Ingress Filter4---5# Enclave Ingress Filter67## What This Module Does89The Ingress Filter (`src/main/services/proxy/ingress-filter.ts`) scans HTTP response bodies for sensitive content before they reach the agent. It's the ingress half of the Latch Proxy's bidirectional enforcement.1011## Content-Type Classification1213- **Scannable:** `text/*`, `application/json`, `application/xml`, `application/x-www-form-urlencoded`14- **Binary (skip):** `image/*`, `application/octet-stream`, `application/gzip`, `application/x-git-*`, etc.15- **Unknown (null):** Skip scanning1617Binary responses still pass through domain/service gating and audit logging — only body scanning is skipped.1819## Scanning Pipeline20211. Check Content-Type → skip if binary222. For each redaction pattern in the service definition, regex-match the body233. Each match is tokenized via the session's `TokenMap` with same-origin metadata244. Return processed body + statistics (tokenizations applied, redactions applied)2526## Key API2728- `isScannable(contentType)` — Classify a Content-Type header29- `scanResponse(contentType, body, service, endpoint)` — Full scan pipeline3031## Token Same-Origin3233Tokens created by the ingress filter carry `{ service, tier, endpoint }` origin metadata. They can only be de-tokenized when sent back to the originating service. See the `enclave-token-map` skill for details.3435## Testing3637Run: `npx vitest run src/main/services/proxy/ingress-filter.test.ts`
Run npx skillmds@latest add latchagent/enclave-ingress-filter in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Enclave Ingress Filter It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
latchagent (@latchagent) published this skill. Their other Agent Skills are listed on their SkillMD profile.