> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blindsight.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Scan File

> Device-authenticated counterpart to /agent/scan for uploaded files.

The transparent agent calls this when it intercepts a file upload to an AI
web app (e.g. Claude.ai's sandbox upload). Extracts text, scans it, and
returns redacted file bytes to re-inject into the upload.



## OpenAPI

````yaml /api-reference/openapi.json post /api/runtime-security/agent/scan-file
openapi: 3.1.0
info:
  title: Blindsight API
  version: 0.1.0
  description: >-
    The full Blindsight REST surface, generated from the running application.
    Replace the server host with your own deployment.


    For the Runtime Security integration surface (scan, proxy, tool calls) see
    the Runtime Security spec, which is hand written and carries worked
    examples.
servers:
  - url: https://api.your-blindsight.com
    description: Your Blindsight deployment
security: []
paths:
  /api/runtime-security/agent/scan-file:
    post:
      tags:
        - runtime-security-agent
      summary: Agent Scan File
      description: >-
        Device-authenticated counterpart to /agent/scan for uploaded files.


        The transparent agent calls this when it intercepts a file upload to an
        AI

        web app (e.g. Claude.ai's sandbox upload). Extracts text, scans it, and

        returns redacted file bytes to re-inject into the upload.
      operationId: agent_scan_file_api_runtime_security_agent_scan_file_post
      parameters:
        - name: X-Blindsight-Device-Token
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Blindsight-Device-Token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentScanFileRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentScanFileResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AgentScanFileRequest:
      properties:
        data:
          type: string
          title: Data
          description: Base64-encoded uploaded file bytes.
        filename:
          anyOf:
            - type: string
              maxLength: 512
            - type: 'null'
          title: Filename
        media_type:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Media Type
        direction:
          type: string
          pattern: ^(input|output)$
          title: Direction
          default: input
        host:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Host
        provider:
          anyOf:
            - type: string
              maxLength: 32
            - type: 'null'
          title: Provider
        model:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Model
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - data
      title: AgentScanFileRequest
    AgentScanFileResponse:
      properties:
        uuid:
          type: string
          title: Uuid
        verdict:
          type: string
          title: Verdict
        redacted:
          type: boolean
          title: Redacted
        redacted_count:
          type: integer
          title: Redacted Count
        data:
          type: string
          title: Data
        media_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Media Type
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        blocked_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Blocked Reason
        fail_mode:
          type: string
          title: Fail Mode
      type: object
      required:
        - uuid
        - verdict
        - redacted
        - redacted_count
        - data
        - fail_mode
      title: AgentScanFileResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````