How It Works
When an agent runs a package install command (e.g.,npm install, pip install, cargo add), Mains intercepts the command, extracts the package names, and checks them against the configured guard service. If any package fails the security check, the command is denied before it executes.
This works across all three agent runtimes:
Supported Ecosystems
Guards detect install commands for multiple package managers:Socket.dev
Mains uses Socket.dev as the guard provider. Socket analyzes packages for supply chain risks, known vulnerabilities, and suspicious behavior.Setup
1
Get an API key
Create a Socket.dev account and generate an API key from your organization settings.
2
Connect in Mains
Go to Settings > Connections and click Connect next to Socket.dev. Enter your API key.
3
Guards activate automatically
Once connected, guards are active for all agent runs. No per-workspace configuration needed.
What Gets Checked
For each package, Socket.dev returns:
Packages below the minimum score threshold are blocked automatically.
