A settlement agreement (formerly compromise agreement) is the only way to validly waive an employee's statutory employment rights including unfair dismissal and discrimination claims. The employee MUST receive independent legal advice from a qualified adviser (usually a solicitor) and that adviser must sign a certificate.
Legal reference: Employment Rights Act 1996 s.203; Equality Act 2010 s.147; HMRC EIM13000