The Horta are an interesting case for the Prime Directive
Normally the Prime Directive would forbid contact between Starfleet from open contact with a species incapable of interstellar communication. It is generally taken for granted that a similar rule or law must be in force for Federation civilians. It is hard to imagine the Horta could have warp drive, or even something like subspace radio. The Horta are almost obligate subterranean dwellers, finding even an open cavern uncomfortable compared to their own narrow tunnels. It is unlikely any Horta has ever deliberately traveled to Janus VI's surface. Even if one were to, they give every indication of being blind in the conventional sense-- or at least poor enough of vision that it took a mind meld for the Mother Horta to even understand what her unexpected guests even looked like. The Horta simply cannot look up to the stars and wonder, as other species can. They live in a world where the idea of flight could barely occur to anybody. It's debatable whether even the idea of tool use would be meaningful in such an environment (though the Mother Horta clearly understood the idea enough to understand how to sabotage the miners' life support.) And yet they are clearly an intelligent and sophisticated people, if alien. Extracanonical materials see the Horta join the Federation and become a vital part of its mining infrastructure, and even on a few occasions show mature Horta who have joined Starfleet, serving on such prestigious vessels as Kirk's Enterprise and Riker's Titan.
There is no indication that either the Federation miners nor the crew of the Enterprise encountered any reprisals for establishing a formal relationship with the Horta, even despite the fact that in the former case, their actions so interfered in the future of the species and their indigenous culture as to actively jeopardize their survival! Granted the miners had no way of assuming that the Mother Horta was sapient until long after the deed was done, but it was certainly clear to Spock before he attempted the Mind Meld.
This raises the question: why? Does Starfleet carve out some sort of exception for a species that may be incapable of ever meeting the standards for first contact? Did the fact that the contact by civilians was completely accidental create a justifiable breach, as it seems to have in "A Private Little War", and if so does that mean that in Picard's era Starfleet would have been obligated to ignore the Horta as the interpretation of the Prime Directive grew stricter?
I think in the case of most PD violations, there's likely a hearing to ensure that the violation was resolved as efficiently as possible, with minimal risk of harm to the alien civilization.
It's hard to imagine a more ideal outcome to Kirk's First Contact, under the circumstances.
I'd also think that establishing relations, by itself, wouldn't be considered a violation in this case. By that time the Horta already knew about the Federation presence and there was no way to isolate that knowledge. So the hearing would
mainly focus on the initial contact (digging into Horta territory, destroying the eggs) as a possible violation, with a side question of whether the negotiations afterward were carried out in accordance with it. (Probably yes)
So that leaves the miners' initial incursion and determining whether it was resolved sufficiently (in this case, probably deferring to the Horta).
It is generally taken for granted that a similar rule or law must be in force for Federation civilians.
There's been a lot of arguments on this point over the years but I stumbled across a pretty clear answer on this point.
BASHIR: You're going to make a move against Koval, aren't you? You're going to find a way to use his illness to keep him off the Committee. I suppose it would be naive of me to point out that interfering in the internal affairs of a sovereign power is explicitly forbidden by the Federation charter.
Interfering in the internal affairs of other species is, of course, the crux of the prime directive. So, yes, not only is it banned at the Federation rather than just the Starfleet level, it's written into the Federation's constitution itself.
I'd say there's a difference between a "sovereign power" and a single being occupying a cave with a bunch of eggs. Plus, interfering with internal politics and simply making contact are different things.