information:filtering, structural:scholar_edition, information:highlighting, structural:expansion, linguistic:paraphrasing
As prey: defences against predators and parasites

Hemiptera form prey to predators including vertebrates, such as birds, and other invertebrates such as ladybirds. In response, hemipterans have evolved antipredator adaptations. Ranatra may feign death (thanatosis). Others such as Carpocoris purpureipennis secrete toxic fluids to ward off arthropod predators; some Pentatomidae such as Dolycoris are able to direct these fluids at an attacker. Toxic cardenolide compounds are accumulated by the heteropteran Oncopeltus fasciatus when it consumes milkweeds, while the coreid stinkbug Amorbus rubiginosus acquires 2- hexenal from its food plant, Eucalyptus. Some long-legged bugs mimic twigs, rocking to and fro to simulate the motion of a plant part in the wind. The nymph of the Masked hunter bug camouflages itself with sand grains, using its hind legs and tarsal fan to form a double layer of grains, coarser on the outside. The Amazon rain forest cicada Hemisciera maculipennis displays bright red deimatic flash coloration on its hindwings when threatened; the sudden contrast helps to startle predators, giving the cicada time to escape. The coloured patch on the hindwing is concealed at rest by an olive green patch of the same size on the forewing, enabling the insect to switch rapidly from cryptic to deimatic behaviour.

Some hemipterans such as firebugs have bold aposematic warning coloration, often red and black, which appear to deter passerine birds. Many hemipterans including aphids, scale insects and especially the planthoppers secrete wax to protect themselves from threats such as fungi, parasitoidal insects and predators, as well as abiotic factors like desiccation. Hard waxy coverings are especially important in the sedentary Sternorrhyncha such as scale insects, which have no means of escaping from predators; other Sternorrhyncha evade detection and attack by creating and living inside plant galls. Nymphal Cicadoidea and Cercopoidea have glands attached to the Malpighian tubules in their proximal segment that produce mucopolysaccharides, which form the froth around spittlebugs, offering a measure of protection.

Parental care is found in many species of Hemiptera especially in members of the Membracidae and numerous Heteroptera. In many species of shield bug, females stand guard over their egg clusters to protect them from egg parasitoids and predators. In the aquatic Belostomatidae, females lay their eggs on the back of the male which guards the eggs. Protection provided by ants is common in the Auchenorrhyncha.