As part of the cloaking work, I plan to make all auto-commands toggle-able. Currently you can only turn auto-repair on/off, auto-attack and auto-flee will also be toggle-able soon.
If a unit has an attack command, auto-attack will be enabled by default and auto-flee will not show, if auto-attack is disabled, auto-flee will show up and be set to true.
That should cover your spy, if it has no attack, its as simple as turning off auto-flee, if it has an attack, you'd have to turn off auto-attack and auto-flee.
Automatically changing these in some circumstances might be nice, (like turning auto-flee back on if detected), but this could be tricky to get right, will think about it for a while.