HackerPapers

arXiv:2510.11251cs.CR

CLASP: Training-Free LLM-Assisted Source Code Watermarking via Semantic-Preserving Transformations

Rui Xu, Jiawei Chen, Weizhi Liu, Zhaoxia Yin, Cong Kong, Xinpeng Zhang

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

The proliferation of open-source code and large language models (LLMs) for code generation has amplified the risks of unauthorized reuse and intellectual property infringement. Source code watermarking offers a potential solution, yet existing methods typically encode watermarks through identifiers, local code patterns, or limited handcrafted edits, leaving them vulnerable to renaming, refactoring, and adaptive watermark removal. These limitations hinder the joint achievement of robustness, capacity, generalization, and deployment efficiency. We propose CLASP, a Code LLM-Assisted Semantic-Preserving watermarking framework that enables training-free, plug-and-play watermarking for source code. CLASP embeds watermark bits within a fixed space of semantics-preserving transformations, enabling automated watermark insertion with higher capacity while remaining reusable across programming languages and less dependent on brittle lexical features. To recover the watermark, CLASP uses reference-code retrieval and differential comparison to identify transformation traces, avoiding task-specific model training while improving robustness to structural edits and adaptive attacks. Experiments across multiple programming languages show that CLASP consistently outperforms existing baselines in watermark extraction accuracy and robustness, while maintaining code quality under both random removal and adaptive de-watermarking attacks.

arXiv comments
Journal reference
DOI
Subjects
cs.CRCryptography and Security cs.AIArtificial Intelligence cs.LGMachine Learning

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Jul 2026 to Jul 2026.

Comments linking this paper, per year.

Discussed in comments1 thread

    • A weekend project about LLM guardrails, copyright, and why proving your code is yours turned out to be a lot more complex than it should be. This is a firsthand look into an experimental weekend project, not legal advice. If any of this matters to your actual business, talk to…

      vektormemoryView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.