Skip to content

go-sdk

go-sdk · AI Agent Assembly

Go SDK for AI Agent Assembly — runtime governance for AI agent tool calls, written in idiomatic Go.

Quick Start

import (
    "context"
    "log"

    "github.com/agent-assembly/go-sdk/assembly"
)

func main() {
    a, err := assembly.Init(context.Background(),
        assembly.WithGatewayURL("https://gateway.example.com"),
        assembly.WithAPIKey("..."),
    )
    if err != nil {
        log.Fatal(err)
    }
    defer a.Close()
}

Get started →

What you get

  • Functional options — extend configuration via WithGatewayURL, WithAPIKey, WithFailClosed, etc., without breaking call sites.
  • Context propagationAgentID, TraceID, and RunID flow through context.Context; OpenTelemetry-aware.
  • Tool wrappingWrapTools adds policy Check and RecordResult to any tool slice.
  • HTTP & gRPC interceptors — capture parent agent metadata from incoming requests.
  • Pure-Go by default — works in container images with CGO_ENABLED=0.
  • Native FFI opt-in — enable the CGo bridge with -tags aa_ffi_go for in-process calls.

Where to next

  • Getting started — install, configure, and run a first governed call.
  • Architecture — module layout, FFI bridge, interceptor flow, context propagation.
  • API reference — godoc on pkg.go.dev plus local preview instructions.
  • Guides — context propagation, FFI modes, error handling.