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.
Rejectedis what the scanner binary returns when its synced profile does not accept the file type. It carries a score of 100, so never gate on the score alone. The hosted API does not produce aRejectedresult: it refuses the request with HTTP 400 before scanning (see Errors and limits).Erroron the hosted API appears on a deferred scan whose scan could not run. It is stored as the result, returned when you poll, and delivered to your webhook. A synchronous scan that cannot run does not return anErrorresult; it returns HTTP 503 instead (see Errors and limits).
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.
Recommended action#
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#
primaryThreatis the headline: the name of the top threat, or"No threats detected". When a prompt injection drives the verdict and no malware is named, it readsPrompt injection detected (high risk)(ormedium/low).threatSummaryis a one-line description of what was found, suitable for showing to a user.info, when present, carries extra context for minor flags.
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#
- Synchronous scans return the object above as the whole response body.
- Polled deferred scans return a summary envelope with the full result under
result. The envelope'ssafetyScoreis just the number; the object is atresult.safetyScore. See Async scanning. - Strand normalizes field names to
snake_case(threat_level,recommended_action). See Strand integration.
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):
{
"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).
Related#
- API reference: the full response shape
- Errors and limits: what comes back when a scan is refused
- Detection coverage: what each coverage tier can and cannot catch
- Scan profiles: engine toggles and sensitivity, which change what counts toward the verdict
- Webhooks: receiving results asynchronously
Tendrl