Bolivia was the first nation to leave a legal system that allows foreign companies to sue governments behind closed doors.