// use cases
Build an always-on pentester with Cursor
Schedule repository Red Team runs and send triaged findings from one repository to Cursor for reviewed remediation.
Build an always on security loop for a repository. Superagent tests the repository on a schedule, triages the findings, and sends findings from that exact Repository to Cursor. Cursor reproduces qualifying exploit paths, prepares tested fixes, and leaves every pull request for CI and human review.
Prerequisites
- A repository connected through the Superagent Security GitHub App
- A Cursor Automation connected to the repository
- A Superagent organization API key available to Cursor as
SUPERAGENT_API_KEY - A repository reviewer for every proposed change
1. Schedule repository Red Team runs
- Connect GitHub and give the Superagent Security app access to the repository.
- Open Repository and select the repository Cursor will patch.
- Enable Red teaming in the repository settings.
- Choose a trigger: every release or prerelease, release tags, daily, weekly, or monthly.
- Add a repository specific goal prompt when the campaign needs a narrower scope.
- Select New run once to confirm the repository access and goal before relying on the trigger.
Superagent clones the repository into an isolated sandbox and runs each campaign with the source as context. When the repository exposes a service the sandbox can start, Prime can use Nuclei against that live surface and independently verify candidates before creating findings. Findings include the evidence and reproduction context Cursor needs to decide whether remediation is justified.
2. Connect Cursor to Superagent MCP
Add the Superagent server to Cursor's mcp.json:
{
"mcpServers": {
"superagent": {
"url": "https://www.superagent.sh/mcp",
"headers": {
"Authorization": "Bearer ${env:SUPERAGENT_API_KEY}"
}
}
}
}Set SUPERAGENT_API_KEY in the environment that launches Cursor. Do not put
the key in chat, source control, or the MCP URL. See
Set up Cursor for the complete connection test.
3. Create the Cursor Automation
Create a Cursor Automation with:
- The selected repository as its working repository
- A webhook trigger
- Superagent MCP enabled
- Permission to create branches, run tests, and open pull requests
- No permission to merge or deploy without the normal review controls
Copy the webhook URL and the authentication value generated by Cursor. You will store the authentication value as an encrypted Superagent webhook header.
4. Route findings from this Repository
Open Webhooks in Superagent and create a target:
- Use the Cursor Automation webhook URL as the destination.
- Add Cursor's authentication value as an
Authorizationcustom header. - Subscribe to
finding.triage_completed. - Open Sources, expand Repositories, and select the exact repository you configured above.
- Save the target and send a test event.
Selecting the exact repository prevents findings from unrelated targets from starting this automation. Select All Repositories only when the same automation intentionally owns every current and future repository.

5. Give Cursor a strict remediation gate
Use instructions like these in the Cursor Automation:
The connected MCP server exposes the current structured report operation and schema. Use that schema instead of inventing report fields in the automation prompt.
6. Verify the complete loop
- Confirm the webhook test starts exactly one Cursor Automation.
- Start a manual repository Red Team run.
- Review the report and allow automated triage to complete.
- Confirm a matching finding starts the Cursor Automation.
- Confirm Cursor retrieves the finding through MCP and applies the remediation gate.
- Verify that a qualifying issue produces a tested pull request, while a weak or unreachable issue produces only a structured disposition.
- Require CI and human review before merge.