Idiosepius adults are usually under two centimetres of mantle. At that size, holding position in surge is expensive, and the animals instead attach. A gland field on the dorsal mantle secretes an adhesive from one cell type and a releasing secretion from another, a duo-gland system also found in flatworms and some other invertebrates.
The squid presses its back against a seagrass blade and adheres firmly enough to resist water movement, then detaches quickly to strike. Prey includes shrimp and mysids that can approach or exceed the squid's own body length, seized with the tentacles from ambush.
Two things are worth separating. The glue is not a permanent cement; the release mechanism is active, which is what distinguishes it from barnacle-style attachment and makes it interesting to materials researchers. And pygmy squid are not juveniles of some larger species, a natural assumption given their size. They are mature adults, among the smallest known cephalopods, with lifespans of only a few months. The exact chemistry of the adhesive has not been fully characterised.

