The NY Times recently ran an article on addiction vaccine efforts. It does a good job explaining the concept:
Unlike preventive vaccines — like the familiar ones for mumps, measles and so on — this type of injection would be administered after someone had already succumbed to an addictive drug. For instance, cocaine addicts who had been vaccinated with one of Dr. Janda’s formulations before they snorted cocaine reported feeling like they’d used “dirty coke,” he said. “They felt like they were wasting their money.”
. . .
Much like vaccines against disease, they introduce a small amount of the foreign substance into the blood, causing the immune system to create antibodies that will attack that substance the next time it appears.
The difficulty is that molecules like cocaine, nicotine and methamphetamine are tiny — much smaller than disease molecules — so the immune system tends to ignore them. To overcome that, Dr. Janda attaches a hapten — which is either a bit of the drug itself, or a synthetic version of it — to a larger protein that acts as a platform. The last part of the vaccine is an adjuvant, a chemical cocktail that attracts the immune system’s notice, effectively tricking it into making antibodies against a substance it usually wouldn’t see.
“It’s not like some magical premise,” Dr. Janda said. “And the beauty of it is you’re not messing with brain chemistry.”