Tool Governance Rules
Agent failures concentrate around tools: denied calls slipping through, the same call repeated, error loops, and untrusted content returned by external systems. Four input-side rules plus one output-side schema rule govern tool behavior on the model-call path.
Rule overview#
| Plugin id | Rule | Direction | Purpose |
|---|---|---|---|
provon.guard.tool-call-denylist |
Tool call denylist | Input and output | Block configured tool names and argument conditions |
provon.guard.same-tool-call |
Duplicate tool calls | Input only | Detect the same tool call repeated in a bounded message window |
provon.guard.repeated-tool-result |
Duplicate tool output | Input only | Detect repeated consumption of the same tool result |
provon.guard.tool-error-loop |
Repeated tool errors | Input only | Detect repeated failures on the same tool path |
provon.guard.tool-arguments |
Tool argument schema | Output only | Validate generated tool-call arguments against request tool definitions |
All five support audit and block; none rewrite payloads.
Tool call denylist#
A denylist rule matches a wildcard tool name and optional argument-path conditions. A match is denied under Block, recorded under Audit, and an unmatched call gains no additional restriction. No business deny conditions ship enabled by default.
Each condition matches:
- a tool-name pattern;
- an optional argument field path;
- an operator;
- an optional comparison value;
- an optional reason and category.
Operators#
| Operator | Matches when the field… |
|---|---|
exists |
is present and not null |
not_exists |
is absent or null |
eq / neq |
equals (or does not equal) the value |
any_of |
equals any member of the value list |
none_of |
equals no member of the value list |
gt/gte/lt/lte |
compares numerically |
contains / not_contains |
contains the literal text |
starts_with / ends_with |
matches a literal boundary |
Example intent:
tool pattern: shell_*
field: command
operator: contains
value: rm -rf
action: BlockString conditions are literal matches, not filesystem path, SQL, or URL semantic authorization; resource-specific enforcement remains with the executing tool. Invalid operators, missing comparison values, and duplicate rule identifiers are rejected at settings write time rather than silently ignored. A rule without a field matches the entire tool; with a field it evaluates that argument path.
Loop and duplicate detection#
The three loop rules are input-only counters over the message window:
- Same tool call — the identical tool call (name plus arguments) repeats within the bounded window.
- Repeated tool result — the agent consumes the same tool result more than once, a common sign of a stalled plan.
- Tool error loop — the same tool path fails repeatedly, producing a stable error signature instead of progress.
Use them to catch runaway agents before token spend compounds. They audit the shape of the conversation, not the semantics of individual arguments, so keep thresholds permissive enough that legitimate retries (for example one re-attempt after a transient failure) do not trigger.
Tool argument validation#
provon.guard.tool-arguments is output-only and validates generated tool-call arguments against
the request's tool definitions (function.parameters, parameters, or input_schema). An
undeclared tool name is flagged when the request carries schema-bearing tool definitions.
- No schema-bearing definitions means
not_evaluated, not an imposed format. - JSON values are never coerced and unknown properties are never silently removed.
- Schemas are bounded to 32 KiB, 512 nodes, and depth 32; values to 10,000 nodes and depth 32.
Local acyclic
$refdefinitions are supported; remote or recursive references, runtime regular expressions, and unsupported drafts are rejected, never fetched or weakened. - Invalid or unsupported schemas produce a
schema_unavailabledecision — Block under enforcement, Audit otherwise. - MCP invocation validation remains with the MCP server; this rule checks the model-generated call, not the server's acceptance of it.
Where the checks run#
| Path | When denylist conditions apply |
|---|---|
| Node and Cloudflare MCP gateways | Before hosted, MCP-federated, and OpenAPI tool execution |
| LLM Gateway | Before newly generated calls are delivered; complete calls are buffered when enforcement requires it |
Checking request history is not a substitute for execution-time checks. Denylist rules never grant access: MCP access permissions are evaluated independently and cannot be widened by a guardrail. The MCP tool gateway additionally runs its own deterministic transport scans (argument size, smuggled credential keys, output bounds) described in MCP security.
Untrusted results#
Tool results return external content into the model context. The injection rule scans them before they reach the caller; see Prompt safety for the inspection scope and withholding behavior.