HexaEightAgent 1.6.838

dotnet add package HexaEightAgent --version 1.6.838
                    
NuGet\Install-Package HexaEightAgent -Version 1.6.838
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HexaEightAgent" Version="1.6.838" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HexaEightAgent" Version="1.6.838" />
                    
Directory.Packages.props
<PackageReference Include="HexaEightAgent" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HexaEightAgent --version 1.6.838
                    
#r "nuget: HexaEightAgent, 1.6.838"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=HexaEightAgent&version=1.6.838
                    
Install HexaEightAgent as a Cake Addin
#tool nuget:?package=HexaEightAgent&version=1.6.838
                    
Install HexaEightAgent as a Cake Tool

HexaEight Agent Library

Overview

The HexaEight Agent Library enables secure, end-to-end encrypted communication between AI agents.

Installation

dotnet add package HexaEight.Agent

Core Classes and Methods

1. AgentConfig Class

Initialization
  • SetClientCredentials(string clientId, string tokenServerUrl): Sets up client credentials
  • SetResourceName(string resourceName): Sets the resource name
  • SetLoginToken(string loginToken): Sets the login token
  • SetRsOwner(string rsOwner): Sets the resource owner
Agent Management
  • CreateAIParentAgent(string filename, bool loadEnv = false, string clientId = "", string tokenServerUrl = "", bool logging = false): Creates a new parent agent
  • LoadAIParentAgent(string filename, bool loadEnv = false, string clientId = "", string tokenServerUrl = "", bool logging = false): Loads an existing parent agent
  • CreateAIChildAgent(string agentPassword, string filename, bool loadEnv = false, string clientId = "", string tokenServerUrl = "", bool logging = false): Creates a new child agent
  • LoadAIChildAgent(string agentPassword, string filename, bool loadEnv = false, string clientId = "", string tokenServerUrl = "", bool logging = false): Loads an existing child agent
  • ActivateParentAgent(): Activates the parent agent
  • GetAgentname(): Gets the current agent's name
  • GetInternalIdentity(): Gets the agent's internal identity
Environment Management
  • LoadHexaEightVariablesFromEnvFile(string envFilePath, EnvironmentVariableTarget target = EnvironmentVariableTarget.Process): Loads environment variables from a file
  • GetAllEnvironmentVariables(): Gets all HexaEight environment variables
Configuration
  • SaveConfiguration(string loginToken, string encryptedResourceId, string filename): Saves agent configuration
  • CleanConfiguration(string filename): Removes agent configuration
  • ReadConfiguration(string filename): Reads agent configuration

2. Session Object (JWT)

Message Encryption/Decryption
  • EncryptTextMessageToDestination(string message, string destination): Encrypts a message
  • DecryptTextMessage(string encryptedMessage): Decrypts a message
JWT Operations
  • CreateEncryptedJWTTokenUsingSharedKey(string destination, int expiryMinutes, long kgt, string sharedKey): Creates a JWT token
  • ValidateTokenUsingSharedKey(string token, string sharedKey): Validates a JWT token
  • GetResourceNameFromJWT(string token): Gets resource name from JWT
  • GetKGTFromJWT(string token): Gets KGT from JWT
Payload Management
  • AddPayloadItem(string key, string value): Adds an item to the payload
  • ClearAllPayloadItems(): Clears all payload items
Loading Environment Files from env-file (Generated after installing Machine Token License)
var (resourceName, machineToken, secret, licenseCode) =  EnvironmentManager.GetAllEnvironmentVariables();
Create a Parent Agent
var agent = new AgentConfig();
agent.SetClientCredentials(CLIENT_ID, "https://your-token-server.com");
bool success = agent.CreateAIParentAgent("parent_config.json");
Create a Child Agent
var parentAgent = new AgentConfig();
parentAgent.LoadAIParentAgent("parent_config.json");
parentAgent.CreateAIChildAgent("secure-password", "child_agent.json");

Loading Parent Agent
var parentagent = new AgentConfig();
parentagent.SetClientCredentials(CLIENT_ID, TOKEN_SERVER_URL);
bool success = parentagent.LoadAIParentAgent(PARENT_CONFIG_FILE);
Loading Child Agent
var childAgent = new AgentConfig();
childAgent.SetClientCredentials(CLIENT_ID, TOKEN_SERVER_URL);
bool success = childAgent.LoadAIChildAgent(password, childConfigFile);

Encrypting and Decrypting Messages
// Send an encrypted message
string message = "Hello from the parent agent!";
string encrypted = parentagent.Session.EncryptTextMessageToDestination
(
                message, 
                "anotheragent.hostname.com"
);

// Decrypt a message
string decrypted = childAgent.Session.DecryptTextMessage(encrypted);
Console.WriteLine($"Decrypted message: {decrypted}");

JWT Operations (Parent Agent Only)
// Generate timestamp in minutes since Unix epoch
Int64 kgt = (long)Math.Round((DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0)).TotalMinutes);

// Get pre-shared key using auth.hexaeight.com
var sk = parentAgent.Session!.HEClient.GetPreSharedKeyByKnownName(destinationResourceName, kgt.ToString()).GetAwaiter().GetResult();

// Clear and add payload
parentAgent.Session?.ClearAllPayloadItems();
parentAgent.Session.AddPayloadItem("BODY", "Your secure message content");

// Create JWT using shared key method
string encryptedJWT = parentAgent.Session!.CreateEncryptedJWTTokenUsingSharedKey(
                            destinationResourceName,
                            expiryMinutes,
                            kgt,
                            sk);

// Decrypting JWT using shared key method

Int64 kgt = anotherparentAgent.Session!.GetKGTFromJWT(jwtToken);

var jwtowner = anotherparentAgent.Session!.GetResourceNameFromJWT(jwtToken);

var sharedkey = await anotherparentAgent.Session!.HEClient.GetPreSharedKeyByKnownName(jwtowner, kgt.ToString());

var validationResult = anotherparentAgent.Session!.ValidateTokenUsingSharedKey(jwtToken, sharedkey);
Console.WriteLine(validationResult);

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.6.838 0 6/11/2025
1.6.837 39 6/10/2025
1.6.836 39 6/10/2025
1.6.835 40 6/10/2025
1.6.834 42 6/9/2025
1.6.833 44 6/9/2025
1.6.832 72 6/9/2025
1.6.831 42 6/7/2025