If your Codespace is protected AND you have some serial number in this space, you can copy the serial number in the EEPROM area the first time the PIC is run. I used this technique once, where the half of the serial number was secret (user could not see/alter it) and the second half was 0000 by default and could be changed by the user as a password.

That project included a PC software that was paired with the secret serial number of the PIC.

Ioannis