Robotics is an area of technology which has, over time, become glaringly absent in Star Trek, and in particular in Starfleet and Federation society. Yes, there is some automation, and, yes, TOS does on occasion portray the ship's main computer as having a personality of sorts, but strong AI is incredibly rare in the Star Trek universe, and even weak AI and basic robotics are very rarely employed in Star Trek plots, creating a strong disparity between how things are progressing in the real world versus how the Trek universe works.
In all of Star Trek, the only UAV/UCAV-type robots are Xindi sensor drones and Son'a drones (the Federation does have target drones and cargo drones, but these are automated space vehicles only mentioned in passing), and true AI like the exocomps, androids, and sentient holograms (e.g. Prof. Moriarty and the Doctor) are treated as a rarity/anomaly. This is very different from the world of Asimov's Robot series, where sentient robots are abundant, and their daily interactions with humans are a key focus of the plot.
In general, Star Trek's treatment of AI is very vague and hand-wavey (partly to ignore the horrific implications of AI slave labor), so it's unlikely that the writers have established any meaningful laws of robotics:
- Main computers, even those powered by neural gel packs, are mostly portrayed as weak AI, or just a really, really, really powerful computer. It may have voice synthesis/commands, but from most interactions, it's clear that the computer isn't actually sentient, and the occasional demonstration of personality may simply be an illusion.
- Non-biological/non-organic life-forms do exist, but they usually either evolved naturally (and thus aren't artificial) or by accident (thus still aren't intentionally designed) or are by other civilizations and end up being destroyed soon after contact with the Federation anyway. In any case, contact is not common enough for ethical or legal laws to be laid down. Rare legal precedents are seemingly ignored.
- Holographic sentience is again inconsistently portrayed. Most holograms are treated as very sophisticated weak AI simulations by the holosuite/holodeck. But, occasionally, characters bond with specific AI, and if this happens in enough episodes (or magic happens), they may become sentient or even real. But clearly most holograms are not sentient, since we're not monsters:
- The only other truly designed AI are by cyberneticists like Soong and Daystrom, and there's no evidence that either followed any laws of robotics. Only Daystrom's work was ever mass produced, and those were the main ship's computers.
So the only observable law of robotics within Starfleet is that: robots/AI resemble their creator or Andy Dick: