Go SDK
The Go SDK provides tools for creating, signing, and verifying Agent Receipts in Go applications. It lives in the monorepo at sdk/go/ and is organized into three packages.
Features
Section titled “Features”- Create and sign Agent Receipts with Ed25519
- Build and verify hash-chained receipt sequences
- Action taxonomy with built-in classification and risk levels
- SQLite-backed receipt store (pure Go, no CGO required)
- W3C Verifiable Credentials compliant
Packages
Section titled “Packages”| Package | Import | Description |
|---|---|---|
receipt | github.com/agent-receipts/ar/sdk/go/receipt | Core receipt creation, signing, verification, and chaining |
taxonomy | github.com/agent-receipts/ar/sdk/go/taxonomy | Action type registry and tool call classification |
store | github.com/agent-receipts/ar/sdk/go/store | SQLite-backed persistence and querying |
Quick example
Section titled “Quick example”package main
import ( "fmt" "log"
receipt "github.com/agent-receipts/ar/sdk/go/receipt")
func main() { keys, err := receipt.GenerateKeyPair() if err != nil { log.Fatal(err) }
unsigned := receipt.Create(receipt.CreateInput{ Issuer: receipt.Issuer{ID: "did:agent:my-agent"}, Principal: receipt.Principal{ID: "did:user:alice"}, Action: receipt.Action{ Type: "filesystem.file.read", RiskLevel: receipt.RiskLow, }, Outcome: receipt.Outcome{Status: receipt.StatusSuccess}, Chain: receipt.Chain{Sequence: 1, ChainID: "chain-1"}, })
signed, err := receipt.Sign(unsigned, keys.PrivateKey, "did:agent:my-agent#key-1") if err != nil { log.Fatal(err) }
valid, err := receipt.Verify(signed, keys.PublicKey) if err != nil { log.Fatal(err) } fmt.Println("Valid:", valid) // Valid: true}See Installation to get started.