I see accounts of people getting banned from sites like chess.com for using engines like Stockfish and Komodo (I admit I have used these engines before, but never in an actual match). Now, I believe there are certain characteristics of these engines that make them easy to detect. One I heard is the way you move the King, as well as every move being the best move possible (This one could be wrong). But I was thinking... couldn't chess engines not do the things that make them detectable, like play Kings less randomly, play sub-optimal moves in between optimal ones, etc, and become basically, as far as I can notice, undetectable? Is there anything about the way they are programmed that make this impossible or is this because of legality and morality?
Engines have no concept of natural moves and they have no fear. An engine will play for the most advantage, not for the most manageable advantage, even if it allows a fierce attack, because it sees that the attack does not work, while a human would probably prevent an attack and settle with a smaller, but practical advantage.
"Randomly" picking good moves is not easy. The second best move may only be second best if you see a very hard ONLY MOVE which comes 15 moves after. And sometimes, the best move is very obvious, and playing the second best move would be very suspicious.
It is not very known how engine detections on chess websites work, but I have read that they also account for playstyle inconsistency (ultra-aggressive to defensive, even though an aggressive move is available and not much worse), mouse movement, time management.
One very obvious indication for people using engines is, that they need roughly the same time for every move (usually about 5s in blitz games), even for the most obvious ones, which could be premoved. They also have much worse ratings in faster time controls (bullet). One example: https://youtu.be/rlxHusHfpck
Some of those things are possible in theory. Especially if you have a good idea what an engine-detector is looking for, you could maybe do some machine-learning training of algorithm against algorithm until you had one that could make good moves that didn't get detected as different from a given player's normal play.
But that would require someone to be interested in spending a bunch of effort to make software whose main use-cases included letting people cheat undetectably. Most people actively don't want that and would avoid doing so, even though there might be other uses (like for training, to play against a human-like opponent, if it's good enough to really play human-like, not just sneak under the anti-cheat radar).
So I think a significant part of what prevents that from happening is the ethics / moral code of many software developers. Or that for most people it's a somewhat less interesting goal than making a strong chess engine by any means possible. Not purely technical challenges if someone set that as a goal.
OTOH I could imagine some people might be curious to see if they could teach an engine to play more like a human, or play more like a particular human. And/or as @Akavall mentions, as a training opponent. That could make for some interesting research, although the danger of cheaters weaponizing the results would hopefully deter many researchers from pursuing it.
That's a bit like asking a congregation of people "is everyone here?" and expecting an accurate answer.
There may very well be chess engines that are optimized to fly under the radar of the cheat detection algorithms used at the major sites. But those are not the ones that get exposed and therefore they are not well known.
With the proliferation of machine learning systems and excess processing power, once you have enough play data, you can use readily accessible machine learning algorithms to determine a player's playstyle, and compare their moves against chess engine playstyles.
The exact mechanism and detail are university-level courses, so that isn't something I can explain in detail at the moment, but having access to a large amount of chess play data would make such analysis easily doable for someone in 2nd or 3rd year in computer science or data analytics. Machine learning is accessible enough that I think even a high schooler with particular interest would be able to do the analysis.
in esports (other esports? lol) like csgo, there are hundreds of sites dedicated to cheating. i have a feeling there may be a few such sites similar dedicated to chess cheating but ultimately i think it would end up the same as csgo: for every cheat, the csgo peeps will eventually improve their systems to counter the cheat. i have a feeling the case is similar to chess except i think it's much less difficult to counter cheats in chess as compared to games like csgo.