---
title: "Go SDK Code Agent SDK"
source: https://docs.autohand.ai/agent-sdk/go
---

# Go SDK

The Go wrapper gives you typed event structs, \`context.Context\` support, and a straightforward split between the low-level SDK and the higher-level agent API.

## Install

## Low-level SDK

Use \`NewSDK\` when you want to own startup, shutdown, and every request explicitly.

## High-level agent API

Use \`NewAgent\` when you want a reusable session with less transport code in your app.

## Permission responses

## Important event types

-   \`MessageUpdateEvent\` and \`MessageEndEvent\` for assistant output.
-   \`ToolStartEvent\`, \`ToolUpdateEvent\`, and \`ToolEndEvent\` for tool execution.
-   \`PermissionRequestEvent\` for approval pauses.
-   \`ErrorEvent\` for runtime or transport failures.

## Notes

-   The Go SDK still uses the CLI config file for provider settings.
-   The typed event surface is a good fit for terminal UIs and long-running background jobs.
-   Use the higher-level agent API for simple app code, and the low-level SDK if you need direct runtime toggles like permission mode changes.

## Next steps

-   Open \[Go API\](/docs/agent-sdk/go-api.html) for the reference surface.
-   Open \[Handle approvals and user input\](/docs/agent-sdk/io/approvals.html) for the approval loop.