Pesto turning brown on top is completely normal! The reason it’s turning brown is because of the chemical reaction the chopped basil has with the air. Similarity to avocados, this process is called oxidation. If you are going to be storing your pesto, the best way to prevent oxidation is by either blanching the basil leaves in boiling water before making the pesto, or laying plastic wrap so that it is directly touching the surface of the pesto to decrease it’s exposure to air.