A promise or other term of an agreement is unenforceable on grounds of public policy if legislation provides that it is unenforceable or the interest in its enforcement is clearly outweighed in the circumstances by a public policy against the enforcement of such terms.
In weighing the interest in the enforcement of a term, account is taken of
the parties' justified expectations,
any forfeiture that would result if enforcement were denied, and
any special public interest in the enforcement of the particular term.
In weighing a public policy against enforcement of a term, account is taken of
the strength of that policy as manifested by legislation or judicial decisions,
the likelihood that a refusal to enforce the term will further that policy,
the seriousness of any misconduct involved and the extent to which it was deliberate, and
the directness of the connection between that misconduct and the term.