The phrase to the maximum extent permitted by law is sometimes used in prohibitive or restricting clauses. The drafter likely attempts to convince some abstract court to uphold at least some part of the prohibition or restriction. This blog explains that – whilst nowadays laws and regulations tend to uphold as much as possible of the parties freely agreed principles – the phrase is redundant.
The phrase to the maximum extent permitted by law is sometimes used in a provision which may, depending on the circumstances or the applicable law, turn out to be invalid or unenforceable. Such provisions include in particular clauses limiting the liability of a party and non-compete clauses (both in commercial setting and in employment agreements). For example:
Until one year after the termination or expiration of this Agreement and to the maximum extent permitted by law, Employee shall not, directly or indirectly, for own benefit or for the benefit of third parties, undertake or facilitate any activities in a field of business equal or similar to a business of Employer or otherwise in direct or indirect competition with Employer.
The phrase to the maximum extent permitted by law is redundant to the extent that any statutory (or other legal) limitations do not prohibit or restrict the referenced provision. This must be distinguished from the case where two commercial parties negotiate a normal contract and are free to agree on prohibitions and restrictions (as opposed to the case where those parties deal on a questionable basis of either party’s general terms and conditions): in such ‘negotiated’ contracts, the limitation of liability would not be invalid or unenforceable, because no party can be deemed to have disagreed to such ‘negotiated’ limitation. The phrase may be useful if the parties do not want to investigate where and to which extent such limitations apply or if there is a reasonable likelihood that at some point in time, the applicable law may become more restrictive.
To the maximum extent permitted by law may also serve as a hint to a court that in case it considers the invalidity or unenforceability of the clause, it should also nevertheless impose some kind of limitation or prohibition. This argument is not very convincing because a court should anyhow consider the appropriateness of giving at least some effect to the litigated provision.
 An exception applies to the UCC requirement adopted by various US states, that any limitation of liability should be conspicuous, capitalised, bold-printed or in italics.