outbound rules apply before a request leaves the sandbox, and inbound rules apply before a response reaches your agent code. Use them to strip credentials from outbound headers, mask tokens in logs, or remove known injection patterns from responses.
Basic configuration
TransformationRule model
TransformDirection enum
Multiple rules
Rules are applied in the order they are listed.Common patterns
Mask database connection strings
Mask database connection strings
Remove prompt injection patterns from responses
Remove prompt injection patterns from responses
Strip system prompt extraction attempts
Strip system prompt extraction attempts
Remove invisible Unicode injection characters
Remove invisible Unicode injection characters
Attackers sometimes embed invisible Unicode characters in text to manipulate LLM context windows.
Combining with PII redaction
Transformation rules complement PII redaction. Use PII redaction for structured sensitive data (SSNs, credit cards) that benefits from response rehydration, and transformation rules for patterns that should be permanently removed.When TLS interception activates
Transformation rules require reading the request or response body, which means the security proxy must decrypt HTTPS traffic. TLS interception (Stage 3 of the pipeline) activates automatically when any transformation rules are configured. A per-sandbox CA certificate is generated at creation time and injected into the VM trust store. The proxy terminates TLS from the sandbox, applies transformations, and re-encrypts to the real destination. The agent code sees the destination’s certificate as usual.Regex patterns use Go’s
regexp package syntax, which is RE2-compatible. Backtracking patterns like (.+)+ are not supported. Test your patterns at regex101.com with the Go flavor selected.Order of operations
When both PII redaction and transformation rules are active:- Outbound (sandbox → destination): invisible-text stripping, then PII redaction, then transformation rules last.
- Inbound (destination → sandbox): untrusted-content capture (for the optional LLM judge’s session store — this observes, it does not block), then PII rehydration, then transformation rules last.
Streaming (SSE) responses
Inbound transformation rules are not applied totext/event-stream responses. Only PII rehydration is supported on SSE, because applying transformations would require buffering an unbounded stream.
The same exception applies to untrusted-content capture: a streamed response is not recorded in the LLM judge’s session store, so indirect injection delivered over SSE will not arm the indirect trigger. Direct-egress injection defense still applies to the agent’s subsequent outbound requests.
This matters because most LLM chat APIs stream by default. If you configure direction="inbound" rules to process model output, they will silently not run on a streamed response — there is no error and no log entry indicating the rule was skipped.