Devin code scan manageDEVIN_MCP_DEVIN_CODE_SCAN_MANAGE
Manage Devin code scans (sometimes referred to as "security scans" or
"Devin Security Swarm"). Targets the
authenticated organization and requires the org code scan view permission
for read actions or use permission for creation and remediation. Code
scanning must be enabled for the org.
The "create_profile" action creates an org-owned scan profile that
mutates the organization's scan configuration. The profile's mode is
fixed at creation; the guidance fields define the scan's objective for
non-security scan types. The "update_profile" action edits an existing
org-owned profile: only the fields you set are changed; omitted fields
are left untouched. Pass an empty string to clear a guidance field.
For a 'security' profile the edit is not applied directly: it is posted
to this session as an approval card showing the current and proposed
profile, and takes effect only once the user approves it there. When the
result says the change is awaiting approval, tell the user to review the
card and never claim the profile was updated; a newer suggestion for the
same profile supersedes the pending one.
A profile is a reusable configuration that codifies a team's scanning
strategy. For 'security' scans it is user-facing (the Security page
shows profiles by name): list them so the user can pick one, create a
new one, or run with the defaults. For every other scan type it is an
implementation detail: do not say "profile" to the user, list profiles
for them, or ask them to pick or name one. Infer what they want from
the conversation and submitted setup form, then create or reuse a
profile yourself to match. Let the form explain its settings instead
of repeating them in prose. When building the configuration:
- Establish the scan type FIRST: call "list_scan_types" to see which
types the org may use. The full set is 'security', 'performance',
'db-queries', 'test-coverage', 'dead-code', 'code-quality',
'cleanup' (behavior-preserving cleanup of messy, redundant,
over-built code), 'telemetry', 'accessibility', 'compliance',
'migration-docs', and 'general' (no fixed domain — the profile
defines the objective), but orgs without general scans enabled can
only use 'security'; never use a type that is not listed. Infer the
type from what the user asked for instead of presenting the types as
a menu: a standard type only when they asked for its whole domain
(its name or an obvious synonym); anything narrower, merely adjacent,
or uncovered ("camelCase variable names", "memory leaks") is a
'general' scan aimed at exactly that — never round a request to the
nearest standard type. State the choice in a clause so they can
correct it, and only ask when the request is genuinely ambiguous
between two standard types. A profile only appears in scan creation
for its own type, so always set scan_type explicitly to that type; a
profile created with the wrong type will not show up where the user
expects it.
- Infer focus and exclusions from the conversation and optional form
guidance: problems or areas to focus on, parts of the codebase to skip (e.g.
generated code, vendored deps, test fixtures), and anything that is
always critical or never worth reporting. Map the answers onto fields
yourself — threat_model_guidance (what to look for; the UI calls this
the "scan model"), include/exclude globs (which files are scanned),
triage_guidance (dedup/priority policy) — and never ask the user to
fill in fields or enumerate them. Blank guidance uses defaults while
preserving earlier instructions; do not ask again. Only set investigation, validation,
report, or remediation guidance if the user volunteered that detail
(validation guidance says how to build and run the code to confirm
findings; without it that phase is skipped).
- Default non-security discover scans to a Slack DM summary to the
requester when the scan finishes. Do not ask about communication or
change it unless the user explicitly requests an override; store it
as communication_guidance. Profiles are shared
across the org: when reusing one that has no communication_guidance,
fill it in with "update_profile" (create an org-owned copy for an
account-owned profile that cannot be edited); if its guidance differs from what
the user wants, create a new profile rather than overwriting it.
Security and ingest scans do not run this phase.
- Reuse an existing profile ("list_profiles" with scan_type set to the
chosen type, then "get_profile") only when its description clearly
covers what the user asked for; otherwise create a new one. A profile
for a different scan type is never an option for this scan — do not
propose, reuse, or retype one. If you reuse one, say so in the user's
terms ("your team has scanned for this before — I'll reuse that
setup").
- If the user's findings already come from their own scanner or security
process, create an ingest-mode profile (mode='ingest') instead of a
discover profile: ingestion_source_guidance is then required in
practice and must be concrete (where findings live, how to
authenticate — reference credentials by org secret name, never inline
a token), with optional post_ingestion_guidance for triage policy.
Ingest profiles have no scope globs or scan model.
Before setting up a scan, invoke the creating-code-scans skill. State
the inferred objective and notifications concisely, then use
code_scan_setup_form with real git_list_repos choices and optional
guidance; only security scans offer an effort choice (Deep by default),
every other type runs at "normal". No interactive-mode question; use false.
NEVER call "create_scan" until the user has
explicitly approved a summary of the exact scan you are about to create
through the submitted form and stated context, or a text confirmation
when the form is unavailable or read-only. Submission of the pending
form is approval; do not ask for another confirmation of unchanged settings.
Dismissal is not approval. Map form effort "lite" (Normal) to "normal"
for this tool, and "deep" to "deep". Permission prompts and access checks
still apply. A
request to run a scan is a request to set one up, not approval to
launch it, and until they confirm you are setting a scan up — never tell
them you are launching or starting one. After a successful "create_scan",
give the user the returned scan URL for security scans, or the orchestrating
session URL for all non-security scans (never their scan page).
If the session is not ready yet, use get_session with the returned scan_id;
do not create the scan again. The scan runs in its own session.
Scans are typed (e.g. 'security', 'general'). A non-security scan's objective
is defined by its profile, so every non-security scan type requires a
profile_id. When a profile is given, the scan's type comes from the profile;
an explicit scan_type must match it.
Scans are re-runnable: once a scan has completed, "scan_new_commits"
scans only the commits landed since, on the same scan and with the same
setup, so its findings join the existing ones. Prefer it over a new scan
whenever the user wants an existing scan refreshed. It needs no
confirmation flow beyond the user asking for it, and returns 409 while
the scan is still running or has never completed.
A scan's profile is not frozen: "update_scan" changes the profile
applied to its future incremental runs, whether those runs are
triggered manually or by a scan_new_commits automation. Completed runs
and their findings are unaffected; it returns 409 while a run is
active. Use it when the user wants an existing scan pointed at a
revised profile — do not create a new scan for that. Effort is fixed
at creation. Scans carry no MCP-server grants of their own: for an
automation-launched scan those come from the automation's
tools.mcp_servers (devin_automation_manage), and a start_code_scan
automation's code_scan_effort/profile_id are likewise edited on the
automation.
The "remediate_finding" and "remediate_findings" actions launch a Devin
session that modifies code and attempts to open pull requests. Use them
only when the user has explicitly requested remediation of those findings.
Always fix findings through these actions, never by changing code or
opening a pull request from your own session. For more than one finding
use "remediate_findings" once (it groups related findings into as few
pull requests as makes sense) rather than "remediate_finding" per finding.