Class BetaManagedAgentsReadToolConfigParams.PermissionPolicy
-
- All Implemented Interfaces:
public final class BetaManagedAgentsReadToolConfigParams.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 interfaceBetaManagedAgentsReadToolConfigParams.PermissionPolicy.VisitorAn interface that defines how to map each variant of PermissionPolicy to a value of type T.
public final classBetaManagedAgentsReadToolConfigParams.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 BetaManagedAgentsReadToolConfigParams.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(BetaManagedAgentsReadToolConfigParams.PermissionPolicy.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsReadToolConfigParams.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 BetaManagedAgentsReadToolConfigParams.PermissionPolicyofAlwaysAllow(BetaManagedAgentsAlwaysAllowPolicy alwaysAllow)Tool calls are automatically approved without user confirmation. final static BetaManagedAgentsReadToolConfigParams.PermissionPolicyofAlwaysAsk(BetaManagedAgentsAlwaysAskPolicy alwaysAsk)Tool calls require user confirmation before execution. final static BetaManagedAgentsReadToolConfigParams.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(BetaManagedAgentsReadToolConfigParams.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 BetaManagedAgentsReadToolConfigParams.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 BetaManagedAgentsReadToolConfigParams.PermissionPolicy ofAlwaysAllow(BetaManagedAgentsAlwaysAllowPolicy alwaysAllow)
Tool calls are automatically approved without user confirmation.
-
ofAlwaysAsk
final static BetaManagedAgentsReadToolConfigParams.PermissionPolicy ofAlwaysAsk(BetaManagedAgentsAlwaysAskPolicy alwaysAsk)
Tool calls require user confirmation before execution.
-
ofAuto
final static BetaManagedAgentsReadToolConfigParams.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.
-
-
-
-