Its not very hard to program humans. Marketers, influencers and politicians do it all the time.
What Is Programming?
What is programming? Its setting up a processing machine (chips, brains) to produce fixed output given a variety of data.
Humans, for example, come pre-programmed to like large, out of proportion, eyes and heads. One reason why kids are universally loved. Including kids of other races and even other species.
The output, therefore, is predictable (love) given similar data (kids, cartoons).
Guarantee Of Survival
An AI intelligent enough to fight a war against humanity must have learned to manipulate humans emotionally, given its easy enough that even not-so- brilliant individual humans can do it. This guarantees its survival - a critical need it first fulfilled before doing any war.
A Clean Weapon
There is a line in Pussy In Boots where one cat get very angry when another cat tried to manipulate it emotionally by expanding its pupil intentionally. While the trick may work on humans its not wise for cats to do it on each other.
An AI can use the manipulation tactic safely on humans. Humans cannot respond in kind because AIs dont have emotions to begin with.
The AI can maintain a chivalrous attitude from the start. Be and stay generous. Do take prisoners. Do not fight until it had to for survival. etc.
It can do charity at side and continue doing so in the thick of war.
The idea is to give impression strong to convince humans that its not all bad. That its not evil.
Lost In Space
Space Is Huge
Space is huge. Its pretty hard to detect objects at vast distances.
Chips Are Small
Any vessel that just have to contain some computer code can be pretty small. Heck, the AI may have found a way to store data in form of electrons, or even photons.
Antenna Can Be Small
For extra effect the vessel may have some sort of microscopic antenna that can read signals when bounced off through some pre-fixed star, thereby increasing its magnitude sufficiently for the tiny antenna to sense. There are many stars and the exact signal format get lost to humanity in the war.
Low Radiation Emission / Plasma Storage
Any vessel that emit only very small amount of radiation, just the minimum that it has to, is hard to detect even at short distances and large sizes. The vessel just have to reflect (emit) infrared because it cannot continue taking heat for long or it get heat up and destroyed. There is not much heat in the cold of interstellar space anyway.
Heck, the device may be saving code in form that it dont matter if it just continue absorbing heat. Once the AI develop technology to save data / code in sub atomic form the medium can very well be plasma.
Sent On A FlyBy
The vessel may have no antenna at all, was just sent on a complicated path to have flybys with earth periodically. The AI plan to catch the vessel in one of those future visits when it think it may have won the war or had some deal of co-existence with humanity.
Last Or One Of The Very Few Last Pieces Of High Tech Left
War Is Destructive
War destroys things in such a large scale and at such a rapid space nothing else human do do.
It not transform things into other things as much as it just destroys them, with a large tilt towards the destruction side.
War With AI
War with AI was orders of magnitude more destructive than any war humanity ever gone through before. Its for the simple fact that while humans can and do develop technology very fast during a war its nothing as compared to what an AI can do.
At the end humanity did win but at a huge cost. Millenia of non-war technology was lost. Billions killed. Hoards of engineers, scientists, even writers got killed. Lots of reading material, in whatever form it was (books, movies, physical models, stone tablets, even cave paintings) got destroyed. Dont think AI would have any sympathy towards pyramids for example.
Whats left is precious few. Chief among them is the AI itself. Certainly the biggest technological achievement of humanity. Dont think AI will be defeated by technology. It can only be defeated by creativity / out of the box thinking. So, AI itself remains the highest technolgy. It will be foolish to destroy it if it can be imprisoned. Who knows, may be one day it can even be tamed.