AI Scraping Defense Rust is a defensive service stack for detecting, throttling, deceiving, and blocking unwanted AI crawlers and automated scraping traffic. It combines request scoring, Redis-backed blocklists, webhook-driven security actions, tarpit content generation, CAPTCHA challenges, payment-aware crawler access, provider-aware model routing, admin operations, and edge automation services into a deployable Rust workspace.
The project is designed for operators who need a fast, explicit, service-based control plane around bot detection and response. It can run locally with Cargo, as a Docker Compose stack, or as Kubernetes/Helm workloads.
Implemented baseline services:
escalation-engine:/escalate,/metrics,/admin/reload_pluginsai-service:/health,/webhooktarpit-api:/health,/,/tarpit/*pathadmin-ui: dashboard, settings, logs, plugins, blocklist endpointscaptcha-service:/challenge,/solve,/verifycloud-dashboard: installation registration and metrics fanout endpointscloud-proxy:/health,/api/chatconfig-recommender:/recommendationsedge-ops: robots/rules fetching, WAF/CDN/TLS/DDoS operations, blocklist syncpay-per-crawl: crawler registration, payment, proxy chargingprompt-router:/health,/routepublic-blocklist:/list,/list/auth,/reportrag-trainer: request labeling, training ingest, fine-tuning JSONL export
The codebase also tracks API and deployment compatibility with the original Python ai-scraping-defense implementation. See docs/PARITY.md for the current parity map.
crates/asd-core: shared config, health responses, HMAC, blocklist statecrates/asd-detection: feature extraction, fingerprinting, scoringcrates/asd-tarpit: deterministic tarpit page and fake asset generationservices/*: one binary per runtime serviceconfig/: sample runtime configurationdocker-compose.yaml: local stack similar to the Python compositionkubernetes/andhelm/: starter deployment artifacts
cp config/sample.env .env
cargo run -p escalation-engineRun the local stack:
docker compose up --buildRun a health smoke check against the default ports:
.\scripts\parity_smoke.ps1Detailed setup, configuration, API examples, Docker, and Kubernetes usage are in docs/USAGE.md.
Tagged releases publish:
ghcr.io/rhamenator/ai-scraping-defense-rustcontainer images for the full multi-service runtime image.- Linux x64 release bundles containing all service binaries plus checksums.
Push a tag such as v1.0.0 to publish a stable image with version, minor, and latest tags. Prerelease tags such as v1.0.0-rc.1 publish prerelease image and binary assets without moving latest.
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspaceIf Windows reports a missing Rust toolchain manifest, repair or reinstall the pinned toolchain first:
rustup toolchain uninstall 1.88.0-x86_64-pc-windows-msvc
rustup toolchain install 1.88.0-x86_64-pc-windows-msvcThis project is licensed under the GNU General Public License v3.0 or later. See LICENSE.