5.4.4 How to Protect My Code After It Is Programmed Into a Device?

Many devices with flash program memory allow all or part of this memory to be write protected. The device Configuration bits need to be set correctly for this to take place. For more on using Configuration bits, see the following sections of this user’s guide:

Configuration Bit Access

Specifying Configuration Bits (CCI)

Your device data sheet is also a good resource for this question.