John F. Kelly, as White House chief of staff, presented himself as the man leading a charge of “country first, president second.” The attorney general suggested administering lie-detector tests to the small group of people with access to transcripts of the president’s calls with foreign leaders. And President Trump sought a list of “enemies” working in the White House communications shop.

Those are some of the portraits of the Trump White House sprinkled throughout “Team of Vipers,” an inside account of working there written by Cliff Sims, a former communications staff member and Trump loyalist who worked on the campaign.

A White House spokeswoman declined to comment on the book.

The book, which will be published at the end of January, describes a nest of back-stabbing and duplicity within the West Wing, a narrative by now familiar from other books and news media reports. But Mr. Sims, who left last year after clashing with Mr. Kelly, is one of the few people to attach his name to descriptions of goings-on at the White House that are not always flattering to Mr. Trump, and many of the scenes are not particularly flattering to anyone, including himself.

“It’s impossible to deny how absolutely out of control the White House staff — again, myself included — was at times,” Mr. Sims writes.