Go SDK for the AgentMesh governance framework — identity, trust scoring, policy evaluation, and tamper-evident audit logging.
go get github.com/microsoft/agent-governance-toolkit/sdks/gopackage main
import (
"fmt"
"log"
agentmesh "github.com/microsoft/agent-governance-toolkit/sdks/go"
)
func main() {
client, err := agentmesh.NewClient("my-agent",
agentmesh.WithCapabilities([]string{"data.read", "data.write"}),
agentmesh.WithPolicyRules([]agentmesh.PolicyRule{
{Action: "data.read", Effect: agentmesh.Allow},
{Action: "data.write", Effect: agentmesh.Review},
{Action: "*", Effect: agentmesh.Deny},
}),
)
if err != nil {
log.Fatal(err)
}
result, err := client.ExecuteWithGovernance("data.read", nil)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Decision: %s, Allowed: %v\n", result.Decision, result.Allowed)
}Ed25519-based agent identities with DID support.
| Function / Method | Description |
|---|---|
GenerateIdentity(agentID, capabilities) |
Create a new agent identity |
(*AgentIdentity).Sign(data) |
Sign data with private key |
(*AgentIdentity).Verify(data, sig) |
Verify a signature |
(*AgentIdentity).ToJSON() |
Serialise public identity |
FromJSON(data) |
Deserialise an identity |
Decay-based trust scoring with asymmetric reward/penalty.
| Function / Method | Description |
|---|---|
NewTrustManager(config) |
Create a trust manager |
(*TrustManager).VerifyPeer(id, identity) |
Verify a peer |
(*TrustManager).GetTrustScore(agentID) |
Get current trust score |
(*TrustManager).RecordSuccess(agentID, reward) |
Record a successful interaction |
(*TrustManager).RecordFailure(agentID, penalty) |
Record a failed interaction |
Rule-based policy engine with wildcard and condition matching.
| Function / Method | Description |
|---|---|
NewPolicyEngine(rules) |
Create a policy engine |
(*PolicyEngine).Evaluate(action, context) |
Evaluate an action |
(*PolicyEngine).LoadFromYAML(path) |
Load rules from YAML file |
SHA-256 hash-chained audit log for tamper detection.
| Function / Method | Description |
|---|---|
NewAuditLogger() |
Create an audit logger |
(*AuditLogger).Log(agentID, action, decision) |
Append an audit entry |
(*AuditLogger).Verify() |
Verify chain integrity |
(*AuditLogger).GetEntries(filter) |
Query entries by filter |
Unified governance client combining all modules.
| Function / Method | Description |
|---|---|
NewClient(agentID, ...Option) |
Create a full client |
(*AgentMeshClient).ExecuteWithGovernance(action, params) |
Run action through governance pipeline |
See repository root LICENSE.