Had several other ideas related to different barriers that may work out for different species in different situations:
Electric Fence:
Instead of having to apply a barrier to prevent escape, a simple electrified fence can be applied with low voltage via a battery, etc would be used. Going to test voltages and amps when I get my bench power supply. I expect species would have different requirements, the point is to not kill the ant but deter or "knock out" so as to safely prevent escape.
Medieval Moat:
Using induction heating (or other means), at around ~100C or ~220F water boils, which would instantly FRY any ant attempting to cross, this would be an effect barrier that also provides moisture. If moisture isn't need, other liquids can be used such as oil (mineral, vegetable, olive, etc) and this would also have the benefit to make an awesome treat