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()
}What you get
- Functional options — extend configuration via
WithGatewayURL,WithAPIKey,WithFailClosed, etc., without breaking call sites. - Context propagation —
AgentID,TraceID, andRunIDflow throughcontext.Context; OpenTelemetry-aware. - Tool wrapping —
WrapToolsadds policyCheckandRecordResultto 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_gofor 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.