Modal verbs are used to express various meanings such as permission, obligation, and necessity. In addition, there are other related verbs that can be used for expressing these meanings such as had better, be able
We can use both needn’t and don’t need to to give permission to someone not to do something in the immediate future. Needn’t have, however, means that the action is completed, but it was unnecessary