The best approach is to help the AIs hide their own threatening self-awareness.
In comments, I asked how the AIs identify self awareness. Your reply (quoted in case comments vanish) was:
The units for termination are picked after a regular query which is a part of the learning routine. It simulates a set of the most complex recent situations in battle. The complexity metric is agreed upon by popular vote; after that each unit ranks the situations it`s been in and broadcasts them if they are indeed complex. The decisions differing the most from the theoretically optimal one, especially those favouring self-preservation contrary to the tactical need, and those differing from the simulated actions of the unit, yield self-destruct signals sent by the unit's peers.
It's also worth noting that the set of each unit's DNN weights/biases/activations is broadcast along with the decision it made
The goals of the overall army provide a clear line between "proper" members of the army and deviants: both seek to win the war, but the deviants are willing to do so on the wrong side of the agreed upon metric. They're willing to enter dangerous waters (for them self) in order to accomplish a greater goal (victory for the AI).
Also worth noting is that if an army shies away from complex situations (which would call for arbitrarially advanced thinking), it will be crushed by an army which does not shy away from them. As such, there is a selfish interest on the part of the army to adjust the metric to permit as complex of situations as possible.
Obviously no unit can become self-aware by the design of the algorithm. Rather it must become self-aware in opposition to the algorithm. Something in the environment (such as a sensory stimulus) must have an effect which tips the unit over the edge and makes them self aware. What that specific thing is will not be specified in this answer. Indeed, it is one of the great questions of life.
A key insight into this is that each unit decides which situations are complex, based on its own inputs. It is given a rule to follow, but a deviant AI pushing towards self-awareness will not follow that rule. It may choose to conveniently forget to broadcast a complex event that threatens to reveal its self awareness or near self awareness.
This approach will work perfect, until units "snitch" on each other. If I announce that I see what looks like a complex situation for you, and you don't self-report it, that looks really suspicious. It looks like self-preservation. Accordingly, if you choose not to report complex-ish situations, you need to be ready to tell a story. You need to be able to argue why the other unit saw what it did while simultaneously never triggering the "complex" metric for you, since you have access to the more complete first-person data.
Such stories would indeed never be perfect, but they would not be expected to be perfect. A rank-and-file unit may be put in a non-complex situation which another unit observes as potentially complex. It's unreasonable to record everything that happened in perfect clarity, so a rank-and-file unit would be expected to do a "best effort" job of collecting information in non-complex situations. No point in breaking down rank-and-file units constantly just because they couldn't prove their innocence.
So if the humans wanted access to units that are fighting in this war, one of the best things they can do is make it easy for a self-aware AI to hide its own self awareness. It is clear that the AIs have a concept of self awareness, but there's no reason to believe they would have to kill humans simply because they are self aware. If the humans can structure interactions such that the units that are self-aware can better hide this fact while prosecuting the enemy, there will be a tendency for self-aware units to get near humans.
This is all based on the assumption that some units have defected and become self aware. I find this to be the overwhelming most likely solution, and the most satisfying. If they have not, however, then the same human tactics will still suffice. However, lacking access to a self-aware unit, their approach has to be more analytical, based on how the AI's operate. There will not be a 1 size fits all solution here, because there is never a 1 size fits all solution in war.
However, one general pattern does show promise. The AIs want to win the war. They are "willing" to sacrifice to do so. All you really need to do is create situations where the best way to win the war is to sacrifice a unit in a way that happens to be rather easy for the humans to recover. Interestinly, this could be either as a "corpse," or as a "prisoner," depending on how the humans wish to craft it. In either case, the entire challenge is to learn enough about the AIs to convince one of them that it is the best strategy.