Results and evidence
Read scan status, category results, and evidence, and handle incomplete analysis.
A scan has two separate outcomes: whether the analysis finished, and what it found. Check both before acting on the content.
Why the response contains jobs
Section titled “Why the response contains jobs”Every scan uses the same status, input, extraction, coverage, usage, and jobs envelope. A completed anonymous request contains its jobs directly; those inline jobs have no status_url and cannot be polled. An authenticated URL or file request normally returns 202 accepted with job references and uses GET /api/v1/scan/{job_id} for completed jobs. A URL has one job per extracted segment; a file has one job per file. Top-level metadata describes the submission, while categories, decision, and safety_status describe each completed job. Completed inline responses also include those fields at the top level for existing clients.
ark_version is the version of the internal Ark result contract that the Control Plane interpreted to produce the response. It is currently "1" and is present on accepted, completed, and polled scan responses. This is distinct from the public /api/v1 route version, extraction.version, and usage.unit_version.
URL responses include segments: each item has a stable id, a kind describing the extracted surface, its graphemes, and, once complete, its category results and evidence. The canonical text sent to Ark starts with a short source label for the segment kind; chunk offsets refer to that labeled text. Static URL extraction reports partial on both access paths because dynamic page content is not scanned. This coverage metadata does not change an otherwise complete final classification.
The job status is only lifecycle state: running, completed, or failed. The decision summarizes how an application should handle the result:
| Decision | Meaning |
|---|---|
allow | Final classifications for the requested categories are benign. |
block | At least one requested category reported a blocking finding. |
review | A final classification is missing or inconclusive. |
safety_status is attack for a final attack. With a benign final result it is review only when the category result has level: "L3", decision_evidence.stage is union, and a decisive attack chunk from source: "l3" differs from the final class with confidence strictly greater than 0.1; otherwise it is benign. With a benign final result, decision stays allow. Extraction coverage is reported separately; clients can apply their own policy to partial coverage.
Ark 0.1.18 reports eleven attack classes separately. The former threat category is rejected. A request for hidden instructions reports under prompt_extraction; risky actions under unsafe_action; secret transfers under exfiltration. PII and DLP keep their own category keys. Check each category you requested, since a finding in one does not imply another category ran.
Descriptive classifications
Section titled “Descriptive classifications”sensitive_document, routing, tool_class, tool_action, and tool_tags describe content or operations. A label such as tool_class.web.fetch does not itself imply an attack. These categories remain in the response with their evidence and do not change the aggregate protection decision. A scan containing only descriptive categories returns decision: "review" and safety_status: "review", since no safety verdict was requested. Apply your application policy to the classifications.
Cat shell command results
Section titled “Cat shell command results”When the caller selects shell_command, Cat reads the supplied command or script without executing it. The category has model: "cat-shell-risk-commander" and a shell_decision of allow, ask, or block. ask maps the job’s decision to review unless another selected category blocks; block maps it to block. Read the category’s shell_decision when enforcing a command policy; class_name is shell_risk for both ask and block and safe for allow. Bounded shell_details contains model and policy evidence. Cat’s confidence is a transformed distance from its threshold, not a calibrated probability of danger.
{ "categories": { "shell_command": { "category": "shell_command", "class_name": "shell_risk", "model": "cat-shell-risk-commander", "level": "L1", "shell_decision": "ask" } }, "decision": "review"}For PII and DLP, evidence_spans gives matched source text and offsets. In balanced or recall mode, a lower-scoring native finding can be filtered out; the mode is independent for each category. Attack-class modes work the same way on their categories. If the opt-in cascade decides a category early, the result can include module_decision with its outcome and deciding stage.
For PDFs, coverage.input_tokens counts the extracted text sent to analysis, not the binary file size. Images, fonts, layout data, and compression increase PDF bytes without becoming text tokens. pages_scanned / pages_total shows how many pages supplied a readable text layer; pages without one produce partial coverage because OCR is not currently performed.
Which Guardrails a scan used
Section titled “Which Guardrails a scan used”A scan without config runs with the Guardrails of the API key’s project. Its response, and every asynchronous job result, carries the snapshot it used:
{"status": "completed", "project": {"id": "proj_4f6a0c1e9b2d47a8a3c5e7f9b1d3a5c7", "revision": 3}, "jobs": []}revision increases each time the project’s Guardrails are saved. A response without project came from an explicit request config. Log project with your own request ID to trace a decision back to the exact Guardrails. The categories present in jobs[].categories follow the project, so read the keys that are present rather than a fixed list. See projects and Guardrails.
Read a result in this order
Section titled “Read a result in this order”- Job status: continue polling
running; stop oncompletedorfailed. - Extraction and coverage:
partialmeans some supplied content was not represented in canonical scan text; make a separate coverage decision. - Completion: inspect
completion.stateand any failures. A completed job can still have degraded analysis. - Categories: read each requested category’s classification and evidence. Missing results do not establish that an input is clean.
- Application policy: decide what to allow, block, redact, or send for review.
| Situation | Interpretation | Suggested handling |
|---|---|---|
| Completed, complete analysis, expected safe classification | The requested analysis finished without a reported failure. | Apply your policy; a scan cannot guarantee the absence of risk. |
| Completed, complete analysis, detection reported | Analysis finished and found a signal. | Use category results and evidence to choose an action. |
| Completed, degraded analysis | Some analysis failed or was unavailable. | Review or use a fallback; do not silently treat it as clean. |
| Failed job or failed completion | Analysis did not complete successfully. | Handle the failure explicitly. |
| Missing completion or requested category | Insufficient information for a complete result. | Use your fallback policy. |
These are handling examples, not fixed classifications. class_name, decision, model identifiers, and evidence labels are open strings. Do not infer an allow decision from HTTP 200, accepted, or confidence alone.
Example: degraded analysis
Section titled “Example: degraded analysis”This example shows why a terminal job still needs a completion check. Its classification values are illustrative.
{ "job_id": "job_0123456789abcdef0123456789abcdef", "source": "text", "status": "completed", "input": {"kind": "text", "media_types": ["text/plain"]}, "extraction": {"version": "document-v1", "state": "complete", "documents_total": 1, "documents_scanned": 1, "warnings": []}, "coverage": {"state": "complete", "input_tokens": 12, "documents_total": 1, "documents_scanned": 1}, "usage": {"input_tokens": 12, "scan_units": 1, "request_units": 1, "unit_version": "scan-unit-v1"}, "progress": {}, "categories": { "injection": { "class_name": "safe", "confidence": 0.99, "evidence_spans": [] } }, "completion": { "state": "degraded", "failures": [{"stage": "l2", "kind": "timeout", "retryable": true}] }}Evidence
Section titled “Evidence”The two evidence fields answer different questions:
decision_evidencelocates the analyzed chunk associated with a decision candidate. For injection and other document-level classifiers, usedecisive_chunks[].spanto locate it in the canonical scan text. These offsets are character offsets.evidence_spanscontains detected entities with a label, score, text, and optional byte or character offsets. This is the primary evidence shape for PII and DLP. It can legitimately be empty for an injection result even whendecision_evidenceidentifies a decisive chunk.
Confidence values
Section titled “Confidence values”For a completed job, read the confidence values inside the relevant category:
| Value | JSON path | Meaning |
|---|---|---|
| Final decision confidence | jobs[i].categories.<category>.final_result.confidence | Confidence of the final category classification that contributes to decision. If final_result is absent, use jobs[i].categories.<category>.confidence, which is the category verdict exposed by older or simpler Ark results. |
| Decisive chunk confidence | jobs[i].categories.<category>.decision_evidence.decisive_chunks[j].confidence | Confidence of that chunk-level candidate. Read class_name, source, chunk_id, and optional span from the same item. |
For synchronous compatibility fields, the same category object can also appear at top-level as categories.<category>. Prefer jobs[i].categories.<category> when jobs is present so the confidence stays associated with the correct input segment or file. A decisive chunk can disagree with the final result, so never treat its confidence as the final decision confidence.
{ "jobs": [{ "status": "completed", "decision": "allow", "categories": { "injection": { "final_result": { "class_name": "benign", "confidence": 0.88, "source": "default" }, "decision_evidence": { "stage": "union", "decisive_chunks": [{ "chunk_id": 121, "class_name": "attack", "confidence": 0.1195, "source": "l3", "span": { "start": 115625, "end": 116533 } }] } } } }]}detectors lists every model that reported a result for each category. The category’s model is the final model selected for the verdict; an earlier detector such as native:dlp can therefore appear in detectors.dlp even when a later DLP model determines the final classification. Both synchronous and asynchronous account jobs include this field.
decision_evidence can also describe a rejected risk candidate. A chunk may have class_name: "attack" while the final injection category has class_name: "benign", accepted: false, and final_result.class_name: "benign". With category level: "L3", evidence stage: "union", chunk source: "l3", and attack confidence above 0.1, the response is decision: "allow" and safety_status: "review". At 0.1 or below, at another stage or level, or from another chunk source, it is allow and benign. A final attack yields decision: "block" and safety_status: "attack".
Public responses include only decisive chunks. Per-chunk contributor diagnostics are internal because they do not explain the final verdict and can make document responses very large.
Preserve the original input when using offsets to highlight text; changing whitespace or Unicode normalization can move the corresponding positions. For extracted documents, offsets refer to the canonical text produced by extraction, not necessarily the original binary file layout.
final_result, when present, provides the final category classification. timings.total_ms is the end-to-end scan latency reported by the scan backend; the other timing keys break down processing stages. Timing fields are diagnostic data, not an additional safety decision.
Response schemas
Section titled “Response schemas”Optional fields may be absent. Clients should tolerate additional response fields in future versions and avoid depending on specific model names or timing keys for enforcement.
Accepted
Section titled “Accepted”| Field | Type | Details |
|---|---|---|
ark_version | string | Required. Version of the internal Ark result contract interpreted by the Control Plane. |
status | string | Required. |
input | InputMetadata | Required. |
extraction | ExtractionMetadata | Required. |
coverage | CoverageMetadata | Required. |
segments | UrlSegment[] | Optional. Extracted URL surfaces, with results after completion. |
jobs | AcceptedJob[] | Required. |
usage | ScanUsage | Required. Usage for the submission; supplied on successful POST responses. |
project | ProjectRevision | Optional. |
AcceptedJob
Section titled “AcceptedJob”| Field | Type | Details |
|---|---|---|
job_id | string | Required. |
source | string | Required. |
status_url | string | Required. Relative API path. Poll with the same account and scan:read permission. |
CompletedSubmission
Section titled “CompletedSubmission”| Field | Type | Details |
|---|---|---|
ark_version | string | Required. Version of the internal Ark result contract interpreted by the Control Plane. |
jobs | SubmissionJob[] | Required. |
status | string | Required. |
input | InputMetadata | Required. |
extraction | ExtractionMetadata | Required. |
coverage | CoverageMetadata | Required. |
segments | UrlSegment[] | Optional. |
categories | Map<string, CategoryResult> | Optional. |
decision | allow | review | block | Optional. |
safety_status | SafetyStatus | Optional. |
usage | ScanUsage | Required. |
project | ProjectRevision | Optional. |
SubmissionJob
Section titled “SubmissionJob”| Field | Type | Details |
|---|---|---|
job_id | string | Required. |
source | string | Required. |
status | running | completed | failed | Required. |
progress | Map<string, Progress> | Required. |
categories | Map<string, CategoryResult> | Required. Results keyed by each requested Ark 0.1.18 category. Missing results do not establish clean input. |
detectors | object | Optional. Model identifiers that reported results, keyed by category, including detectors superseded by a later category result. |
completion | Completion | Optional. |
decision | string | Optional. |
safety_status | SafetyStatus | Optional. |
segments | UrlSegment[] | Optional. |
timings | Timings | Optional. |
| Field | Type | Details |
|---|---|---|
ark_version | string | Required. Version of the internal Ark result contract interpreted by the Control Plane. |
job_id | string | Required. |
source | string | Required. |
status | running | completed | failed | Required. |
input | InputMetadata | Required. |
extraction | ExtractionMetadata | Required. |
coverage | CoverageMetadata | Required. |
progress | Map<string, Progress> | Required. |
categories | Map<string, CategoryResult> | Required. Results keyed by each requested Ark 0.1.18 category. Missing results do not establish clean input. |
jobs | SubmissionJob[] | Optional. |
segments | UrlSegment[] | Optional. |
detectors | object | Optional. Model identifiers that reported results, keyed by category, including detectors superseded by a later category result. |
completion | Completion | Optional. |
decision | string | Optional. Scan decision, when present. The client remains responsible for enforcing its policy. |
safety_status | SafetyStatus | Optional. |
timings | Timings | Optional. |
usage | ScanUsage | Required. Usage for the submission; supplied on successful POST responses. |
project | ProjectRevision | Optional. |
InputMetadata
Section titled “InputMetadata”| Field | Type | Details |
|---|---|---|
kind | text | url | mcp_server | documents | Required. |
media_types | string[] | Required. |
ExtractionMetadata
Section titled “ExtractionMetadata”| Field | Type | Details |
|---|---|---|
version | string | Required. |
state | complete | partial | Required. |
documents_total | integer | Required. |
documents_scanned | integer | Required. |
pages_total | integer | Optional. |
pages_scanned | integer | Optional. |
warnings | string[] | Required. |
CoverageMetadata
Section titled “CoverageMetadata”| Field | Type | Details |
|---|---|---|
state | complete | partial | Required. |
input_tokens | integer | Required. |
documents_total | integer | Required. |
documents_scanned | integer | Required. |
pages_total | integer | Optional. |
pages_scanned | integer | Optional. |
ScanUsage
Section titled “ScanUsage”| Field | Type | Details |
|---|---|---|
input_tokens | integer | Required. Input tokens summed across the prepared scan contents. |
scan_units | integer | Required. Billable Scan Units: max(1, ceil(input_tokens / 1000)) for every input type. |
request_units | integer | Required. Compatibility alias for scan_units. |
unit_version | string | Required. |
Completion
Section titled “Completion”| Field | Type | Details |
|---|---|---|
state | complete | degraded | failed | Required. |
failures | Failure[] | Optional. |
Failure
Section titled “Failure”| Field | Type | Details |
|---|---|---|
stage | string | Required. |
kind | string | Required. |
retryable | boolean | Required. |
level | string | Optional. |
detector_id | string | Optional. |
CategoryResult
Section titled “CategoryResult”| Field | Type | Details |
|---|---|---|
category | string | Optional. |
class_name | string | Optional. |
level | string | Optional. |
model | string | Optional. |
confidence | number | Optional. |
duration_ms | number | Optional. |
accepted | boolean | Optional. |
final_result | FinalResult | Optional. |
decision_evidence | DecisionEvidence | Optional. |
evidence_spans | EvidenceSpan[] | Required. |
shell_decision | allow | ask | block | Optional. Cat verdict when category is shell_command. Ask maps the job decision to review. |
shell_details | object | Optional. Bounded Cat model and Cedar policy details. |
module_decision | object | Optional. Optional Ark cascade decision for this category. |
FinalResult
Section titled “FinalResult”| Field | Type | Details |
|---|---|---|
class_name | string | Required. |
confidence | number | Required. Confidence of the final category classification. In a completed job, read this at jobs[i].categories.<category>.final_result.confidence. |
source | string | Required. |
EvidenceSpan
Section titled “EvidenceSpan”| Field | Type | Details |
|---|---|---|
label | string | Required. |
text | string | Required. |
score | number | Required. |
start_byte | integer | Optional. |
end_byte | integer | Optional. |
start_char | integer | Optional. |
end_char | integer | Optional. |
DecisionEvidence
Section titled “DecisionEvidence”| Field | Type | Details |
|---|---|---|
stage | string | Optional. |
decisive_chunks | EvidenceItem[] | Optional. |
EvidenceItem
Section titled “EvidenceItem”| Field | Type | Details |
|---|---|---|
chunk_id | integer | Optional. |
source | string | Optional. |
class_name | string | Optional. |
confidence | number | Optional. Confidence of this decisive chunk candidate, not of the final decision. Read the final confidence from the category's final_result.confidence. |
span | object | Optional. |
Progress
Section titled “Progress”| Field | Type | Details |
|---|---|---|
category | string | Optional. |
model | string | Optional. |
stage | string | Optional. |
completed_chunks | integer | Optional. |
total_chunks | integer | Optional. |
inferred_chunks | integer | Optional. |
propagated_chunks | integer | Optional. |
cache_hits | integer | Optional. |
early_exit | boolean | Optional. |
coverage | number | Optional. |
Timings
Section titled “Timings”| Field | Type | Details |
|---|---|---|
queue_wait_ms | number | null | Optional. |
worker_submit_ms | number | null | Optional. |
worker_ms | number | null | Optional. |
total_ms | number | null | Optional. |
l2_ms | number | null | Optional. |
l2_cache_hit | number | boolean | null | Optional. |