prisma-airs-tool-guard¶
Active AIRS scanning of tool call inputs via the toolEvent content type.
Overview¶
| Field | Value |
|---|---|
| Event | before_tool_call |
| Config field | tool_guard_mode |
| Can Block | Yes ({ block: true, blockReason }) |
| Default mode | deterministic |
| Valid modes | deterministic, probabilistic, off |
Purpose¶
Scans tool inputs through AIRS in real time before execution. Unlike prisma-airs-tools (which uses cached inbound scan results), this hook sends the actual tool call parameters to AIRS using the toolEvent content type for targeted analysis.
How It Works¶
- Reads
tool_guard_modefrom config (default:deterministic). Returns void ifoff. - Validates
event.toolNameexists. - Serializes
event.paramsto JSON string (if present). - Calls
scan()with atoolEventsarray containing a single tool event: - If AIRS returns
action: "allow", returns void (tool proceeds). - Otherwise, returns
{ block: true, blockReason: "Tool '<name>' blocked by security scan: <categories>. Scan ID: <id>" }.
Error Handling¶
On scan failure:
- If
fail_closed=true(default): Returns{ block: true, blockReason: "Tool '<name>' blocked: security scan failed. Try again later." }. - If
fail_closed=false: Returns void (tool proceeds).
Configuration¶
plugins:
entries:
prisma-airs:
config:
tool_guard_mode: "deterministic" # "deterministic" | "probabilistic" | "off"
profile_name: "default"
app_name: "openclaw"
fail_closed: true
Behavior¶
| Condition | Result |
|---|---|
tool_guard_mode = off |
No-op |
No toolName in event |
No-op |
AIRS action = allow |
Allow tool execution |
AIRS action = block or warn |
{ block: true, blockReason } |
Scan fails + fail_closed=true |
{ block: true, blockReason } |
Scan fails + fail_closed=false |
Allow tool execution |
Related Hooks¶
- prisma-airs-tools -- Complementary cache-based tool gating (no API call). Both hooks fire on
before_tool_call. - prisma-airs-tool-audit -- Scans tool outputs after execution (post-hoc audit).