OpenAI chief executive officer Sam Altman said late on Friday that he had reached an agreement with the US Defense Department.