java.lang.Object
com.agentforge4j.runtime.tool.SecureDefaultToolPolicy
- All Implemented Interfaces:
ToolPolicy
Secure-by-default OSS
ToolPolicy: allows in-process tools (the embedder's own registered code) and denies
remote-network and local-process tools, which require an explicit trust decision (ToolPolicy.allowAll() or a
custom policy). The decision is made solely on the framework-trusted
ToolSourceKind; it does not consult provider-declared
ToolRiskMetadata, which is untrusted advisory metadata and plays no part in
this default policy's allow decision.
Dangerous classes are denied, not suspended for approval, so an embedder that has not wired an approval handler is never stranded.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionevaluate(ToolInvocationCommand cmd, ToolDescriptor descriptor, ToolInvocationContext ctx) Evaluates a requested tool invocation.
-
Constructor Details
-
SecureDefaultToolPolicy
public SecureDefaultToolPolicy()
-
-
Method Details
-
evaluate
public PolicyDecision evaluate(ToolInvocationCommand cmd, ToolDescriptor descriptor, ToolInvocationContext ctx) Description copied from interface:ToolPolicyEvaluates a requested tool invocation. Argument-schema validation runs in the execution service before this is consulted, so implementations receive arguments already shape-checked againstToolDescriptor.inputSchema().- Specified by:
evaluatein interfaceToolPolicy- Parameters:
cmd- the requested invocationdescriptor- the resolved tool descriptorctx- invocation context- Returns:
- the policy decision
-