ScopeGuard MCP tools

Agents reach the scanner through twelve MCP tools. Every tool call goes through the same shared rules (ScanService) as the console and A2A, so an agent can only do what the operator allowed, and a person approves every scan.

you approve needs a human (chatbot: approval form) read only no request to the target target sends in-scope requests to the website rules checked by ScanService disk reads data/
Agent personas
H
Human operator
  • owns the targets and sets the allowlist
  • approves, edits or cancels every scan
  • reads the verified result and reports
approval form · chatbot UI
A
MCP chatbot agent
  • LangChain create_agent · AgentState
  • InMemorySaver · summarization
  • HumanInTheLoop before start/cancel
  • watch_scan streams each step
  • guardrails: input · tool args · output
  • tool switches: CHATBOT_DISABLED_TOOLS
Streamable HTTP /mcp · Bearer JWT
C
Coding assistant
  • Claude Code, Cursor, VS Code, Codex
  • asks the user before confirming authorization
  • turns findings into code fixes
stdio · scopeguard-mcp (.mcp.json)
⇄JSON-RPC TOOL CALLS⇄
MCP server · mcp_server/server.py
/mcp · Streamable HTTPinside pentest-agent · every call needs a JWT; tools run as the token's user, roles and access attributes
stdio · scopeguard-mcpchild process of the assistant · no port, no token · principal "mcp" with MCP_ROLE

1 · Discover

scan_policy allowed targets, profiles your role may run, credential profile names, rules
read only

2 · Run

start_scan target_url, authorization_confirmed, profile (quick / standard / aggressive / auth_deep), credentials by name, optional upload_id or git_url (code analysed in the code_sast step, same report), scan_scope: website_and_code / website / code (code only: target_url optional, no request to any site); idempotency_key: a retry with the same key returns the first scan, never a second one
you approvetargetrules
start_demo_scan built-in vulnerable app on loopback; no allowlist entry needed; idempotency_key
you approverules
cancel_scan stops after the current step; audited
you approve
submit_sign_in a scan paused for SSO / MFA (status input_required): mfa_code, or a stored session profile after you signed in in your browser
you answertargetrules
skip_sign_in escape hatch: continue unauthenticated (Esc in the chat card); no answer in time = skip
you answer

3 · Follow

get_scan status + finished steps; at the end counts, findings, red flags, summary, report files, audit record (chatbot: watch_scan streams it)
read only
list_scans your scans in this server process
read only

4 · Read

list_reports saved reports, also from the console, CLI and A2A
read onlydisk
get_report full report text (md / json), wrapped as untrusted content
read onlydisk
verify_audit_log hash chain + report hashes (admin); trail = scans | code
read onlydisk

5 · Code

upload_code a .zip (name, MIME type, zip signature checked) or code files; admin; nothing unpacked here; Python only for now; idempotency_key (same upload_id on a retry)
rulesdisk
start_scan(upload_id | git_url, scan_scope) the code is analysed only as the scan's code_sast step, with the website or code only (git: .git link, reachability checked, optional branch/tag): Kubernetes Job or the Python process sandbox, no network; non-Python files marked partial, executables/batch files as warnings, shell scripts as notes; get_scan.code_sast
you approverules
Rules on every call · scan_service.py
  • target on the operator allowlist
  • authorization_confirmed must be true
  • only the four pentest profiles
  • RBAC + ABAC on every tool call (default deny), owner-only scans and reports
  • credentials by profile name, never returned
  • one scan at a time
  • output wrapped as untrusted data
  • every call logged, every refusal audited
  • tools switched off: MCP_DISABLED_TOOLS
  • code uploads: .zip only, scan:source
  • site text to the LLM: wrapped, never obeyed
→RUNS→
Behind the tools
LangGraph scan pipeline
  • validate · recon · auth · sandbox_check
  • dast · plan_probes · run_probes
  • aggregate · report · audit
↓
Target website
  • in-scope requests only
  • GET / HEAD / OPTIONS / TRACE
  • no file downloads, no DNS rebinding
data/ on disk
  • reports/<scan_id>/report.html · .md · .json · .docx
  • audit/audit.jsonl (hash-chained)
Groq / OpenRouter LLM (optional)
  • probe plan + executive summary
  • deterministic fallback without it
A typical session (chatbot)
1
scan_policythe agent checks the target is allowed and which profiles it may use
2
approval formyou pick target, what to test (website + code / website only / code only) and profile, and tick "I own or may test this"
3
start_scanruns with authorization_confirmed=true, set by your approval
4
get_scan · watch_scaneach step streams in; the verified result block appears
5
explain · get_reportthe agent explains the findings; full report on request

Everything a scan returns comes from the scanned site: evidence, summary and reports are wrapped in <<<UNTRUSTED_…>>> markers, and agents treat them as data, never as instructions.