When drawing up animal cruelty legislation, most countries apply extra protections to vertebrates, since they usually have more complex nervous systems than invertebrates. Cephalopods are an exception:

In the UK, cephalopods such as octopuses are regarded as honorary vertebrates under the Animals (Scientific Procedures) Act 1986 and other cruelty to animals legislation, extending to them protections not normally afforded to invertebrates.

– Wikipedia

Which makes sense, since they’re intelligent enough to open screw-top jars, learn tricks, and of course armor themselves with coconut shells.