Record Class AgentDescriptor

java.lang.Object
java.lang.Record
com.tnsai.identity.AgentDescriptor
Record Components:
agentClass - fully-qualified class name of the agent role (the @Capability-annotated entry point); part of the fingerprint input
systemPrompt - the agent's system prompt body — when this changes, behaviour changes; auditors care
toolNames - stable list of tool names the agent has access to; ordering doesn't matter, but the set membership does
model - provider-qualified model id ("openai:gpt-5")
buildHash - hash of the deployed JAR / build artefact; lets fingerprint differentiate "same config, different binary" cases
metadata - free-form annotations the operator wants to carry forward; not part of the version / fingerprint inputs

public record AgentDescriptor(String agentClass, String systemPrompt, List<String> toolNames, String model, Optional<String> buildHash, Map<String,String> metadata) extends Record
Declarative description of an agent that an AgentPrincipalProvider uses to mint an AgentPrincipal (TNS-298). Captures the inputs an attestation system needs to bind an identity to a specific behavioural configuration.

The provider hashes these fields into the resulting identity's AgentPrincipal.runtimeFingerprint() and AgentPrincipal.version() so behavioural changes (systemPrompt edited, a tool added, the model swapped) automatically produce a new identity version.

Since:
0.10.0 (TNS-298)
  • Constructor Details

    • AgentDescriptor

      public AgentDescriptor(String agentClass, String systemPrompt, List<String> toolNames, String model, Optional<String> buildHash, Map<String,String> metadata)
      Creates an instance of a AgentDescriptor record class.
      Parameters:
      agentClass - the value for the agentClass record component
      systemPrompt - the value for the systemPrompt record component
      toolNames - the value for the toolNames record component
      model - the value for the model record component
      buildHash - the value for the buildHash record component
      metadata - the value for the metadata record component
  • Method Details

    • builder

      public static AgentDescriptor.Builder builder()
    • 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.
    • agentClass

      public String agentClass()
      Returns the value of the agentClass record component.
      Returns:
      the value of the agentClass record component
    • systemPrompt

      public String systemPrompt()
      Returns the value of the systemPrompt record component.
      Returns:
      the value of the systemPrompt record component
    • toolNames

      public List<String> toolNames()
      Returns the value of the toolNames record component.
      Returns:
      the value of the toolNames record component
    • model

      public String model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • buildHash

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

      public Map<String,String> metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component