This is the larval stage of the black swallowtail butterfly; which is absolutely gorgeous. According to the literature all swallowtail caterpillars secrete a bad tasting and smelling substance from a special gland. I don't think it makes them poisonous per se but I would not feed this to my chameleon.
Be leery of any brightly colored bugs they usually have some defense mechanism to prevent them from getting eaten. The bright colors are to alert potential predators of poison, stinging or bad tasting bugs.
I never got moths from hornworms but I did feed off my silkworm moths. Only Omar was big enough to eat them but he liked them. He also liked the black soldier flies too. It is important to know that many of the adult forms of the caterpillars (and other bugs) are not as nutritious as the larvae because some of them do not eat and only live for sex! Black soldier flies have no mouth parts and silkworm moths do not eat. Not sure about hornworm moths. I think they do eat nectar because they need hummingbird feeders after they metamorphose.