The IMF has agreed in principle to grant Egypt a $12 billion three-year loan facility.