AT&T Inc has reached an agreement in principle to buy Time Warner Inc for about $85 billion, sources said on Friday.