The way you prevent cheating is to have contest with clear rules. You can give the contest participants half of the data set to train there algorithms and then score them based on the other half that get's only made available once the contestants decide on a specific algorithm.
In bioinformatics the Critical Assessment of protein Structure Prediction (CASP) challenge is a biyearly contest, where teams get the sequence of a gene with unknown structure and have to predict the structure. Afterwards the team get scored on how well they predicted the real structure.
The way you prevent cheating is to have contest with clear rules.
They had clear rules and a non-public test set with a limited number of allowed submissions, Baidu tried to evade the limit by creating multiple accounts and they were caught.
Some of you may already have seen this story, since it's several days old, but MIT Technology Review seems to have the best explanation of what happened: Why and How Baidu Cheated an Artificial Intelligence Test
(In case you didn't know, Baidu is the largest search engine in China, with a market cap of $72B, compared to Google's $370B.)
The problem I see here is that the mainstream AI / machine learning community measures progress mainly by this kind of contest. Researchers are incentivized to use whatever method they can find or invent to gain a few tenths of a percent in some contest, which allows them to claim progress at an AI task and publish a paper. Even as the AI safety / control / Friendliness field gets more attention and funding, it seems easy to foresee a future where mainstream AI researchers continue to ignore such work because it does not contribute to the tenths of a percent that they are seeking but instead can only hinder their efforts. What can be done to change this?