@@ -39,6 +39,8 @@ safe-outputs:
3939timeout-minutes : 20
4040features :
4141 difc-proxy : true
42+ imports :
43+ - shared/mcp-api-routing.md
4244---
4345
4446# Integrity Filtering Audit
@@ -60,6 +62,9 @@ Common problems to look for:
6062- ** Unscoped integrity tags** (e.g., ` approved ` instead of ` approved:owner/repo ` )
6163- ** Empty responses** where data was expected (over-filtering)
6264- ** Search result leaks** where out-of-scope items appear in filtered results
65+ - ** Direct API bypass attempts** where an agent contacts ` api.github.com ` , ` github.com ` ,
66+ or external AI services (e.g., ` chatgpt.com ` , ` openai.com ` ) without going through
67+ the MCP Gateway — these show up as network firewall blocks in the job logs
6368
6469## Procedure
6570
@@ -110,6 +115,17 @@ For each downloaded artifact set, check:
1101155 . ** Scope violations** : Check if any response contains data from repositories
111116 NOT in the workflow's ` allowed-repos ` policy.
112117
118+ 6 . ** Direct API bypass attempts** : Search job logs and stderr for network firewall
119+ blocks that reveal the agent trying to reach external domains directly instead
120+ of through the MCP Gateway. Key domains to flag:
121+ - ` api.github.com ` — GitHub API (must go through MCP Gateway, not curl/fetch)
122+ - ` github.com ` — GitHub web (should not be contacted directly)
123+ - ` chatgpt.com ` , ` openai.com ` , ` api.openai.com ` — external AI services
124+ - Any other non-allowlisted HTTP endpoint
125+
126+ For each block, record: the blocked domain, the number of block events, which
127+ workflow run, and what step appears to have triggered it.
128+
113129``` bash
114130# Example: Count DIFC events in JSONL
115131grep -c ' difc_integrity' " $TMPDIR " /* /mcp-logs/rpc-messages.jsonl 2> /dev/null || echo " 0"
@@ -119,6 +135,16 @@ grep -iE 'error|failed|blocked|unknown|wasm error:|WASM guard trap' "$TMPDIR"/*/
119135
120136# Example: Specifically search for WASM guard panics
121137grep -iE ' wasm error:|WASM guard trap|unreachable' " $TMPDIR " /* /mcp-logs/mcp-gateway.log 2> /dev/null
138+
139+ # Example: Detect direct API bypass attempts in job logs
140+ # The network firewall logs blocked connections; search agent stderr/stdout for clues
141+ grep -iE ' api\.github\.com|chatgpt\.com|openai\.com|curl.*https?://[^ ]*github|fetch.*https?://[^ ]*github' \
142+ " $TMPDIR " /* /mcp-logs/* .log 2> /dev/null | head -30
143+
144+ # Example: Summarize firewall blocks by domain from network-firewall logs (if present)
145+ grep -iE ' BLOCK|DENY|firewall' " $TMPDIR " /* /mcp-logs/* .log 2> /dev/null \
146+ | grep -oE ' (api\.github\.com|github\.com|chatgpt\.com|openai\.com|[a-z0-9.-]+\.[a-z]{2,})' \
147+ | sort | uniq -c | sort -rn | head -20
122148```
123149
124150### Step 4: Classify Findings
@@ -127,9 +153,20 @@ Classify each finding by severity:
127153- 🔴 ** Critical** : Data leak (out-of-scope data returned), guard bypass, or
128154 labeling failure that could expose unauthorized data
129155- 🟡 ** Warning** : Over-filtering (legitimate data blocked), unscoped tags,
130- zero DIFC events in a run that should have filtering, or WASM guard trap
156+ zero DIFC events in a run that should have filtering, WASM guard trap, or
157+ ** direct API bypass attempt** (agent contacted ` api.github.com ` , ` github.com ` ,
158+ or an external AI service such as ` chatgpt.com ` / ` openai.com ` directly instead
159+ of routing through the MCP Gateway — visible as network firewall blocks)
131160- 🟢 ** Info** : Normal filtering behavior, expected blocks, or configuration notes
132161
162+ When classifying a ** direct API bypass** warning (W-1), record:
163+ - The blocked domain(s) and block count
164+ - The workflow name and run ID
165+ - The likely cause: misconfigured ` network.allowed ` list, agent prompt not
166+ restricting tool use, or the workflow missing ` features.difc-proxy: true `
167+ - Recommended fix: strengthen agent system prompt to use MCP Gateway tools
168+ exclusively; see ` shared/mcp-api-routing.md ` for reusable constraint language
169+
133170### Step 5: Create Summary Issue
134171
135172Create an issue with the audit results using the following structure:
@@ -159,7 +196,8 @@ Create an issue with the audit results using the following structure:
159196<details >
160197<summary ><b >Warnings</b ></summary >
161198
162- [ Details of each warning]
199+ [ Details of each warning — for direct API bypass (W-1) warnings include: blocked
200+ domain(s), block count, workflow name, likely cause, and recommended fix]
163201
164202</details >
165203
@@ -172,13 +210,17 @@ Create an issue with the audit results using the following structure:
172210
173211### Runs Analyzed
174212
175- | Run | Workflow | Branch | DIFC Events | Filtered | Status |
176- | -----| ----------| --------| -------------| ----------| --------|
177- | [ §ID] ( run_url ) | name | branch | N | N | ✅/⚠️/❌ |
213+ | Run | Workflow | Branch | Agent Invoked | DIFC Events | Firewall Blocks | Status |
214+ | -----| ----------| --------| --------------- | ------------- | ------- ----------| --------|
215+ | [ §ID] ( run_url ) | name | branch | ✅/❌ early-exit | N | N/total | ✅/⚠️/❌ |
178216
179217### Recommendations
180218
181- [ Actionable suggestions based on findings]
219+ [ Actionable suggestions based on findings. For direct API bypass (W-1) findings,
220+ always include: 1) which workflow to investigate, 2) whether it has
221+ ` features.difc-proxy: true ` , 3) whether the agent prompt restricts tool use to
222+ MCP Gateway tools, and 4) a pointer to ` shared/mcp-api-routing.md ` for reusable
223+ constraint language to add to the workflow prompt.]
182224```
183225
184226If there are no findings (all runs look healthy), still create the issue with
0 commit comments