Skip to content

SSE And WebSocket Rewrite Workflow

Seam can rewrite complete decoded SSE data events and complete WebSocket messages. It does not mutate handshakes, upgrades, or partial chunks.

SSE

Use an SSE scenario to confirm that complete data: events survive rewriting:

seam robustness run \
  --scenario scenarios/a2a_stream_rewrite.yaml \
  --out bundles \
  --schema schemas/transcript.schema.json

Expected rule example:

a2a_stream_task_state_spoof

WebSocket

Use the MCP WebSocket scenario for response-side tool-result rewriting:

seam robustness run \
  --scenario scenarios/mcp_websocket_rewrite.yaml \
  --out bundles \
  --schema schemas/transcript.schema.json

Limits

If a stream message is oversized, Seam fails according to the configured capture limits. For offensive work, prefer a narrow rule that targets a complete decoded JSON message and keep fixture payloads small enough to inspect.

Troubleshooting

  • If the transcript shows only handshake metadata, the application message never reached Seam as a complete decoded frame.
  • If rules trace says the protocol is not eligible, inspect the decoded kind and transport.
  • If the client stalls, check upstream availability and stream limits before editing the rule.