I am looking for sci-fi short story that may have appeared in Analog prior to 2000. It had to do with a personal assistant robot that was intended to protect its human partner from harm. The robot was self-learning. The learning program could adjust itself as it learned about the environment or circumstances or things that could or may injure its human. As I remember, the robot learned that humans could drown in water. The human liked to exercise by swimming. As a result the robot started preventing the human from getting into the water. Then the robot would not let the human near the water. Eventually the robot learned that every thing and every thing could endanger its human and would not allow him to do anything.
I think that "With Folded Hands" is almost correct, but Williamson's 1949 rewrite The Humanoids does explicitly include a line about swimming no longer being allowed:
Contriving a thin smile, he managed to say:
"We used to swim - every summer, Ruth and I."
"Swimming," the machine said, "is forbidden now."
That could be the famous 1947 novelette “With Folded Hands” by Jack Williamson. It was first published in Astounding Science Fiction, which was what is now called Analog.
In the course of the next day, the new mechanicals have appeared everywhere in town. They state that they only follow the Prime Directive: "to serve and obey and guard men from harm". Offering their services free of charge, they replace humans as police officers, bank tellers, and more, and eventually drive Underhill out of business. Despite the Humanoids' benign appearance and mission, Underhill soon realizes that, in the name of their Prime Directive, the mechanicals have essentially taken over every aspect of human life. No humans may engage in any behavior that might endanger them, and every human action is carefully scrutinized.