Record Class Action

java.lang.Object
java.lang.Record
com.tnsai.accountability.Action
Record Components:
type - dispatch channel
name - tool / capability name; stable across versions
target - optional external target identifier
parameters - audit-safe parameter snapshot; never includes raw prompts or unredacted PII
description - one-line operator summary

public record Action(ActionType type, String name, Optional<String> target, Map<String,Object> parameters, String description) extends Record
Audit-grade descriptor of a single agent action (TNS-298). Captures what the agent attempted at a level of detail sufficient for external audit, without leaking prompt content or sensitive payloads.

What goes in a record

Operators decide. The framework attaches:
  • type — dispatch channel (LLM / TOOL / WEB / LOCAL)
  • name — stable identifier of the specific tool / action
  • target — system the action touches ("github.com/owner/repo", "arn:aws:s3:::bucket"); empty when intra-process
  • parameters — non-sensitive arg snapshot; redacted fields use opaque placeholders ("$redacted$"); the redaction layer in tnsai-quality is the source of truth for what can leave the trust boundary
  • description — short human-readable summary to help auditors triage records without parsing parameters
Since:
0.10.0 (TNS-298)
  • Constructor Details

    • Action

      public Action(ActionType type, String name, Optional<String> target, Map<String,Object> parameters, String description)
      Creates an instance of a Action record class.
      Parameters:
      type - the value for the type record component
      name - the value for the name record component
      target - the value for the target record component
      parameters - the value for the parameters record component
      description - the value for the description record component
  • Method Details

    • of

      public static Action of(ActionType type, String name, String description)
      Convenience: action with no target and no parameters.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public ActionType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • target

      public Optional<String> target()
      Returns the value of the target record component.
      Returns:
      the value of the target record component
    • parameters

      public Map<String,Object> parameters()
      Returns the value of the parameters record component.
      Returns:
      the value of the parameters record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component