Baroque music uses a transposing system. There are a small but significant number of works that exist in multiple keys for multiple instruments. Here the lute part is notated for convenience to the viewer at the "sounding" pitch as opposed to the the notated pitch. If you look for the original score of BWV 1008 for cello, you will see the original key signature.