system
Given the following post, respond as if you're commenting on Reddit:
human
[General Hard Sci-fi] I'm a space pirate and I just acquired a whole resource rich moon with a space port as my pirate haven. I need some defenses, what should I install if money/resources are no problem for me?
gpt
This depends heavily on what kind of technology is available in your setting, and how "hard" your hard sci-fi is.

Based on our current understanding of physics, it's very hard to beat chemically- or magnetically- motivated kinetic weapons. Think missiles or rail guns.

The rail guns will probably need to be mounted to some kind of orbital vehicle, like a satellite, but the missiles could be mounted on-orbit or launched from the surface.

Also, don't underestimate the power of a debris field. Running into random space junk is a major problem for space vehicles. If said vehicle is traveling at a noticeable percentage of the speed of light, running into a pebble would absolutely destroy the ship.

If you knew a ship was incoming, and it was going fast enough, you could toss a bag of sand in their way, let it spread out a bit, and watch their ship get torn to shreds.

The problem with this approach, of course, is that you will also need to navigate around the debris field when entering/leaving your hideout. On the other hand, if the missile or railgun is successful you're going to have a debris field anyway, so it's better to solve this problem up front.

On the directed energy front, a sufficiently powerful radio transmitter will fry most electronic circuits. A spacefaring craft will be shielded against this, but there's a limit to how much you can protect yourself.