---
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-api-security/claude
---
# How to Test API Security 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 the security of my API using pentest" and provide the base URL
3. Claude probes API endpoints for authentication, authorization, and injection vulnerabilities
4. Review findings organized by OWASP API Security Top 10 categories
5. Fix identified issues and re-test to verify remediation

## Example Prompt

```
Test the security of my REST API at https://api.staging.myapp.com. Check authentication, authorization boundaries, rate limiting, and input validation.
```

## Tips

- Provide API documentation or an OpenAPI spec for more thorough testing
- Ask Claude to test both authenticated and unauthenticated access patterns
- Focus on endpoints that handle sensitive data or financial transactions first
