A security grid was a system in place aboard starships, space stations, and other installations that was responsible for monitoring and maintaining the various systems designed to protect the crew from potentially hostile incursions.
In the 22nd century, the capital city on Vulcan was protected by an extensive security grid, prohibiting the use of transporters without a proper access codes. In 2154, Starfleet captain Jonathan Archer and T'Pau were able to obtain the proper codes from Koss, the husband of Commander T'Pol, Archer's first officer. Gaining access to the chambers of the Vulcan High Command, Archer and T'Pau were able to present the Kir'Shara, a copy of Surak's original teachings. (ENT: "Kir'Shara")
During the late-24th century, the space station Deep Space 9 had a security tracking grid composed of several surveillance devices. In 2369, Ilon Tandro led a team to the station in order to kidnap Lieutenant Jadzia Dax for extradition to Klaestron IV. With prior preparation, they were able to avoid the security tracking grid, kidnap Dax and make it back to their ship. The following year, Quark circumvented the grid to allow access to Yeto, a Klingon mercenary with whom Quark had made a deal for the sale of liquid data chains. It was soon revealed, however, that the deal was simply a ruse to gain access to the Dax symbiont. (DS9: "Dax", "Invasive Procedures")
In 2376, the crews of the USS Voyager and the USS Equinox collaborated to create an auto-initiating security grid meant to confine any attacking nucleogenic lifeform behind a multiphasic force field the moment one emerged from an interspatial fissure. Before the grid was brought online, however, the Equinox crew stole Voyager's field generator and integrated it into their own systems, for the purpose of continuing their criminal experiments of murdering the lifeforms and converting their remains into a source of fuel. (VOY: "Equinox")
A year later, the crew of Voyager developed a plan to introduce a nanovirus into the Borg Collective by uploading it into the central plexus of a class-four tactical cube. However, since the central plexus of the cube was protected by multi-regenerative security grids, this necessitated the boarding party allowing themselves to be assimilated into the Collective, thereby allowing them access to the plexus. (VOY: "Unimatrix Zero")