> ## 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.

# Put the real values back into text that carries placeholders

> Plain text work on what you send: nothing is looked up, stored or
logged. Use it with the `pseudonyms` mapping a scan returned for an
App set to pseudonymize and restore. The official SDKs restore
locally and never need this route.

Requires the `runtime:scan` permission. Rate limit: 200 requests per
second per API key.




## OpenAPI

````yaml /api-reference/openapi-runtime-security.yaml post /api/runtime-security/scan/restore
openapi: 3.1.0
info:
  title: Blindsight Runtime Security API
  version: 1.0.0
  summary: 'LLM firewall: prompt-injection, PII, and agent tool-call protection.'
  description: >
    Drop-in firewall for LLM traffic. Three integration modes:

      * **Scan API**, explicit `/scan/input` and `/scan/output` calls.
      * **Reverse proxy**, wire-compatible with the OpenAI, Anthropic, Gemini,
        Vertex and Bedrock APIs; swap the SDK's `base_url` to enable scanning
        at the network boundary.
      * **Tool-call scan**, a check of agent tool arguments before execution.

    **Authentication.** Send a Blindsight API key in the `X-API-Key` header.

    Each key carries permissions, and an endpoint needs one of them:


    | Permission | Value | Endpoints |

    | --- | --- | --- |

    | Scan prompts and responses | `runtime:scan` | `/scan/*` and `/proxy/*` |

    | Read threat events | `runtime:events:read` | `/events`,
    `/events/{uuid}/explain`, `/analytics`, `/drift`, `/health`,
    `/service-status` and the other read endpoints |

    | Read firewall configuration | `runtime:config:read` | `GET /config` |

    | Write firewall configuration | `runtime:config:write` | `PUT /config` |


    `runtime:*` (Full Runtime Access) and full platform access cover all of

    them. A key acts as the person who created it and can never do more than

    that person can.


    All timestamps are UTC, ISO 8601, ending in `Z`, unless an endpoint says

    otherwise.


    See the Runtime Security guides for prose docs, SDK examples, and a

    walk-through of verdicts and configuration.
  contact:
    name: Blindsight Support
    url: https://blindsight.example.com/support
  license:
    name: Proprietary
servers:
  - url: https://platform.blindsight.io
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Scan
    description: Single-call scan endpoints for input, output, batch, and tool calls.
  - name: Proxy
    description: >-
      Wire-compatible reverse-proxy endpoints for OpenAI, Anthropic, Gemini,
      Vertex and Bedrock.
  - name: Configuration
    description: Workspace-scoped firewall settings.
  - name: Analytics
    description: Read-only analytics, event log, and drift endpoints.
  - name: Health
    description: Firewall readiness and service status.
paths:
  /api/runtime-security/scan/restore:
    post:
      tags:
        - Scan
      summary: Put the real values back into text that carries placeholders
      description: |
        Plain text work on what you send: nothing is looked up, stored or
        logged. Use it with the `pseudonyms` mapping a scan returned for an
        App set to pseudonymize and restore. The official SDKs restore
        locally and never need this route.

        Requires the `runtime:scan` permission. Rate limit: 200 requests per
        second per API key.
      operationId: scanRestore
      parameters:
        - $ref: '#/components/parameters/AppId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanRestoreRequest'
            example:
              text: Write to <PERSON_1> at <EMAIL_ADDRESS_1>.
              pseudonyms:
                <PERSON_1>: Jane Doe
                <EMAIL_ADDRESS_1>: jane.doe@example.com
      responses:
        '200':
          description: The text with the values back in
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanRestoreResponse'
              example:
                text: Write to Jane Doe at jane.doe@example.com.
                restored: 2
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '413':
          description: >-
            The restored text would be too long, or needs too many replacements
            (`RESTORE_TOO_LARGE`). Nothing is restored.
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    AppId:
      name: X-Blindsight-App-Id
      in: header
      required: false
      schema:
        type: string
      description: |
        UUID of the App the traffic belongs to. Optional: a key limited to one
        App, or a workspace with exactly one App, uses that App. A key limited
        to several Apps must send it.
  schemas:
    ScanRestoreRequest:
      type: object
      required:
        - text
        - pseudonyms
      properties:
        text:
          type: string
          maxLength: 2000000
          description: Text that carries placeholders.
        pseudonyms:
          type: object
          additionalProperties:
            type: string
          description: The mapping a scan response returned. At most 5000 entries.
    ScanRestoreResponse:
      type: object
      required:
        - text
        - restored
      properties:
        text:
          type: string
        restored:
          type: integer
          minimum: 0
          description: >-
            How many of the placeholders sent were found in the text and put
            back.
  responses:
    Unauthorized:
      description: The API key is missing, invalid, expired or disabled
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
    Forbidden:
      description: >-
        The key does not have the permission this endpoint needs, or its owner
        no longer holds it
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
    ValidationError:
      description: Request body failed schema validation
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: array
                items:
                  type: object
                  properties:
                    loc:
                      type: array
                      items:
                        type: string
                    msg:
                      type: string
                    type:
                      type: string
    RateLimited:
      description: Rate limit reached for this API key
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: |
        Blindsight API key (`ak_...`). The permissions it needs are listed in
        the API description and on each operation: `runtime:scan` for scan and
        proxy routes, `runtime:events:read` for events, analytics, drift,
        health and service status, `runtime:config:read` to read the
        configuration and `runtime:config:write` to change it.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.