In the book, it was a poison bead in a hairnet Ser Dontos gave Sansa. Here it was a necklace. Lzdy Olenna removed the poison from the necklace while fiddling with Sansa's clothes and hair, and slipped it into Joffrey's cup. I even think the scene last episode where she "dismisses" a necklace on display, throwing it into a bush, was to get it to Ser Dontos without them being seen together. Littlefinger and Olenna are the heads of it, him dealing with Dontos and Sansa's escape (as seen already last season iirc) and Olenna getting the poison to Joff.
The name's Joff, it rhymes with cough...