Class ToolApprovalValidator
- All Implemented Interfaces:
Validator
@Tool(requiresConfirmation = true) but the agent has no
ToolCallFilter configured to gate
the call.
Without a filter, the runtime executes confirmation-gated tools
unattended, defeating the safety contract the @Tool
annotation advertises. Issue #234 spun this validator off from
issue #85's original spec because the underlying primitives didn't
exist yet — both ship together in 0.8.5.
Severity
Emitted as Severity.WARNING,
matching the soft-launch convention shared by V002, V003, V005,
V010 — the missing filter may be intentional (e.g. trusted
environment, post-build wiring through a different code path), and
a warning gives consumers a release cycle to either install a
filter or suppress with .relaxValidation("AGENT-V006").
Conservative skip rules
- No tool declares
requiresConfirmation = true→ silent (signal precomputed by the builder via reflection; reflection failures are treated as "no signal", not "definitely safe"). - A
ToolCallFilteris wired throughAgentBuilder.toolCallFilter(...)→ silent. The validator does not inspect the filter's policy — declaring any filter at all is treated as opt-in to the runtime approval contract.
Why this is build-time rather than runtime-discovered
The framework already raises a runtime exception when a confirmation-gated tool fires without a filter, but only on the first dispatch — typically minutes or hours into production. Surfacing the gap at build time follows the same "fail at the configuration site, not at the call site" principle as the other validators.
- Since:
- 0.8.5 (issue #234)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionid()Short, stable id for logging and test assertions (e.g.Inspect the agent configuration and return any issues detected.
-
Constructor Details
-
ToolApprovalValidator
public ToolApprovalValidator()
-
-
Method Details
-
id
Description copied from interface:ValidatorShort, stable id for logging and test assertions (e.g."llm-presence"). -
validate
Description copied from interface:ValidatorInspect the agent configuration and return any issues detected. Returning an empty list means "no problems found by this validator".
-