Karam's blog

By Karam, history, 3 months ago, In English

AI Cheating Prevention During Contests

Hello everyone,

With the rapid advancement of AI tools, maintaining fair competition has become increasingly challenging. While no technical solution can completely eliminate cheating, I believe there are several measures that could significantly increase the effort required to misuse AI during live contests.

I would like to propose adding an optional "contest protection mode" for the duration of official Codeforces rounds.

Proposed features

1. Disable text selection and copying on problem statements

  • Prevent selecting text with the mouse.
  • Disable common copy shortcuts such as Ctrl+C.
  • Disable the context menu (right-click) on problem statements.

These techniques are not foolproof, but they discourage casual copying and make it less convenient to paste the statement directly into an AI assistant.

2. Make screenshots more difficult where possible Modern web browsers cannot reliably prevent operating-system screenshots, so I understand that this cannot be completely solved on the web. However, if there are browser features or experimental approaches that can make automated capture more difficult, they could be worth investigating.

Why this is useful

These protections will not stop a determined cheater. Someone can always:

  • Type the statement manually.
  • Take a photo with another device.
  • Use OCR or other workarounds.

However, security is often about increasing the cost of abuse rather than making abuse impossible.

Today, many AI-assisted cheating attempts are extremely easy:

  1. Copy the statement.
  2. Paste it into an AI model.
  3. Receive a solution within seconds.

Even adding a small amount of friction may discourage opportunistic cheating and help preserve the spirit of the contest.

Important considerations

These protections should only be active while the contest is running. After the contest ends, the problem statement should return to its normal behavior so that participants can:

  • Copy sample tests.
  • Quote parts of the statement in editorials or discussions.
  • Translate or study the problem.
  • Use accessibility tools as usual.

Final thoughts

I fully understand that this proposal is not a complete anti-cheating solution. Client-side restrictions can always be bypassed by determined users.

Nevertheless, I believe that making AI-assisted cheating less convenient could improve contest integrity with relatively little impact on honest participants, especially if these measures are enabled only during active contests.

MikeMirzayanov, thank you for creating and maintaining Codeforces. I would like to hear your thoughts on whether this proposal could be considered.

Thank you for reading.

  • Vote: I like it
  • -29
  • Vote: I do not like it

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good solution to prevent cheating from cf!

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Your idea is good. But there are multiple issues:

  1. Cheaters can simply use OCR to change the image of the statement to text.
  2. There is no official markdown (or CF text parser) tag to make the text uncopiable.
»
3 months ago, hide # |
 
Vote: I like it +35 Vote: I do not like it

How about preventing AI from writing blogs?

»
3 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

But there is a way to cheat. If a cheater cannot take screenshots or copy text, they can just use their phone to take a photo

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    yeah, i think rating is useless; cz you know a lot of peoples using AI and cheating in live contests, what do you think about rating?

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Since cheating in contests has made it feel like that rating is useless, but the rating is the only thing that preserves the spirit of competitive programming. Without rating, it's simply obscured DSA problems!

»
3 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

One thing you definitely don't know is that, almost all problem statements have anti-AI prompt. This mean that, copying the problem statement and then give it to an AI result in a higher chance of being caught. However, cheaters can bypass this by taking screenshots, so I agree that we should find a way to prevent them taking screenshots.

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Or, they simply just give a few seconds to read the task and delete these anti-AI prompts ;-)

»
3 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

i'm guessing this won't be worth the effort. people will just screenshot, which is worse than copying since at least while copying you can add some hidden prompt to the statement. there is no (for privacy reasons) reliable way to prevent screenshots on desktop OS's.

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    ¡Exactly! You are right. It is not worth the trouble; those AI-systems are now trained quite well to detect those anti-AI prompts and just ignore them (I have tested quite much of them)… It is just a race-game between the cat and the rat… This platform here is a place to learn which implies that it is an offer; you cannot enforce it. Those who are unwilling to learn are always going to find a way to not to learn (and to get the virtual number here which is a good motivation to learn; but does not provide any advantages in the real world without learning something…

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

ya it must be adopted

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Yup, i'm in the same perspective with this author.

We cannot make an environment with Zero-Cheating system. However, we can improve our community security system so that it can implies to make other people will more respect the fire & integrity of competition.

»
3 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

As with all the other posts of this form, none of these are viable solutions. It adds minimal friction while having the potential to prevent legitimate users from competing. Having to take a screenshot instead of copy paste is basically no added friction; they just use prtsc and select a loose region easily. This will make it more annoying for legitimate contestants from translating the problem statement if they need to. Preventing screenshots would involve DRM which not everyone can/wants to install.

I implore everyone on this platform who is planning on posting a future blog with a similar premise to 1) stop and think about how their proposal might adversely affect legitimate contestants, and 2) whether it is likely that Mike has already thought of such a solution (and is either already implementing it or, more likely, deemed it to be more harmful than beneficial).

»
3 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

This cheating stuff feels really out of hand and is very discouraging. Can we please conduct off-line contests more often with proper monitoring of so each and every player? It's really hard to believe that there are a ton of beginners who perform better than some grandmasters? Is this believable? I know there can be a possibility of a temporary account made by a GM or someone good at solving problems. But not everyone of those beginners seems to be a GM.

One more thing, personally I struggle a lot on CodeForces. I need like 5-6 attempts for a relatively difficult problem. How all of a sudden the beginners swoop the contest with a single attempt.

One more thing which I observed Arpa was struggling with one of a question recently. I'm not sure, but I think it was C from Div 2. He solved the question question after like 1 hours 10 mins. If he was struggling with that respective question, it doesn't feel natural for 6000-7000 people solving it during the contest.

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

If contestants are allowed to submit their code written in an external IDE, AI-assisted cheating would be just easy as taking a photo. A promising idea is only allowing submission from an internal IDE, which is built-in in Codeforces. We can disable pasting to force cheaters handtype their code, and slow down them.

Offline contests use limited network access to prevent AI-assisted cheating. For online contests, as contestants can't submit their code without Internet, it is just impossible to stop cheaters. The golden rule is making AI tools hard (or inconvenient) to use during the contest.

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

some people need to copy paste statements for translation