Tawa docs

Scanning and blocking

Choose whether the proxy only watches or also blocks, what happens when a scan cannot finish, and which parts of a request and response are scanned.

Mode

Mode is a setting of the app, in App settings, Scanning and blocking.

  • Monitoring. The proxy forwards every request and response untouched. Scans run in the background and nothing is held back, so Monitoring adds no latency. Requests that would have been blocked are not blocked.
  • Blocking. A request, tool call or response with a blocking decision is stopped and the client receives an error.

The blocking decisions are Block, Hard block and Sandbox. Review and all other decisions are forwarded.

A new app is in Monitoring until you switch it to Blocking.

Start in Monitoring, check what would have been blocked, then switch the app to Blocking.

Fallback

Fallback decides what happens when the proxy cannot get a scan result, or cannot read the content to scan.

SettingBehaviour
Forward the request unscanned (open, default)The request or response goes through.
Return an error (closed)The client receives a 502 with code tawa_scan_unavailable.

Content the proxy cannot read is treated the same way: a compressed request body (Content-Encoding other than identity), or a non-streaming response larger than 16 MiB. In Monitoring these are always forwarded.

Fallback does not apply to token checks. If a token cannot be verified and the proxy has no recent answer for it, the request is refused with a 503.

Stages

Stages belong to each token. They are set when you create the token, or by editing it under API keys, Proxy tokens.

StageScannedNotes
promptThe newest user messageOn by default
tool-outputThe newest run of tool resultsOn by default
tool-callTool calls in the model replyOn by default. A streamed tool call is held until it is complete, then scanned.
responseModel reply textOff by default. Uses more of your allowance and can add delay. Streamed text is scanned in checkpoints of 400 characters.

Each token needs at least one stage. When a request ends with tool results it is scanned as tool-output; otherwise the final user message is scanned as prompt.

Only the newest content of a request is scanned, so the cost of a request stays flat as a conversation grows. Reasoning text from a model is not scanned.

What a blocked request looks like

A blocked request returns 400 in the provider's own error format, with the code tawa_blocked and the header x-tawa-blocked-stage naming the stage that blocked it. A response blocked after a stream has started ends the stream with an error event, because the status is already 200. See Error codes.

On this page