superagent_

// interfaces

Security settings

[ view markdown ]

Read and update per-object security features, schedules, branches, run limits, bot accounts, and labels through REST and MCP.

Manage the same security controls used by the dashboard through the REST API and MCP. Authenticate with an organization API key; the key determines the organization. Objects from other organizations return 404. No organization ID is accepted in these settings requests.

Updates preserve omitted fields. Empty arrays clear selections, and null removes a per-PR run limit. Disabling automatic work preserves historical results and does not cancel active runs. Enabling automatic work can start billable runs under the object's configured policy and limits.

Repositories

Method Path MCP tool
GET /repositories list_repositories
GET /repositories/{repositoryId}/settings get_repository_settings
PATCH /repositories/{repositoryId}/settings update_repository_settings

Use the positive numeric GitHub repository ID, sent as a string to MCP's repository_id field. The repository list includes each repository's current settings. Settings reads return defaults for fields that have not been configured, including private/public repository defaults for Contributor Trust and advisory triage. Settings updates persist organization-authorized overrides shared by the dashboard and scan execution.

Settings Fields
PR security scans pr_scan_enabled, pr_scan_base_branches, pr_scan_max_runs_per_pull_request, pr_scan_allowed_actors, pr_scan_custom_instructions
Supply-chain scans supply_chain_enabled, supply_chain_base_branches, supply_chain_max_runs_per_pull_request
Dependency Validation dependency_validation_enabled, dependency_validation_base_branches, dependency_validation_max_runs_per_pull_request, dependency_validation_custom_bot_logins, dependency_validation_affected_labels, dependency_validation_not_affected_labels
Contributor Trust contributor_trust_enabled, trusted_authors
Advisory triage advisory_triage_enabled
Clean-scan comments clean_scan_comment_enabled
Automatic red teaming red_team_mode, red_team_custom_goal_prompt, red_team_attack_scenario

Boolean fields accept JSON true or false. Branch lists accept up to 20 exact base branch names; an empty list permits all branches. Run limits accept positive integers up to 2,147,483,647, or null for unlimited runs.

Dependency Validation supports Dependabot and Renovate automatically. Add up to 100 additional GitHub logins, including regular user accounts used by self-hosted bots, with dependency_validation_custom_bot_logins. This does not bypass the existing GitHub commit-provenance checks. Configure up to 20 labels per outcome, with each label at most 50 characters. Lists are trimmed and deduplicated using the same rules as the dashboard.

Allowed PR review actors accept GitHub logins. Trusted authors also accept role:admin, role:maintain, and role:write. Both lists allow up to 100 entries.

red_team_mode accepts off, release, tag, daily, weekly, or monthly. Set it to off to disable automatic red teaming. Prompts accept a string or null to clear them. red_team_attack_scenario accepts an existing scenario selection such as { "id": "scenario-id", "revision": 1 }, or null to clear it; reads return the resolved scenario snapshot.

curl -X PATCH https://superagent.sh/api/v1/repositories/123456/settings \
  -H "Authorization: Bearer $SUPERAGENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "pr_scan_enabled": true,
    "dependency_validation_enabled": true,
    "dependency_validation_base_branches": ["main", "release"],
    "dependency_validation_max_runs_per_pull_request": 3,
    "dependency_validation_custom_bot_logins": ["our-renovate"],
    "dependency_validation_affected_labels": ["affected"],
    "dependency_validation_not_affected_labels": ["not-affected"]
  }'

The equivalent MCP call is update_repository_settings with repository_id plus the same settings fields. For example, remove the run limit and permit all target branches with:

{
  "repository_id": "123456",
  "dependency_validation_max_runs_per_pull_request": null,
  "dependency_validation_base_branches": []
}

Concurrent repository updates preserve unrelated changes. If repeated concurrent writes prevent an update, the API returns 409; read the current settings and retry.

Applications and agents

Use the existing GET and PATCH /applications/{application_id} and GET and PATCH /agents/{agent_id} endpoints, or MCP's get_application, update_application, get_agent, and update_agent tools.

Set red_team_schedule to daily, weekly, or monthly to enable automatic runs, or off to disable them. Configure the target and required credentials before enabling the schedule.

{
  "red_team_schedule": "weekly"
}

Images

Use GET and PATCH /images/{image_id}, or MCP's get_image and update_image. Set auto_validate to enable or disable automatic advisory validation. Configure tracked_tags, tag_patterns, newest_versions, and max_runs_per_day to select versions and bound automatic work. Existing registry connection and image setup requirements still apply. See Images for the selection and refresh workflow.

Sites and Script guard

Method Path MCP tool
GET /sites list_sites
GET /sites/{siteId} get_site
PATCH /sites/{siteId} update_site

For an existing site, set monitoring_enabled to true or false. MCP also takes site_id. Enabling requires the existing Cloudflare connection and a hostname proxied through Cloudflare. The update deploys the monitoring rule and schedules script capture. This uses the same deployment lease, error recovery, and capture behavior as the dashboard. A deployment in progress returns 409.

{
  "monitoring_enabled": true
}

Infrastructure sources

Method Path MCP tool
GET /infrastructure/sources list_infrastructure_sources
GET /infrastructure/sources/{sourceId} get_infrastructure_source
PATCH /infrastructure/sources/{sourceId} update_infrastructure_source

Set enabled to enable or disable an existing source. Re-enabling resumes deferred processing. You can also update name, application_group, and environment. MCP takes source_id plus the same fields. Archived sources are excluded from lists and cannot be re-enabled through these endpoints.

Responses and errors

Successful responses use { "data": ... }, including lists. Settings updates return the current saved settings or object. Invalid JSON, unsupported fields, empty updates, and invalid values return 400. Invalid API keys return 401, objects outside the key's organization return 404, and concurrent deployment or settings conflicts return 409.

The OpenAPI specification contains the complete field schemas. MCP clients expose the same settings in their generated tool input schemas; include intent when requested by the connected server's schema.