feat: add anti-track / anti-upgrade module#8
Open
Malkovich-666 wants to merge 6 commits intolingcoder:mainfrom
Open
feat: add anti-track / anti-upgrade module#8Malkovich-666 wants to merge 6 commits intolingcoder:mainfrom
Malkovich-666 wants to merge 6 commits intolingcoder:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces an Anti-Track / Anti-Upgrade module to
crab-code, giving users control over telemetry, version checks, and request sanitization.What’s added
crates/api/src/anti_track.rs— New module providing:AntiTrackConfig(exposed fromcrab_config) with switches for:disable_version_checkdisable_telemetrydisable_update_checkblock_tracking_domainsspoof_version+ customspoofed_versiondisable_crash_reportsdisable_feedbacksanitize_request()— strips tracking headers (X-Claude-Client-Version,X-Analytics, etc.) and optionally spoofsUser-Agent.should_block_url()— blocks known tracking domains (e.g.telemetry.anthropic.com,api.segment.io) and version-check endpoints.crates/config/src/settings.rs— AddsAntiTrackConfigstruct andanti_track: Option<AntiTrackConfig>toSettings, with proper three-level merge support.crates/api/src/lib.rs— Exposespub mod anti_trackand wiressettings.anti_trackintocreate_backend().crates/api/src/anthropic/client.rs&crates/api/src/openai/client.rs— Integrates anti-track sanitization into every outgoing HTTP request (stream,send,list_models,health_check).How to use
Add to
~/.crab/settings.json:{ "antiTrack": { "disableTelemetry": true, "disableUpdateCheck": true, "blockTrackingDomains": true, "spoofVersion": true, "spoofedVersion": "1.0.0" } }Design notes
rusty-ai-cli(a Rust rewrite of Claude Code).crab-code’s existing crate boundaries (crab_configfor settings,crab_apifor request sanitization) and keeps API-client changes minimally invasive.Checklist
None, no behavior change unless configured)