The positron flux in cosmic rays is currently measured with unprecedented precision by AMS-02 up to TeV energies, and represents a unique probe for the local properties of our Galaxy. The interpretation of the spectra is at present still debated, especially for the excess of positrons above 10 GeV, that deviates from the predictions of the secondary flux, generated by the interaction of cosmic rays with the interstellar medium. The hypothesis that pulsars can significantly contribute to this excess has been consolidated after the observation of gamma-ray halos by HAWC and LHAASO at TeV energies of a few degree size around several pulsars. These halos can be explained with the inverse Compton scattering on the interstellar radiation fields performed by leptons injected from these sources. The detection of an extended multi-TeV gamma ray emission around these pulsars provides a unique tool to investigate the transport properties of cosmic rays in the turbulent magnetized interstellar medium. I will describe how it is possible to infer information from TeV gamma-ray halos on the particle production efficiency of pulsars and on the propagation mechanism of leptons around these sources.