We humans mostly recognize our family, friends, and neighbours by sight or by voice. But insects are just as likely to rely on chemical senses like smell and taste to figure out who is a friend and who is an unknown. And not all of these signals are honest: just as our eyes can be fooled by a carefully-designed illusion, so too can insects' sense organs.

Social insects like ants, bees, and wasps can tell each other apart "within a split second," says Prof. Stephen Martin of the University of Salford in Manchester, UK. That's because each insect's outer shell – its "cuticle" – contains unique chemicals that other insects can detect. Social insects touch each other all the time, and use these chemical cues to instantly figure out whether a new insect is friend or foe.

It looks like a watertight system. But some parasitic species can invade the nests of social insects despite the safeguards. Once inside they can exploit the colony without the host insects noticing, or even stage a hostile takeover.

How do they do it? Thanks to new technologies that can detect and identify the chemicals being used, we are starting to unravel how these invaders get past the insects' defences. It turns out they have at least three main strategies.

Perfect mimicry

Some parasites are masters of mimicry. They synthesise the exact recognition chemicals used by their hosts in order to break into the nest.

The caterpillars smell just like ants

Large blue butterflies are particularly skilled mimics. Their caterpillars first develop on plants, but then get "adopted" by unsuspecting Myrmica ant workers. Caterpillars of the Alcon blue butterfly actually get themselves picked up and taken home by foraging Myrmica workers.

That's because the caterpillars smell just like ants. They have evolved their mimicry of the ants' cuticles to such a precise degree that their chemical profiles are almost indistinguishable.

Once the caterpillars are inside the host nest, the ants preferentially feed them more than their own larvae. The caterpillars can cost the ants dearly.

Bumblebees have a similar problem. They can wind up hosting cuckoo bees.

When a cuckoo bee queen finds its way into a bumblebee colony, it will kill or subdue the queen bumblebee. Then, using either chemical manipulations or physical force, the invading queen forces the bumblebee workers to raise her young.

Martin and his colleagues have found that the cuckoo bees use both colour and chemical mimicry. A cuckoo bee queen is "chemically a perfect match for the species they're going to invade," he says.

Smell theft

Some parasites don't bother to synthesise their host's signature chemicals. Instead they steal them.

They are continually 'shampooing' the host ants to obtain the smell

This is how shampoo ants make their living. They invade the colonies of Myrmixa ants, then rear their young in chambers too small for their hosts to enter.

Shampoo ants get their name because they spend about half of their time licking the smell off their hosts and covering themselves with it. To maintain their disguise, "they are continually 'shampooing' the host ants to obtain the smell," says Martin.

Other such parasites take a more aggressive approach. For instance, a zodarriid spider will kill an ant and then hoist the ant's body in front of it. The smell from the dead ant's corpse, combined with the spider's ant-like appearance, allow the spider to walk unmolested through a crowd of ants.

Mission unsmellable

Finally, some organisms can avoid detection by simply not smelling of anything at all. Some produce such tiny amounts of recognition chemicals that they are undetectable, a trick called "chemical insignificance".

This is one of the sneaky strategies employed by the ant-mimicking jumping spider Peckhamia picata. This species visually mimics an ant, both in looks and behaviour. It has a streamlined body, and waves its first two legs to imitate ant antennae.

The spider does this, not to invade, but to avoid being eaten. By masquerading as an unpalatable ant it can deter visual hunters.

It goes below the radar of an enemy

But what about chemically-oriented hunters such as mud-dauber wasps? These insects "hunt for different kinds of spiders, paralyze them, and feed them to their babies," says Divya Uma of Azim Premji University in Bangalore, India. She found that they didn't go for P. picata, and decided to find out why.

Uma presented mud dauber wasps with two freshly-killed jumping spiders, one of which was an ant mimic. The wasps touched the ant mimic but didn't sting it, but they did sting the non-mimic. "This suggested that there was something on the ant mimic that tells the wasp it is not a potential prey," says Uma.

She examined the chemical makeup of P. picata itself, an ant species it likely imitates, and a similar-sized non-mimic spider called the golden jumping spider. It turned out that the signature of P. picata was completely different from the ants it was apparently mimicking. Instead, P. picata had lots of different chemicals in its cuticle, but in very low amounts, making it 5 or 6 times harder to detect than the non-mimic spider.

"It goes below the radar of an enemy," says Uma.