Short answer
There is no truly safe amount of pesto for dogs because it contains garlic, which is toxic. Even a small lick could irritate a sensitive stomach due to the garlic, cheese, and oils. The danger increases with the amount consumed, as garlic can damage red blood cells and cause anemia, but this typically requires eating a larger quantity over time. It's best to avoid giving pesto entirely. If your dog licked a tiny bit off a spoon, watch for vomiting or diarrhea and call your vet if you see those signs.
Pesto — Food safety facts
Feed with care · Dogs · full breakdown on the linked food page
Built on garlic, which is toxic to dogs and cats, plus pine nuts and cheese.
The full verdict, portion guidance and serving notes are collected on the Pesto food facts page.