---
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/scan-auth-weaknesses/copilot
---
# How to Scan Auth Weaknesses with Copilot

Copilot integrates penetration testing directly into your development workflow, letting you scan for vulnerabilities and generate fix code without leaving your IDE. Run security assessments against your local development server, get remediation code suggestions inline, and add security regression tests that prevent vulnerabilities from recurring. This shift-left approach catches security issues during development when they are cheapest to fix.

## Setup

{"mcpServers":{"toolrouter":{"command":"npx","args":["-y","toolrouter-mcp"]}}}

## Steps

1. Add ToolRouter to Copilot MCP config
2. In Copilot Chat: "Test my app's authentication for security weaknesses"
3. Copilot tests login and session flows and returns findings
4. Ask: "Fix these auth vulnerabilities in my Express/Passport setup"
5. Apply authentication hardening directly in your code

## Example Prompt

```
Scan the authentication system at http://localhost:3000 for weaknesses. Then help me harden my Passport.js configuration.
```

## Tips

- Copilot can generate secure authentication middleware based on the findings
- Review session configuration, cookie flags, and token expiration settings
- Add rate limiting to login endpoints to prevent brute force attacks
