Credit rating agencies rate countries as well. Since the credit rating audience is a global investor, different countries end up in different positions on the rating scale. For an investor inside the country investing in government bonds in local currency, there is no credit risk. But for the global investor, there is foreign exchange risk in case the financial position of the country deteriorates.