Commit 19ad536
authored
W-1: Detect direct API bypass in integrity audit + add reusable MCP routing constraint (#3134)
The 2026-04-03 integrity audit flagged the AI Moderator workflow making
3 direct network calls to `api.github.com`, `github.com`, and
`chatgpt.com`, bypassing the MCP Gateway entirely — breaking DIFC
enforcement and making data access unauditable.
## `integrity-filtering-audit.md`
- **Background**: adds "direct API bypass attempts" as an explicit
problem category (firewall blocks = signal)
- **Step 3.6**: new detection step with targeted bash patterns to
surface bypass attempts from logs:
```bash
grep -iE 'api\.github\.com|chatgpt\.com|openai\.com|curl.*https?://[^
]*github|fetch.*https?://[^ ]*github' \
"$TMPDIR"/*/mcp-logs/*.log 2>/dev/null | head -30
```
- **Step 4**: extends W-1 Warning classification to cover direct API
bypass with likely causes (`difc-proxy: true` missing, weak prompt,
misconfigured `network.allowed`) and fix pointer
- **Issue template**: Runs Analyzed table gains "Agent Invoked" +
"Firewall Blocks" columns (matching the actual report format);
Recommendations section now requires bypass investigation checklist
- **Front matter**: imports `shared/mcp-api-routing.md` so the audit
agent itself is subject to the same constraint
## `shared/mcp-api-routing.md` (new)
Reusable prompt constraint importable by any workflow (`imports: -
shared/mcp-api-routing.md`). Covers:
- Hard prohibition on `curl`/`gh api`/`fetch` to `api.github.com` or
external AI services
- ✅/❌ usage examples
- Why bypassing breaks DIFC (no integrity labels → no scope enforcement)
- Pre-call checklist (MCP tool, allowed-repos, difc-proxy, no external
AI)2 files changed
Lines changed: 103 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| |||
110 | 115 | | |
111 | 116 | | |
112 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
113 | 129 | | |
114 | 130 | | |
115 | 131 | | |
| |||
119 | 135 | | |
120 | 136 | | |
121 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
122 | 148 | | |
123 | 149 | | |
124 | 150 | | |
| |||
127 | 153 | | |
128 | 154 | | |
129 | 155 | | |
130 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
131 | 160 | | |
132 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
133 | 170 | | |
134 | 171 | | |
135 | 172 | | |
| |||
159 | 196 | | |
160 | 197 | | |
161 | 198 | | |
162 | | - | |
| 199 | + | |
| 200 | + | |
163 | 201 | | |
164 | 202 | | |
165 | 203 | | |
| |||
172 | 210 | | |
173 | 211 | | |
174 | 212 | | |
175 | | - | |
176 | | - | |
177 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
178 | 216 | | |
179 | 217 | | |
180 | 218 | | |
181 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
182 | 224 | | |
183 | 225 | | |
184 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
0 commit comments