Credit rating agencies are private companies that assess the likelihood that governments and firms will repay their debts.