Define custom logic using Python-like syntax
+Click to copy functions to clipboard
+ +
+ {JSON.stringify(testResult.modified_texts, null, 2)}
+
+ | Function | +Description | +
|---|---|
+
+ {primitive.signature}
+
+ |
+ {primitive.description} | +
| Function | +Description | +
|---|---|
allow() |
+ Let request/response through | +
block(reason) |
+ Reject with message | +
modify(texts=[], images=[], tool_calls=[]) |
+ Transform content | +
| Field | +Type | +Description | +
|---|---|---|
texts |
+ List[str] | +Extracted text from the request/response | +
images |
+ List[str] | +Extracted images (for image guardrails) | +
tools |
+ List[dict] | +Tools sent to the LLM | +
tool_calls |
+ List[dict] | +Tool calls returned from the LLM | +
structured_messages |
+ List[dict] | +Full messages with role info | +
model |
+ str | +The model being used | +
| Field | +Type | +Description | +
|---|---|---|
model |
+ str | +Model name | +
user_id |
+ str | +User ID from API key | +
team_id |
+ str | +Team ID from API key | +
end_user_id |
+ str | +End user ID | +
metadata |
+ dict | +Request metadata | +