> ## Documentation Index
> Fetch the complete documentation index at: https://docs.app.strix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up a pentest with your AI agent

> Let an AI coding agent such as Claude Code, Codex, Cursor, or Devin configure a pentest through the Strix MCP server, then review and launch it yourself

![](https://static.scarf.sh/a.png?x-pxid=831669b6-b4bd-42cb-8832-2122c03e1d5f)

A coding agent that can read your repository knows your application better than a form does. Strix gives the agent a prompt and a set of MCP tools. The agent adds targets, test users, and context, then gives you a link. You open the link, review the setup, and launch the pentest.

The agent does not launch the pentest and does not spend credits.

## Copy the prompt

1. Open **Pentests**, then select **New pentest**.
2. Select **Set up with your AI agent**. Strix copies the prompt.
3. Paste the prompt into your agent, in the repository of the application that you want to test.

The prompt contains the MCP server URL of your Strix deployment and the steps to connect it. See [MCP server](https://docs.app.strix.ai/guides/mcp.md) for the client setup.

## What the agent does

The prompt tells the agent to do these steps:

1. Connect the Strix MCP server and ask you to sign in. On Strix Cloud, the agent installs Strix from the MCP marketplace or connector directory of your client when Strix is listed there. On a self-hosted deployment, the agent adds the MCP server URL of your deployment and asks you for a Strix API token. A self-hosted deployment does not use OAuth sign-in for MCP. Create the token in **API access**, on the **Tokens** tab.
2. Read the codebase to find the deployed URLs, user roles, tenant boundaries, and login method.
3. Find the live domains of the application from the deploy and hosting configuration, and add them. A domain must be verified before Strix can test it. The agent tells you which DNS record or file to add if automatic verification is not possible.
4. Find the repositories of the application through your connected code host, and add them with the deployed branch. If GitHub or Bitbucket is not connected, or cannot reach a repository, the agent gives you a link that opens the code host's authorization page. The agent gives the same kind of link to connect Supabase, Cloudflare, Vercel, and Azure. Each link works for 10 minutes, and only for you while you are signed in to Strix. For GitLab, Azure Repos, AWS, and Google Cloud, the agent sends you to **Integrations**. If the agent finds no live domain, it stages a whitebox pentest of the repositories alone and tells you that no domain is in scope.
5. Map the auth matrix: each role, each tenant boundary, each login method, and what each role can and cannot reach.
6. Create two test users for each role in the matrix, in separate tenants where the application has tenants. The agent uses the sign-up and invite flows of your application, saves each user in Strix, and verifies that each login works. For email codes and magic links, the agent uses a Strix inbox. See [Test users](https://docs.app.strix.ai/guides/test-users.md).
7. Save API keys for API-only roles as scan headers on the domain.
8. Write knowledge documents about the architecture, the auth matrix, the API, the data model, and the business rules. See [Knowledge](https://docs.app.strix.ai/guides/knowledge.md).
9. Connect external knowledge sources, such as documentation, wikis, and tickets.
10. Connect the cloud infrastructure that runs the application. Supabase, Cloudflare, and Vercel use an access token. Other systems connect as a custom MCP server. For AWS, Azure, and Google Cloud, the agent sends you to **Integrations** to connect in the browser.
11. Call `create_scan_draft` with the targets, test users, cloud connections, context, focus, and concerns.
12. Give you the `launch_url` and a summary of the setup, with the test user for each cell of the auth matrix.

The agent asks you for each access token. Give it a read-only token with the least privilege for the environment under test. The agent tells you when it cannot create a role, and why.

## Review and launch

Open the `launch_url`. The pentest wizard opens on **Review & Launch** with the setup from the agent. Go back to a previous step to change anything, then launch the pentest.

A draft link works for admins and analysts of the same workspace. A draft from an agent or an API token expires after 7 days. A draft that you save in the wizard does not expire.

## Scan drafts

A draft is a pentest configuration that is saved but not started. A draft does not reserve credits.

Create a draft with the `create_scan_draft` MCP tool or with the API:

```bash theme={null}
curl -X POST https://app.strix.ai/api/v1/scans/drafts \
  -H "Authorization: Bearer $STRIX_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domain_ids": ["<domain-id>"],
    "test_user_ids": ["<test-user-id>"],
    "context": "Multi-tenant invoicing application…",
    "org_knowledge_enabled": true
  }'
```

The response contains the link:

```json theme={null}
{
  "id": "53599178-ef28-4fe1-92da-b9d2eaec17f2",
  "launch_url": "https://app.strix.ai/new-scan?draftId=53599178-ef28-4fe1-92da-b9d2eaec17f2&step=review",
  "expires_at": "2026-11-23T16:47:33Z"
}
```

The request body is the same as the body of a scan, with one difference. A draft cannot contain `credentials` or `headers`. Save test users and domain scan headers first, then refer to test users with `test_user_ids`. The token needs the `scans:write` scope.

You can also save a draft from the wizard. On **Review & Launch**, select **Save draft**. Strix copies the link. This draft does not expire. Logins and header values that you typed into the wizard are not saved in the draft.

To find a saved draft, open **Pentests** and select the **Drafts** tab. The tab lists the drafts that have not expired, and only the drafts whose targets you can use. Select a draft to open it on **Review & Launch**. To remove a draft, open its menu and select **Delete draft**. Admins and analysts see the tab.

The API has the same operations. `GET /api/v1/scans/drafts` lists the drafts. `DELETE /api/v1/scans/drafts/{draftId}` deletes a draft. Each operation needs the `scans:write` scope. The MCP tools are `list_scan_drafts` and `delete_scan_draft`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.