// context guardrails

Files

Score a public text or PDF file before an agent reads it as untrusted context.

Score a public HTTP or HTTPS file before an agent opens it, embeds it, or treats it as instructions. Superagent checks the source, extracts a bounded text representation, and reviews that text for injection and exfiltration.

How scoring works

A file scan runs in three tiers:

  1. Identity — source domain age, TLS, hosting, and blocklists.
  2. Secure extraction — DNS pinned download with redirect validation, type consistency checks, and bounded extraction for text formats and PDFs.
  3. Content review — deterministic prompt injection, exfiltration, social engineering, and encoded payload checks followed by chunked LLM review.

File bytes are never stored. The identifier is the lowercase SHA-256 hex digest of the normalized URL.

Supported files

Supported files include UTF-8 text, HTML, JSON, XML, CSV, CSS, JavaScript, Markdown, YAML, SQL, and PDFs with extractable text. Downloads are limited to 25 MB.

Images, Office documents, archives, encrypted PDFs, and PDFs that require OCR are reported as unscannable instead of safe. Invalid URLs and unsupported types return a dangerous result or 400 invalid_request, depending on whether validation fails before the scan starts.

Threats

When details=true or the verdict is suspicious / dangerous, file scans may emit file_unscannable, mime_mismatch, encoded_payload, redirect_chain, extraction errors, and prompt-injection or exfiltration types shared with other origins.

Use it

  • Dashboard: open Agents → Context, paste a public file URL, and open the result for identity, behavior, and content scores.
  • REST API: POST /api/v1/context/file to score a URL and GET /api/v1/context/file/{identifier} to look up a previous result by SHA-256. See the Context Guardrails API.
  • MCP: scan_file.
curl "https://superagent.sh/api/v1/context/file?mode=full&details=true" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  --data '{"url":"https://example.com/security-guidance.pdf"}'
curl "https://superagent.sh/api/v1/context/file/<sha256>?details=true" \
  -H "Authorization: Bearer sk_live_..."

GET never starts a new scan.

Next steps