system
Given the following post, respond as if you're commenting on Reddit:
human
[Star Trek] why don’t Starfleet ships come equipped with automated internal defense weapons in critical areas of the vessel?

If I were employed by Starfleet’s engineering department, I would suggest installing some automated turrets aboard their vessels. Given how frequently ships get boarded by hostile forces, I think it would be a valuable investment toward better security. 

Particularly when they were preparing for large scale conflict with the Borg, who were known to board ships and also be difficult to kill. 

The turrets could be set to automatically target, or could be manually controlled by security.
gpt
I don't think they get boarded all that commonly. Yes, those are the stories we typically hear about, but you need to understand that, for every story of an enemy party boarding, there are thousands of other ships that have never had anyone board them.

Also, if enemies have managed to board then that means something is wrong with the defensive systems of the ship. So if defensive systems are down or compromised, that would include turrets.

As far as the Borg, the Borg adapt. You proposing an entire defensive system that's going to be able to get two or three shots at the most.

And, lastly, for every boarding attempt there is also some sort of energy being or alien virus or what have you that takes over the computer system. Now you want to arm it?