| Requirement | Version |
|---|---|
Agent Assembly Go SDK (github.com/ai-agent-assembly/go-sdk) |
v0.0.1-rc.3 |
Install:
go get github.com/ai-agent-assembly/go-sdk@v0.0.1-rc.3Minimal Go example showing how to initialize the Agent Assembly Go SDK and execute a governed tool call.
- Importing and initializing the Agent Assembly Go SDK
- Defining a tool that satisfies the
assembly.Toolinterface - Wrapping a tool with
assembly.WrapToolsfor governance interception - Observing the allow decision path through console output
- Using an offline mock
GovernanceClientfor local development and CI
| Requirement | Version |
|---|---|
| Go | >= 1.26 |
| Agent Assembly Go SDK | v0.0.1-rc.3 |
A live Agent Assembly gateway is not required to run this example. It uses an
offline mock GovernanceClient by default. To use a real gateway, replace mockClient
in policy.go with a transport-backed GovernanceClient implementation.
git clone https://github.com/ai-agent-assembly/examples.git
cd examples/go/basic-agent
go mod downloadgo run .[assembly] using offline mock governance client
[assembly] governance: ALLOWED tool=echo input="Hello, Agent Assembly!"
[assembly] tool result: Hello, Agent Assembly!
go test ./...Tests run entirely offline using the mock client — no gateway required.
- An
echoToolimplementsassembly.Tool(Name, Description, Call). assembly.WrapToolswraps the tool with aGovernanceClient.- Before each
Call, the wrapper sends aCheckRequestto the client. - The client returns a
Decision(allowed or denied). - Allowed calls proceed to the inner tool; denied calls return
PolicyViolationError.
| Problem | Fix |
|---|---|
go: module github.com/ai-agent-assembly/go-sdk: not found |
Run go mod download or check network access to proxy.golang.org. |
init requires a running sidecar |
Only occurs when assembly.Init() is called with an explicit gateway URL. This example uses the mock client only — Init() is never called. |
| Unexpected denial | Verify you are not running a modified policy.go that returns Denied: true. |
- Module:
github.com/ai-agent-assembly/go-sdk assembly.Toolinterfaceassembly.WrapToolsfunctionassembly.GovernanceClientinterface