Yes, ants use formic acid as a defense mechanism, emitting it to deter predators and rival ants.