Class BetaManagedAgentsGlobToolConfig.PermissionPolicy
-
- All Implemented Interfaces:
public final class BetaManagedAgentsGlobToolConfig.PermissionPolicyPermission policy for tool execution.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsGlobToolConfig.PermissionPolicy.VisitorAn interface that defines how to map each variant of PermissionPolicy to a value of type T.
public final classBetaManagedAgentsGlobToolConfig.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 BetaManagedAgentsGlobToolConfig.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(BetaManagedAgentsGlobToolConfig.PermissionPolicy.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsGlobToolConfig.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 BetaManagedAgentsGlobToolConfig.PermissionPolicyofAlwaysAllow(BetaManagedAgentsAlwaysAllowPolicy alwaysAllow)Tool calls are automatically approved without user confirmation. final static BetaManagedAgentsGlobToolConfig.PermissionPolicyofAlwaysAsk(BetaManagedAgentsAlwaysAskPolicy alwaysAsk)Tool calls require user confirmation before execution. final static BetaManagedAgentsGlobToolConfig.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(BetaManagedAgentsGlobToolConfig.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 BetaManagedAgentsGlobToolConfig.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 BetaManagedAgentsGlobToolConfig.PermissionPolicy ofAlwaysAllow(BetaManagedAgentsAlwaysAllowPolicy alwaysAllow)
Tool calls are automatically approved without user confirmation.
-
ofAlwaysAsk
final static BetaManagedAgentsGlobToolConfig.PermissionPolicy ofAlwaysAsk(BetaManagedAgentsAlwaysAskPolicy alwaysAsk)
Tool calls require user confirmation before execution.
-
ofAuto
final static BetaManagedAgentsGlobToolConfig.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.
-
-
-
-