Yes you can. In fact, this is more common than you might think it is. For instance, if one spouse is about to enter a business, their partners may require them to do this. As a precondition to entering the partnership, a person may be required to enter into a cohabitation agreement stating that if they separate or pass away, their spouse will not make a claim on the business. This will allow the partners to be assured that a separation does not interfere with their business.