My understanding is that Agreements like that can't be legally enforced but can be taken in to consideration by a judge in a future divorce / separation case. The Judge still has to make sure that the division of assets is fair given all circumstances and the future is difficult to predict.
To use a simple example, a judge may decide that such an agreement was fair when it was signed but 10 years on , and the husband is sick, and unable to earn a living , he deserves enough of the marital assets to buy a home.