The International Security Assistance Force (ISAF) is a NATO -led security mission in Afghanistan that was established by the United Nations Security Council in December 2001 by Resolution 1386 , as envisaged by the Bonn Agreement .