Reading a Scan Result

Every scan comes back with a safetyScore object: a score, a threat level, and a recommended action, plus fields that say how confident and how complete the verdict is. This page is the complete reference for those fields and what to do with each value.

The short version#

Gate on safetyScore.recommendedAction. It is always Allow, Review or Block, it already accounts for every engine and every cap described below, and it is the field the SDK guards act on. The score and threat level explain the decision; they are not a second decision to make.

Treat any threatLevel or recommendedAction value you do not recognize as unsafe rather than assuming it is clean.

Threat levels#

threatLevel Score recommendedAction Meaning
Clean 86–100 Allow No engine found anything of note
Informational 71–85 Allow Minor signals were noted, or the format is one Surface cannot analyze deeply (see Coverage). Still safe to allow
Suspicious 31–70 Review Real signals, but not enough evidence to block automatically
Risky 0–30 Block An agent tool call whose effect is harmful (customer data to a personal mailbox, a production delete) with nothing else wrong. Blocked like Malicious, but it is not malware
Malicious 0–30 Block Malware, a high-severity prompt injection, or another strong detection
Rejected — Block Nothing was scanned: the scan profile does not accept this file type
Error 0 Block Nothing was scanned: the scan could not run

The score is 0 to 100 and higher is safer. Internally Surface scores how malicious content looks and reports the inverse, so the bands above are fixed thresholds, identical in the hosted API and the scanner binary.

Risky is not Malicious#

Risky exists so that a blocked agent action is not reported as malware. A Block that rests only on what a tool call would do, with no malware and no prompt injection behind it, is relabeled from Malicious to Risky. The recommended action stays Block. Because the label is different, a Risky result never triggers IP auto-blocking. Analytics count it as a detection alongside Suspicious and Malicious (see Usage and quotas).

Rejected and Error mean "not scanned"#

Neither is a verdict about the content. Both recommend Block so that code gating on the action fails closed.

On the hosted API the reason for an Error is in primaryThreat and threatSummary. It has confidence: "None" and reports coverage: "minimal", because no engine ran.

recommendedAction Comes from Typical handling
Allow Clean, Informational Let the content through
Review Suspicious Hold it for a person, or route it to a stricter path
Block Risky, Malicious, Rejected, Error Refuse it

How to act on it#

What you are protecting Allow Review Block
File uploads Store the file Quarantine until someone looks Reject the upload; keep the requestId for the record
Content an agent will read (web pages, emails, tool output) Pass it to the model Pass it with a warning, or drop it, depending on how much the agent can do Do not pass it to the model
An agent tool call Execute it Ask the user to confirm Do not execute it; tell the user why using threatSummary
Rejected or Error — — Retry Error later, or scan the content another way. Fix the profile for Rejected. Do not treat either as clean

Confidence#

confidence is High, Medium or Low, with confidenceScore (0 to 1) as the same thing in numeric form and confidenceReason as a sentence explaining it. It reflects how many independent engines agree:

confidence Typically means
High Three or more engines analyzed the content: either several independent signals, or several engines checked and found nothing
Medium Two engines analyzed the content, or a clean result rests on limited engine coverage
Low A single engine's detection, or no engine contributed a signal
None An Error result: no engine ran

Confidence describes the verdict; it does not change it. A Low-confidence Suspicious is still Review. If you want to treat low-confidence results differently, do that in your own code.

Coverage#

coverage says how far analysis reaches for this format, so you can tell a strong Clean from a weak one.

coverage What ran Formats
full Dedicated ML model plus the full engine set Windows executables (PE), Linux binaries (ELF)
partial ML model plus the full engine set, with detection varying by language and obfuscation Scripts, documents, archives, and anything else not listed
minimal Pattern rules and threat feeds only; no ML model exists for the format Java bytecode (.class), Mach-O binaries, and archives containing .class or .dex entries (JARs and APKs)

A minimal scan never comes back Clean. Its score is capped at 85 and its level is raised to Informational. Informational still means Allow, so the cap changes what Surface claims, not what it blocks, and a real detection is never softened by it. The one exception is a file on Surface's known-good list, which reports Clean with primaryThreat: "Whitelisted file" whatever its format.

coverageNote is present when coverage is less than full and says what is missing. Coverage can also drop from full to partial when prompt-injection analysis stopped short on very long text; the note then says how many bytes were examined.

See Detection coverage for what sits behind each tier.

Primary threat and summary#

For Rejected and Error, both fields carry the reason nothing was scanned.

Other fields you may rely on#

Field Description
requestId Correlation ID. Send X-Request-ID on the request to set your own
name The filename, or the payload's label. Empty for a payload with no label
hash SHA-256 of the scanned content. Results from the current scanner prefix it with sha256:; strip the prefix before comparing with a hash you computed
size, contentType Size in bytes and detected content type
scanType file or payload
scanTimeMs, timestamp Scan duration in milliseconds; completion time in Unix seconds
safetyScore.enginesUsed Engines that analyzed the content
safetyScore.enginesFlagged Engines that found something
safetyScore.suppressedEngines Engines that fired but whose findings your scan profile hides. The verdict still reflects them
safetyScore.cveFindings CVE records linked to a detection, when there are any
archiveEntries For archives: one entry per file inside, each with name, verdict, threats and any IOC counts. skipped and skipReason mark entries that were not scanned
hasEncryptedEntries true when an archive held entries that could not be opened
payloadIOCs URLs, IPs, domains and hashes found in the content

Payload scans add per-engine detail objects (promptInjection, sensitiveData, codeExtraction, toolCallAnalysis and others). Their shapes are in the API reference. They explain the verdict; recommendedAction already includes them.

Where the result sits#

Example: a deferred scan that could not run#

Polling a deferred scan whose scan failed returns this result under result (abridged to the verdict fields):

json

{
  "name": "large_archive.zip",
  "safetyScore": {
    "score": 0,
    "threatLevel": "Error",
    "confidence": "None",
    "confidenceScore": 0,
    "confidenceReason": "No engine ran, so there is nothing to be confident about.",
    "primaryThreat": "Scan engine unavailable: the file was not scanned",
    "threatSummary": "Scan engine unavailable: the file was not scanned",
    "enginesUsed": [],
    "enginesFlagged": [],
    "recommendedAction": "Block",
    "coverage": "minimal"
  }
}

The scan was still counted against your monthly allowance, because deferred scans are counted when they are queued (see Usage and quotas).