Nightshade
AI companies scrape public code to train their models, usually without asking the people who wrote it.
Nightshade gives developers a way to fight back. It rewrites your source code so it still compiles and passes tests for humans and machines, but is designed to become low-quality, "poisoned" training material for any AI that scrapes it. Your code keeps working; the scraper gets noise.
Eight obfuscation strategies (including misleading identifier renames, plausible dead-code injection, comment poisoning, string encoding, control-flow flattening, and a steganographic watermark that can prove ownership) applied through a weighted entropy pipeline over an AST/lexer, designed to alter token-level similarity and reduce near-duplicate matching under evaluated conditions. Built for Java first, with Python and JavaScript support, it ships as a CLI, a GitHub Action, and a pre-commit hook. Named in homage to the Nightshade image-poisoning research project, this applies the same idea to source code. Co-created with Saif-ur-Rehman.
Released at v3.5.0 with a JUnit 5 test suite and a hardened release pipeline: SLSA provenance, Sigstore signing, an SBOM, and CodeQL scanning.
This project taught me compiler-level engineering: lexing, AST manipulation, and what it actually takes to verify (not just assume) that a transformation preserves behavior. No obfuscation tool is 100% effective; the goal is raising the cost of scraping, not making it impossible.
Related projects
A real-time WebGL2 particle simulation (up to 110,000 GPU particles) driven by hand gestures and live audio, running ...
A ChatGPT-style assistant that answers UET students' questions (admissions, fees, courses) using real university data...
Need compiler-level or AST tooling work? →
Hire Ibrahim / Discuss Scope