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" />
<PackageReference Include="HexaEightAgent" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=HexaEightAgent&version=1.6.838
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 credentialsSetResourceName(string resourceName)
: Sets the resource nameSetLoginToken(string loginToken)
: Sets the login tokenSetRsOwner(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 agentLoadAIParentAgent(string filename, bool loadEnv = false, string clientId = "", string tokenServerUrl = "", bool logging = false)
: Loads an existing parent agentCreateAIChildAgent(string agentPassword, string filename, bool loadEnv = false, string clientId = "", string tokenServerUrl = "", bool logging = false)
: Creates a new child agentLoadAIChildAgent(string agentPassword, string filename, bool loadEnv = false, string clientId = "", string tokenServerUrl = "", bool logging = false)
: Loads an existing child agentActivateParentAgent()
: Activates the parent agentGetAgentname()
: Gets the current agent's nameGetInternalIdentity()
: Gets the agent's internal identity
Environment Management
LoadHexaEightVariablesFromEnvFile(string envFilePath, EnvironmentVariableTarget target = EnvironmentVariableTarget.Process)
: Loads environment variables from a fileGetAllEnvironmentVariables()
: Gets all HexaEight environment variables
Configuration
SaveConfiguration(string loginToken, string encryptedResourceId, string filename)
: Saves agent configurationCleanConfiguration(string filename)
: Removes agent configurationReadConfiguration(string filename)
: Reads agent configuration
2. Session
Object (JWT)
Message Encryption/Decryption
EncryptTextMessageToDestination(string message, string destination)
: Encrypts a messageDecryptTextMessage(string encryptedMessage)
: Decrypts a message
JWT Operations
CreateEncryptedJWTTokenUsingSharedKey(string destination, int expiryMinutes, long kgt, string sharedKey)
: Creates a JWT tokenValidateTokenUsingSharedKey(string token, string sharedKey)
: Validates a JWT tokenGetResourceNameFromJWT(string token)
: Gets resource name from JWTGetKGTFromJWT(string token)
: Gets KGT from JWT
Payload Management
AddPayloadItem(string key, string value)
: Adds an item to the payloadClearAllPayloadItems()
: 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 | Versions 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.
-
net8.0
- hexaeightaskclientlibrary (>= 1.9.96)
- hexaeightjwtlibrary (>= 1.9.258)
- hexaeightmiddleware (>= 1.6.58)
- Sqlite-net-pcl (>= 1.8.116)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.