1. You need not have done it.

2. You need have done it.
--------------------------
Are they all grammatical?

1 is okay, but 2 is not.

2 could be rephrased like this ~~> You need to have done it.

1 could also be rephrased like this ~~> You do not need to have done it.