All contracts take away rights that the law explicitly guarantees you? Such confidence. Sometimes talking to an LLM is an improvement...
Similarly, it's entirely possible to enter into a contract limiting your freedom of speech.
The entire point of a contract is to promise to do, or not to do, something that you could have freely chosen to do or not to do under the law without any contract.