An important part of the agile manifesto that is sometimes missed is that it is not saying there is no value in the items on the right (i.e. that you should not have contracts). An agile way of handling contracts is to negotiate smaller contracts (for example a contract to build the first vertical slice of a system rather than one contract for the entire system) to allow either party to easily move on (fail fast) if things don't work out.