Skip to content

fix: harden Anthropic proxy shape guard - #32

Merged
ppiankov merged 29 commits into
mainfrom
wo-419/proxy-shape-guard-recovery
Jul 15, 2026
Merged

fix: harden Anthropic proxy shape guard#32
ppiankov merged 29 commits into
mainfrom
wo-419/proxy-shape-guard-recovery

Conversation

@ppiankov

@ppiankov ppiankov commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary\n- fail closed on unsupported methods and malformed request shapes while preserving valid Anthropic-compatible gateway paths\n- treat model identity as advisory so any provider speaking the Anthropic wire shape remains supported\n- route request mutation through one evidence-aware gateway: exact provider formats, known values, and operator rules authorize replacement\n- scan contract fields without rewriting uncertain built-in matches; scan tool input examples and stop sequences under the same policy\n- detect standalone provider tokens and contain complete structured secrets without overcapturing adjacent content\n- tighten legacy Vault token grammar so code-like dotted identifiers are never mutated\n- fail closed on malformed private-key containers, invalid routed-proxy custom rules, and request-body serialization failures\n- let non-routed agents launch without validating proxy rules they do not consume\n- harden launch loopback cleanup, termination handling, refusal accounting, and disconnect logging\n- document evidence-based mutation scope and one-way proxy versus reversible MCP behavior\n\n## Work orders\nImplemented: WO-275, WO-410, WO-419, WO-422-WO-430, WO-436-WO-458, WO-461-WO-463, WO-465-WO-470, WO-472, WO-473, WO-478-WO-488, WO-491, WO-494, WO-495.\n\nReviewed and rejected as invalid or already covered: WO-489, WO-490, WO-492, WO-493, WO-496, WO-497, WO-498.\n\n## Verification\n- 954 Swift tests pass locally\n- mutation authorization, provider-pattern, containment, shape-guard, launch, and real-TCP regressions pass\n- debug build passes\n- SwiftLint strict reports 0 violations\n- GitHub CI is running on the current head\n

ppiankov added 29 commits July 14, 2026 20:48
Caller-audit:
Sources/PastewatchCLI/LaunchCommand.swift:216 -- updated
Sources/PastewatchCLI/LaunchCommand.swift:277 -- updated
Tests/PastewatchTests/LaunchCommandTests.swift:60 -- unaffected default quiet argument preserves direct test call
Sources/PastewatchCore/ProxyServer.swift:738 -- updated
Sources/PastewatchCore/ProxyServer.swift:743 -- updated
Tests/PastewatchTests/ProxyAlertTests.swift:222 -- updated
Tests/PastewatchTests/ProxyAlertTests.swift:242 -- updated
Sources/PastewatchCore/ProxyServer.swift:119 -- unaffected additive stats field
Sources/PastewatchCore/ProxyServer.swift:695 -- updated
Tests/PastewatchTests/ProxyRealServerTests.swift:572 -- updated
Caller-audit:
Sources/PastewatchCore/ProxyServer.swift:707 -- updated
Sources/PastewatchCore/ProxyServer.swift:1127 -- unaffected
Sources/PastewatchCore/ProxyServer.swift:1204 -- updated
Tests/PastewatchTests/ProxyBodyShapeGuardTests.swift:24 -- updated
Tests/PastewatchTests/ProxyRealServerTests.swift:685 -- updated
Caller-audit:
Sources/Pastewatch/ClipboardMonitor.swift:126 -- unaffected
Sources/PastewatchCLI/GuardCommand.swift:43 -- unaffected
Sources/PastewatchCLI/ScanCommand.swift:155 -- unaffected
Sources/PastewatchCore/SocketHelpers.swift:117 -- unaffected
Sources/PastewatchCore/ProxyServer.swift:750 -- updated
@ppiankov
ppiankov merged commit c1e0304 into main Jul 15, 2026
7 checks passed
@ppiankov
ppiankov deleted the wo-419/proxy-shape-guard-recovery branch July 19, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant