Enum Class InterruptReason

java.lang.Object
java.lang.Enum<InterruptReason>
com.tnsai.security.approval.InterruptReason
All Implemented Interfaces:
Serializable, Comparable<InterruptReason>, Constable

public enum InterruptReason extends Enum<InterruptReason>
Reasons for requesting an interrupt in AG-UI protocol.

These reasons are sent to the frontend to help it display the appropriate UI for the interrupt.

  • Enum Constant Details

    • HUMAN_APPROVAL

      public static final InterruptReason HUMAN_APPROVAL
      Requires human approval before executing a sensitive action.

      Examples:

      • Deleting data
      • Financial transactions
      • Sending emails
      • Modifying configurations
    • UPLOAD_REQUIRED

      public static final InterruptReason UPLOAD_REQUIRED
      Additional information or file upload required from user.

      Examples:

      • Missing required parameters
      • Need clarification on request
      • File upload needed
    • POLICY_VIOLATION

      public static final InterruptReason POLICY_VIOLATION
      Action would violate a policy and needs human override.

      Examples:

      • Rate limit exceeded
      • Budget constraint hit
      • Access control violation
    • ERROR_RECOVERY

      public static final InterruptReason ERROR_RECOVERY
      An error occurred that needs human guidance to resolve.

      Examples:

      • API error requiring retry decision
      • Ambiguous result needing clarification
      • Partial failure needing decision
    • CONFIRMATION

      public static final InterruptReason CONFIRMATION
      Confirmation step in a multi-step process.

      Examples:

      • Wizard confirmation page
      • Order review before submission
      • Summary confirmation
    • CUSTOM

      public static final InterruptReason CUSTOM
      Custom reason not covered by standard reasons.
  • Method Details

    • values

      public static InterruptReason[] 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 InterruptReason 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
    • getValue

      public String getValue()
      Gets the AG-UI protocol value.
      Returns:
      protocol value string
    • fromValue

      public static InterruptReason fromValue(String value)
      Parses a reason from its string value.
      Parameters:
      value - the string value
      Returns:
      the reason, or CUSTOM if not found