Lemon juice. To prevent the pesto from turning brown, you need to add acidity with a squeeze of lime or lemon juice and store the pesto in an airtight container.