Enum Class ToolRiskLevel

java.lang.Object
java.lang.Enum<ToolRiskLevel>
com.tnsai.tools.ToolRiskLevel
All Implemented Interfaces:
Serializable, Comparable<ToolRiskLevel>, Constable

public enum ToolRiskLevel extends Enum<ToolRiskLevel>
Risk classification for a
invalid reference
Tool
's execution. Distinct from
invalid reference
Tool#requiresConfirmation()
which is a boolean gate — the level lets policy engines (default-deny registries, audit pipelines) reason about gradient instead of all-or-nothing.

Risk is about blast radius, not failure probability. A tool that always works but writes to a payment processor is CRITICAL; a tool that occasionally times out reading public Wikipedia is LOW.

Since:
0.5.0 (issue #18)
  • Enum Constant Details

    • LOW

      public static final ToolRiskLevel LOW
      Read-only, idempotent, no external side effects beyond a cached HTTP GET. Safe to run unattended in autonomous chains. Examples: search, Wikipedia lookup, calculator.
    • MEDIUM

      public static final ToolRiskLevel MEDIUM
      Default. Network egress or local read with predictable cost; failures are recoverable. Examples: API calls with rate limits, file reads inside an allowed workspace.
    • HIGH

      public static final ToolRiskLevel HIGH
      Mutates external state but reversibly. Should surface in audit logs and may require confirmation in interactive flows. Examples: file writes, git commits, sending a draft message.
    • CRITICAL

      public static final ToolRiskLevel CRITICAL
      Irreversible or financially material. Default-deny in production policies; explicit approval per-call. Examples: shell with sudo, payment execution, deleting a remote resource, posting to a public channel.
  • Method Details

    • values

      public static ToolRiskLevel[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ToolRiskLevel valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null