Configure a Tenant with MCP
Set up and run Web, Network, Cloud, and Code assessments by asking an AI agent connected to the Pentest Copilot MCP server.
Once an agent is connected to the platform MCP server (see API Keys & MCP Server), you can set up and run assessments by describing what you want. The agent calls the same named tools the web app uses, and every scope, permission, verification, and launch check still applies.
This page explains what the agent does at each step, what it needs to ask you, and which steps only a person can complete. The agent reads the authoritative procedure from the server itself, so this page and the built-in manual agree.
How a Setup Conversation Works
The agent reads the manual
The agent calls get_setup_information first. It returns the full setup manual and a configuration_reference with the values your tenant accepts: attack vectors, network exploit categories, cloud providers, code-scan options, and scan-setting limits. Reading it performs no setup and sends no traffic.
The agent asks only for missing decisions
Expect questions about:
the approved target and any exclusions;
Discovery, Assessment, or both;
public coverage, authenticated coverage, or both, and which account roles to test;
request rate and runtime limits;
for Network and Cloud: network-only, cloud-only, or hybrid, and which connected agent to use;
which attack vectors or exploit categories are approved;
whether the run is one-off or recurring.
The agent should not choose a connected agent, enable destructive or state-changing tests, enable Intercept, or turn on future automated scans or autofix unless you explicitly approve it.
The agent validates, shows the effective configuration, then launches
validate_scan_config reviews a draft without saving or launching and reports blocking errors, warnings, and checks it could not perform. The agent saves the configuration with save_scan_config, can estimate runtime and credits with get_scan_estimate, shows you the effective settings, and launches within what you approved. Saving a configuration does not start a run.
Web Assessment
Example prompt:
Set up an authenticated web assessment of
app.example.comwith a read-only customer account. Run Discovery first, then let me review before the attack phase. Keep the rate at 30 requests per minute.
1. Target and Scope
The agent lists existing Domain targets and the allowlist, then creates the target with create_root_target if needed and keeps the returned entity ID. Creating a target and allowing it are separate: add_whitelist_domain allows a domain, and add_blacklist_domain excludes one.
For API-level control, add_trajectory_rule adds host and path-regex allow or deny rules. test_trajectory_rule previews whether a given host and path will be tested. See Trajectories and Domains.
Allowlisting a domain in Pentest Copilot does not change your WAF or firewall.
2. Domain Ownership
Where ownership verification is enforced, the agent reads get_domain_verifications and gives you the exact DNS TXT record. You publish it with your DNS provider, and the agent then calls verify_domain_ownership. If the challenge has expired, refresh_domain_verification issues a new one. Scans do not run until verification passes. See Domain Verification.
On shared-trial workspaces, verify ownership in the web app.
3. Egress
get_egress_options lists the locations scan traffic can leave from and the sandbox IPs to allow-list if your target sits behind an IP allow-list, firewall, or WAF. Recording, validation, and scanning should use compatible egress. See Scan Noise and Safety.
4. Login Sessions (Authenticated Coverage)
The agent first checks get_browser_sessions for a ready session it can reuse. Otherwise there are two ways to provide one:
Record a login. start_browser_recording returns a recorder URL that you open yourself:
Sign in to Pentest Copilot as the API key's owner if prompted.
Select Start Auth just before logging in, and complete every login step.
Set the Verify URL on a page only a logged-in user can see.
Select Stop Auth, optionally set the Starting URL, then Done.
Use Auth Actions for TOTP, email or SMS one-time codes, magic links, and supported captcha helpers instead of hard-coding expiring values. For OTP or magic-link logins, the agent picks an inbox with list_email_identities (or create_email_identity). The agent tracks the recording with get_browser_recording. Opening the URL is not completion, and cancel_browser_recording closes an abandoned recorder. See Recording Browser Session, Handling Captcha/Email/Mobile OTPs, and Email Identities.
Import a session. import_browser_session accepts real Playwright storage_state, session_storage, login actions, and verification criteria. See Importing Browser Session.
Every session must then pass validate_browser_session, which replays the login from the chosen egress and sends traffic to the target. The agent polls get_browser_sessions for the result. Failed, expired, or changed sessions are repaired and validated again, not skipped. Use one session per account role. See Validating Browser Sessions.
5. Rate and Configuration
calibrate_domain_rate_limit optionally measures a sustainable request rate by sending controlled traffic, and get_domain_rate_limit reads the result. An estimate is not a calibration.
The agent then builds the scan configuration. The main choices are:
authentication_types
Public, authenticated, or both. Choose explicitly.
browser_session_ids
Validated sessions for authenticated coverage, one per role.
rate_limit_per_minute
An agreed request rate.
attack_vectors
Approved categories, from configuration_reference.
sandbox_egress_location, residential proxy options
Locations from get_egress_options.
custom_headers
Only routing or test headers your target requires.
selected_trajectory_ids
Optional: limit the attack to specific discovered flows.
max_module_runtime, concurrency caps
Optional runtime and parallelism limits.
scan_type, auto_run_web (Discovery only)
Discovery coverage, and whether the attack phase starts automatically.
The full field list is in the manual and in Configure Scan Settings for Web Assessment.
6. Launch
Assessment only:
start_web_assessmentwith the target and savedscan_config_id.Discovery, or Discovery then Assessment: save a
WEB_DISCOVERYconfiguration and callstart_web_discovery. Setauto_run_web: truein the saved configuration only if the attack phase should start automatically. Thedomains-onlyscan type never starts the attack phase.
The agent returns the run IDs and monitors them (see Monitor Runs and Read Results).
Network Assessment
Network assessments run through a customer agent installed on a host inside your network. See How to Trigger a Network Assessment. Network and Cloud assessments, agents, and schedules are not available in shared-trial workspaces.
Example prompt:
List my connected agents. Using the one on the build server, run discovery on 10.10.10.0/24 only. Don't start any attack yet.
Choose the agent. The agent calls
list_agentsandget_agent_details, shows you the connected agents with their hosts and reported subnets, and asks which to use. Platform SANDBOX and CLOUD workers are not customer agents.Install an agent if none is connected.
get_agent_installation(Admin) returns an expiring launcher. You run it on an authorized host that can reach the targets and your tenant, then the agent checks again until it connects. Treat the launcher as a secret. See Download Agent.Agree scope. Which reported CIDRs, contained partial targets, exclusions, exploit categories, and limits. Discovery targets CIDR strings. Assessment targets the
Subnetentities that discovery creates.Discover. The agent validates and saves a
NETWORK_DISCOVERYconfiguration, then callsstart_network_discoverywith the chosen agent.Review, then assess. After you review the discovered hosts and failed jobs, the agent saves a
NETWORK_ASSESSMENTconfiguration with explicitallowed_exploitsand callsstart_network_assessment. For Discovery then Assessment in one run,auto_run_network: truemust be saved deliberately.
Start narrow. Intercept (responder) stays off unless approved, and needs the chosen agent's interfaces. Discuss Active Directory and certificate-service writes, credential access, relay, remote code execution, data copying, and cleanup separately. See Network Assessment Destructive Actions.
Cloud Assessment
Cloud assessments use a customer agent running on a VM inside your cloud account, with a native cloud identity. Static cloud keys are not supported. See Run a Cloud Assessment.
Prepare the VM and identity outside Pentest Copilot. Use a dedicated VM: EC2 in AWS, an Azure VM, or Compute Engine in GCP. Attach an instance role, managed identity, or service account with scoped read permissions, and enable the needed provider APIs. See Cloud Assessment Prerequisites, Set Up the Cloud Agent, and Cloud Permissions.
Confirm the agent and identity. The agent uses
list_agentsandget_agent_details, which show the provider metadata the VM reports. Anything not reported is unverified, not passed.Discover. Cloud uses
NETWORK_DISCOVERYwithenvironment_mode: "cloud", the provider, and the account, subscription, or project. AWS also needs literalresource_name_prefixes. The discoveredCloudScopeis the target for the attack phase.Review coverage. Discovery failures usually mean missing permissions or disabled APIs. Fix them in your cloud account and re-run discovery narrowly. Do not treat partial collection as full coverage.
Assess. The agent saves a
NETWORK_ASSESSMENTconfiguration for theCloudScopewith approved categories and callsstart_network_assessment. Leave destructive impact, persistence, defense evasion, and workload execution off unless specifically approved. Grant only temporary active-test permissions, and agree stop conditions and a cleanup owner. See Safety and Cleanup.
For hybrid environments, review and launch each discovered Subnet and CloudScope separately.
Code Assessment
Example prompt:
Connect our GitHub org, then run a code assessment on the
mainbranch ofacme/payments-apiwith SBOM. Don't turn on PR or push scans.
Connect GitHub.
get_github_connectionshows the current state. If disconnected,begin_github_connectionreturns a GitHub App consent URL and a short-lived setup token. You approve the app for the repositories you authorize, then give the returnedinstallation_idandstateback to the agent, which callscomplete_github_connectionwith the same API key within 15 minutes. See Configure GitHub for Code Assessment.Pick the repository.
list_github_repositoriesandconnect_code_repositoryadd the repository as a target.set_repository_domaincan link it to a web target.Pick the code to scan.
list_repository_refssuggests branches, open pull requests, and recent commits. Confirm the exact branch, commit, or PR.Configure.
get_code_scan_settingsandupdate_code_scan_settingsset capabilities, SBOM, PR checks, and automation. Leave branch, PR, push, and autofix automation off unless you want future runs.Launch.
start_code_assessmentwith the scope and ref.
Findings appear as Vulnerability assets under the repository's CodeSnapshot. Dependency and AI inventories are read page by page with get_asset and code_inventory: "sbom" or "ai_bom". See Configure Scan Settings for Code Assessment.
On shared-trial workspaces, Code assessment requires an active subscription.
Schedules and Repeat Runs
list_scan_schedulesshows existing one-time and recurring runs. Check it before creating another.create_scan_scheduleschedules a run from savedscan_config_idvalues. Confirm your timezone when the agent converts the time.update_scan_schedulechanges timing only. Recreate a schedule to change scope.delete_scan_schedulestops future launches. It does not cancel a run already in progress.
Creating, updating, and deleting schedules requires an Admin key. Code PR and push automation lives in the repository's code-scan settings, not in schedules. See Scheduling.
For a repeat run, the agent reads the saved configuration (get_scan_config or get_code_scan_settings) and the current session and agent state. It shows you what would change, revalidates changed credentials or scope, saves, and launches.
Monitor Runs and Read Results
Run status
get_module_stats, get_jobs, get_submodule_status, get_job_status
Pause, resume, cancel a run
pause_assessment, resume_assessment, cancel_assessment (one run at a time, by module_refid)
Stop or retry one step
cancel_submodule, rerun_submodule
Findings and assets
list_assets, get_asset, search_graph, get_graph_node, get_graph_root_nodes
Activity
get_attack_logs
Reports
generate_report, list_reports
Cancellation stops remaining work. It does not undo changes a test already made. See Analysing Scan Results and Reports.
Steps Only a Person Can Do
The agent pauses and hands these to you, using the URLs and values the server returns:
publish DNS TXT records for domain verification;
add scanner egress IPs to a WAF or firewall allow-list;
open the browser recorder and complete the login recording;
run the agent launcher on an approved host;
attach cloud identities and grant cloud permissions;
approve the GitHub App installation.
The agent should never invent console links or embed API keys in URLs.
Good Practice
Read existing state before changing it, and reuse targets, sessions, and configurations.
After a timeout, check whether the target, recording, configuration, schedule, or run was created before retrying.
Treat validation as a snapshot. The launch re-checks live policy, and an accepted scan does not prove complete coverage.
Keep secrets in session and configuration inputs, never in explanations, logs, or report text.
When a plan, role, credit, or feature restriction blocks a step, report the blocker. Do not try to work around it.
Last updated