> For the complete documentation index, see [llms.txt](https://help.codegrade.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.codegrade.com/setup-assignment/other-features/copy-paste-limit-in-editor.md).

# Copy-Paste Limit in Editor

When students write code in CodeGrade's in-browser editor, you can now set an upper limit on how much text they can paste at once. This discourages students from pasting in code they didn't write, for example from AI tools or from other students.

<div align="center"><figure><img src="/files/vNUFp7cCh0QayFgpypgt" alt="The &#x22;Allow copy-pasting&#x22; slider in the Submission settings" width="375"><figcaption><p>The "Allow copy-pasting" slider in the Submission settings</p></figcaption></figure></div>

#### How the paste limit works

* By default, copy-pasting is **Unlimited** and students can paste freely.
* Moving the slider towards **Strictest** lowers the maximum number of characters students can paste at once in the editor.
* At the strictest setting, pasting is blocked completely.
* The limit only applies to students. Staff can always copy-paste in the editor.

{% hint style="warning" %}
This feature deters students from copying and pasting, but does not entirely prevent it. Students can still type code over from another screen. For high-stakes assessments, combine it with exam features covered in [Running Secure Exams](/setup-assignment/other-features/running-secure-exams.md).
{% endhint %}

#### Setting a paste limit

1. Go to the **Assignment Settings** page of your assignment.
2. Under the **General** tab, locate the **Submission settings** section.
3. Make sure the **Editor** submit method is enabled. The paste limit only applies to the in-browser editor, not to the File uploader or Git submissions.
4. Drag the **Allow copy-pasting** slider to the limit you want, from **Unlimited** to **Strictest**. The selected limit (e.g. "Up to 30 characters") is shown above the slider.
5. Click **Save** to apply your changes.

{% hint style="info" %}
Use [Student View](/setup-assignment/build-assignment/student-view.md) to preview what your students will see when they try to paste more than the limit.
{% endhint %}

#### What students see

When a student tries to paste text that exceeds the limit, the paste is blocked and a message explains what they can do instead:

<div><figure><img src="/files/BZsC4IxosGwCAw5ayOkr" alt="Pasting more than the character limit" width="316"><figcaption><p>Pasting more than the character limit</p></figcaption></figure> <figure><img src="/files/l1sokbZK90Omz0Wjjuof" alt="" width="311"><figcaption><p>Pasting turned off entirely</p></figcaption></figure></div>

If pasting is blocked completely, students are asked to type their code in instead.
