Different types of ants panic in different ways.
Lasius: running in different random directions, scatter, take the pupae with them
camponotus: Freeaze. Lay flat. Try to blend into the wood.
pogonomyrmex: ATTACK bite anything new, run towards the danger and sting it.
nylandria: what is danger? I'm so small I have not noticed the danger.
formica: A combination of the scatter and ATTACK reaction... only *anything* will set it off. A board creaked in the next room? Time to freak tf out.
I suspect that these reactions are related to the kind of dangers they face in the wild. Lasius ants are small enough that if they just just run and hide the problem is solved. Pogonomyrmex, have a sting that's painful even to large mammals, so why not stand your ground? Camponotus ants really don't want the main nest to be discovered, and the trees they live in move in the wind... so making a fuss might draw more attention.
Nylandria just aren't tuned into things beyond their tiny scale. They are very brave fighters of fruit flies and overcurious springtails... but they can't conceive of anything as big as a person.
The formica ants have good enough eyesight that they can clearly see me. They see me through the glass walking around and are just horrified by the giant monster who clearly wants to eat them.
How do your ants react when nervous?