---
title: ToolRouter — Agent Use Case Guide
description: Step-by-step guide for completing a task with a specific AI agent using ToolRouter.
url: https://toolrouter.com/tools/pentest/use-cases/test-xss-exposure/claude
---
# How to Test XSS Exposure with Claude

Claude transforms penetration testing into a conversational security review where each discovered vulnerability leads to deeper investigation. Ask Claude to scan your application, explain each finding in context, chain additional targeted tests based on initial results, and generate remediation code for every issue found. Its analytical depth is ideal for security-conscious developers who want to understand not just what is vulnerable but why and how to fix it permanently.

## Setup

claude mcp add toolrouter -- npx -y toolrouter-mcp

## Steps

1. Connect ToolRouter: claude mcp add toolrouter -- npx -y toolrouter-mcp
2. Ask Claude: "Test this application for XSS vulnerabilities using pentest" and provide the URL
3. Claude sends XSS payloads to input fields and analyzes responses
4. Review which inputs reflect or store unsanitized user content
5. Implement proper output encoding and Content Security Policy headers

## Example Prompt

```
Test https://staging.myapp.com for XSS vulnerabilities. Check all user input fields including comments, search, profile fields, and URL parameters.
```

## Tips

- Ask Claude to test for both reflected and stored XSS variants
- Request Content Security Policy header recommendations based on the findings
- Test with different encoding contexts: HTML, JavaScript, URL, and CSS
