Are contracts in Mexico contained within their four corners?
No, not at all! The concept of a contract being contained within its four corners (only the things foreseen by the contract are enforceable) is foreign and inapplicable to Mexican Law.
All civil codes in the country have provisions which includes them inside all contracts. This provisions usually look like the article 6 of the Federal Civil Code:
Article 6: The will of private parties can’t exempt the observance of the law, or alter it or modify it. Parties can only renounce the private rights that don’t directly affect the public interest, when such renonciation doesn’t damage third parties rights.
When drafting a contract to be enforced with Mexican Law and Mexican Courts, the lawyers need to make sure the dispositions included in the civil codes or commercial codes apply in a way that parties accept.
Some provisions in Law are renounceable, others are not. Any renunciation has to be done in explicit terms. That is, you can’t renounce all of the civil code but need to specifically say to which article you are renouncing and for what effect or purpose.
Please always hire a Mexican attorney to review your Mexican contracts.