The agreement governing hundreds of millions in private donations was kept secret until a watchdog group sued and a judge ordered it disclosed.