It was General Grievous who "sent" the droid to harm Anakin, and it was his own idea.
All the astromech droids are prepared by Industrial Automaton and handed over to the Republic for their help.
However at some point of time Grievous stole some droids and ordered to reprogram them to work as spies. And silently put them back before Industrial Automation or Jedi or Republic realize that. After losing R2 D2 in battle of Bothawui R3-S6 was handed over to Anakin following advice from Master Yoda and Mace Windu.
If you have watched the episode you can see that R3-S6 was reporting directly to Grievous. And the whole mess was master plan of General Grievous. From this Wookieepedia article
An R3-series astromech droid, R3-S6 was manufactured by Industrial
Automaton on the planet Nubia around the time of the Clone Wars.
While most R3-series astromech droids had clear-transparent domes,
some droids—such as R3-S6—were shipped with salvaged R2-series domes;
during the Clone Wars, the Galactic Republic needed droid units
available for purchase even with such minor defects. In 21
BBY, the Confederate General Grievous hired agents to steal an
astromech droid from Industrial Automaton on Nubia. The
agents took R3-S6 to the planet Milagro, and inside a Republic
base, it was reprogrammed to become a spy for Grievous.
Even you can read the synopsis of the episode "Duel of the Droids" on this Wookieepedia article.