Both "the knives are out for X" and the closely allied "Y have there knives out for X" go back more than a century—to no later than 1895 and 1889, respectively.
An early instance of "Y have their knives out for X" appears in "Prophets of Evil," in the Omaha [Nebraska] Daily Bee (February 19, 1889):
It would be a wholly exceptional experience if on the eve of the entrance into power of a new administration there were no prophecies of trouble awaiting it. These are making their appearance now, most plausibly framed and ascribed to the most trustworthy sources. We are told that numerous individuals, more or less potent in republican politics, have their knives out for General [Benjamin] Harrison, and that a bitter quarrel is inevitable at the very outset of his administration.
Harrison was the Republican candidate for U.S. president in 1888, and won the election over the incumbent Democratic president, Grover Cleveland. At the time of this news article, Harrison was still about two weeks away from taking office (which he did on March 4, 1889). Four years later, Harrison was defeated in his bid for reelection by ... Grover Cleveland.
The expressions "have their knives out for [someone]" and "the knives are out for [someone]" may call to mind the assassination of Julius Caesar. Consistent with that reading, the wording in the excerpt above, "prophecies of trouble awaiting [the new administration]," might suggest the famous warning in Shakespeare's Julius Caesar, "Beware the ides of March."
Figurative use of "Y have their knives out for X" seems to have caught on fairly rapidly in the 1890s. It also appears in unrelated newspaper articles in Pittsburgh, Pennsylvania (October 15, 1891), Shenandoah, Pennsylvania (October 31, 1891), Fort Worth, Texas (February 28, 1893, in an instance that specifies "scalping knives"), New York City (May 30, 1895, with scalping again specified), Salt Lake City, Utah (October 17, 1895), and Omaha, Nebraska (May 25, 1896).
The earliest Elephind match for the wording "knives are out for X" appears in an untitled item in the [Montpelier] Vermont Watchman & State Journal (October 2, 1895):
The New York democracy held its annual powwow at Syracuse last week. After an angry contest over the question of admitting the delegates of the state democracy from New York city, Tammany's proposition to give the rival organization a one-fifth representation was hotly resented by Mr. Fairchild and his fellow delegates. They took the first train back to the city, and it is said that blue puffs of sulphurous smoke were omitted from the car windows all along the route. Knives are out for the tiger, and the threat is made that his blood shall pay, on election day, for the insult and the denial of rights at Syracuse.
Tammany Hall was a notoriously powerful and corrupt political club that ran New York City politics in the late 1800s. Its symbol was a tiger.
The sense of "knives are out for X" in this excerpt is not fundamentally different from the sense of "Y have their knives out for X" in the earlier instances.