This framework can be used to evaluate the sustainability of a country's debt profile. The dynamics generated are based on the interaction and feedback between a government agent, a rating agency and the financial market in a stock-flow consistent manner.