Commit 8a0a084
feat(security): add data flow security with agent hook integration (Spec 027)
Detect and prevent data exfiltration by tracking how data flows between
internal tools (Read, databases) and external tools (WebFetch, Slack).
Operates in two modes: proxy-only (universal, any agent) and full mode
with agent hook integration for intercepting agent-internal tool calls.
Key components:
- Tool/server classifier with internal/external/hybrid/unknown categories
- Content hasher using SHA256 per-field extraction for flow matching
- Flow tracker with session-scoped origin recording and edge detection
- Policy evaluator with configurable actions (allow/warn/ask/deny)
- Session correlator linking agent hook sessions to MCP proxy sessions
- Hook CLI commands (install/uninstall/status/evaluate) for Claude Code
- POST /api/v1/hooks/evaluate REST endpoint
- Activity logging for hook_evaluation and flow_summary event types
- Web UI nudge system for hook installation when in proxy-only mode
- E2E tests for both proxy-only and hook-enhanced flow detection
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 29cf86e commit 8a0a084
55 files changed
Lines changed: 9829 additions & 11 deletions
File tree
- cmd/mcpproxy
- frontend/src
- stores
- types
- views
- internal
- config
- contracts
- httpapi
- management
- runtime
- security/flow
- server
- storage
- oas
- specs/027-data-flow-security
- checklists
- contracts
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
64 | 75 | | |
65 | 76 | | |
66 | 77 | | |
| |||
105 | 116 | | |
106 | 117 | | |
107 | 118 | | |
| 119 | + | |
108 | 120 | | |
109 | 121 | | |
110 | 122 | | |
| |||
194 | 206 | | |
195 | 207 | | |
196 | 208 | | |
| 209 | + | |
197 | 210 | | |
198 | 211 | | |
199 | 212 | | |
| |||
379 | 392 | | |
380 | 393 | | |
381 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
382 | 452 | | |
383 | 453 | | |
384 | 454 | | |
| |||
471 | 541 | | |
472 | 542 | | |
473 | 543 | | |
| 544 | + | |
| 545 | + | |
474 | 546 | | |
475 | 547 | | |
476 | 548 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| |||
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
| 88 | + | |
| 89 | + | |
84 | 90 | | |
85 | 91 | | |
86 | 92 | | |
| |||
144 | 150 | | |
145 | 151 | | |
146 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
147 | 183 | | |
148 | 184 | | |
149 | 185 | | |
| |||
213 | 249 | | |
214 | 250 | | |
215 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
216 | 259 | | |
217 | 260 | | |
218 | 261 | | |
| |||
706 | 749 | | |
707 | 750 | | |
708 | 751 | | |
709 | | - | |
| 752 | + | |
710 | 753 | | |
711 | 754 | | |
712 | 755 | | |
| |||
722 | 765 | | |
723 | 766 | | |
724 | 767 | | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
725 | 771 | | |
726 | 772 | | |
727 | 773 | | |
| |||
816 | 862 | | |
817 | 863 | | |
818 | 864 | | |
| 865 | + | |
| 866 | + | |
819 | 867 | | |
820 | 868 | | |
821 | 869 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
420 | 431 | | |
421 | 432 | | |
422 | 433 | | |
| |||
0 commit comments