I don't think that matters in terms of whether it is even enforceable. I could sign a document allowing management to take my first born son but them doing so is not legal. "But he signed it!"
You could also sign an NDA. And then you'd be bound by that NDA to not disclose the information it is protecting. Should penalties from that should also be non-enforceable because it would limit what you can say?