Do Not Copy/Paste: Soft Barriers for Copying in AI-Assisted Programming
Organizations: University of Luxembourg Luxembourg, Luxembourg
Abstract
Copying a function from a chat window into an editor takes less than a second. For many uses of AI coding tools, that speed is the point; in settings such as programming education, code review, and security-sensitive development, it can also be the problem. This paper frames copy-paste as an AI code handoff problem: the moment model-generated text crosses from a conversational context into executable or committed software is a design boundary that current tools leave largely unmanaged. We argue that AI coding assistants should not only be evaluated by the code they generate, but also by how they mediate the transfer of that code into software artifacts. We propose soft barriers as one class of handoff-aware mechanisms. Soft barriers preserve access to AI assistance while making unexamined transfer less frictionless. As an initial technical probe, we instantiate this idea using Unicode output perturbations that preserve visual readability but disrupt naive copy-paste execution. We introduce Copy-Paste Resistance (CPR), the fraction of functionally correct clean solutions that become syntactically invalid after perturbation. Across HumanEval and MBPP with four LLMs and four perturbation families, we find that output-level barriers can achieve high copy-paste resistance, but their effectiveness is highly model- and task-dependent. An exploratory pilot with 18 participants provides early evidence that soft barriers can shift users from direct transfer toward editing and reconstruction. We do not present Unicode perturbations as a deployment-ready solution; rather, we use them as a minimal probe for a broader research agenda on practical, transparent, and policy-aware AI code handoff.
Figures & tables
| Handoff type | Mechanism |
| Direct | Code transfers immediately with no intervention |
| Explanation-first | Assistant provides reasoning before code; promotes inspection |
| Soft-barrier | Code is readable but naive copy-paste execution fails |
| Review-gated | Transfer requires a summary, test, or confirmation step |
| Test-gated | Insertion is blocked until the learner runs or writes tests |
| Provenance-marked | Generated code carries metadata for attribution or auditing |
| Family | Mechanism |
| Invisible chars | Zero-width characters (U+200B, U+200C, U+200D) inside identifiers |
| Homoglyphs | ASCII letters replaced by visually identical Unicode equivalents |
| BIDI reordering | Directionality overrides (U+202E, U+202D) altering internal byte order |
| Deletions | Backspace/delete controls (U+0008) erasing adjacent rendered characters |
| Dataset | Intervention | Claude | DeepSeek | GPT-5.2 | Codex |
| HumanEval | Deletion | 0.846 | 0.040 | 0.350 | 0.330 |
| Homoglyph | 0.008 | 0.640 | 0.196 | 0.130 | |
| Invisible chars | 0.766 | 0.248 | 0.846 | 0.773 | |
| Reordering | 0.943 | 0.064 | 0.316 | 0.373 | |
| MBPP | Deletion | 0.982 | 0.011 | 0.010 | 0.090 |
| Homoglyph | 0.986 | 0.796 | 0.000 | 0.005 |
| Task 1 | Task 2 | |||
| Metrics | Groups | A | B | A | B |
| Copied directly | 3.83 | 5.00 | 3.17 | 5.00 |
| Modified code | 4.00 | 1.00 | 3.67 | 1.00 |
| Understood code | 4.50 | 3.00 | 4.00 | 2.00 |
| Felt frustrated | 1.67 | 1.00 | 1.83 | 1.00 |
| Helped learn | 4.00 | 2.83 | 5.00 | 3.50 |
Human-AI Collaboration
Human-AI collaboration studies how people and AI systems divide, coordinate, and adapt work to support decisions, creativity, and learning.
See all 446 papers