Class BetaManagedAgentsWebSearchToolConfigParams.PermissionPolicy
-
- All Implemented Interfaces:
public final class BetaManagedAgentsWebSearchToolConfigParams.PermissionPolicyPermission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsWebSearchToolConfigParams.PermissionPolicy.VisitorAn interface that defines how to map each variant of PermissionPolicy to a value of type T.
public final classBetaManagedAgentsWebSearchToolConfigParams.PermissionPolicy.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsAlwaysAllowPolicy>alwaysAllow()Tool calls are automatically approved without user confirmation. final Optional<BetaManagedAgentsAlwaysAskPolicy>alwaysAsk()Tool calls require user confirmation before execution. final Optional<BetaManagedAgentsAutoPolicy>auto()The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. final Optional<JsonValue>_json()final BetaManagedAgentsWebSearchToolConfigParams.PermissionPolicy.Typetype()final BooleanisAlwaysAllow()final BooleanisAlwaysAsk()final BooleanisAuto()final BetaManagedAgentsAlwaysAllowPolicyasAlwaysAllow()Tool calls are automatically approved without user confirmation. final BetaManagedAgentsAlwaysAskPolicyasAlwaysAsk()Tool calls require user confirmation before execution. final BetaManagedAgentsAutoPolicyasAuto()The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. final <T extends Any> Taccept(BetaManagedAgentsWebSearchToolConfigParams.PermissionPolicy.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsWebSearchToolConfigParams.PermissionPolicyvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsWebSearchToolConfigParams.PermissionPolicyofAlwaysAllow(BetaManagedAgentsAlwaysAllowPolicy alwaysAllow)Tool calls are automatically approved without user confirmation. final static BetaManagedAgentsWebSearchToolConfigParams.PermissionPolicyofAlwaysAsk(BetaManagedAgentsAlwaysAskPolicy alwaysAsk)Tool calls require user confirmation before execution. final static BetaManagedAgentsWebSearchToolConfigParams.PermissionPolicyofAuto(BetaManagedAgentsAutoPolicy auto)The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. -
-
Method Detail
-
alwaysAllow
final Optional<BetaManagedAgentsAlwaysAllowPolicy> alwaysAllow()
Tool calls are automatically approved without user confirmation.
-
alwaysAsk
final Optional<BetaManagedAgentsAlwaysAskPolicy> alwaysAsk()
Tool calls require user confirmation before execution.
-
auto
final Optional<BetaManagedAgentsAutoPolicy> auto()
The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask, or for some causes to deny, for example when the organization is out of credits or has reached a spend limit.
-
isAlwaysAllow
final Boolean isAlwaysAllow()
-
isAlwaysAsk
final Boolean isAlwaysAsk()
-
asAlwaysAllow
final BetaManagedAgentsAlwaysAllowPolicy asAlwaysAllow()
Tool calls are automatically approved without user confirmation.
-
asAlwaysAsk
final BetaManagedAgentsAlwaysAskPolicy asAlwaysAsk()
Tool calls require user confirmation before execution.
-
asAuto
final BetaManagedAgentsAutoPolicy asAuto()
The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask, or for some causes to deny, for example when the organization is out of credits or has reached a spend limit.
-
accept
final <T extends Any> T accept(BetaManagedAgentsWebSearchToolConfigParams.PermissionPolicy.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.anthropic.core.JsonValue; import java.util.Optional; Optional<String> result = permissionPolicy.accept(new PermissionPolicy.Visitor<Optional<String>>() { @Override public Optional<String> visitAlwaysAllow(BetaManagedAgentsAlwaysAllowPolicy alwaysAllow) { return Optional.of(alwaysAllow.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsWebSearchToolConfigParams.PermissionPolicy validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofAlwaysAllow
final static BetaManagedAgentsWebSearchToolConfigParams.PermissionPolicy ofAlwaysAllow(BetaManagedAgentsAlwaysAllowPolicy alwaysAllow)
Tool calls are automatically approved without user confirmation.
-
ofAlwaysAsk
final static BetaManagedAgentsWebSearchToolConfigParams.PermissionPolicy ofAlwaysAsk(BetaManagedAgentsAlwaysAskPolicy alwaysAsk)
Tool calls require user confirmation before execution.
-
ofAuto
final static BetaManagedAgentsWebSearchToolConfigParams.PermissionPolicy ofAuto(BetaManagedAgentsAutoPolicy auto)
The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask, or for some causes to deny, for example when the organization is out of credits or has reached a spend limit.
-
-
-
-