integrate-arcjet-guard-agent-framework-golisted
Install: claude install-skill arcjet/arcjet-plugin
# Integrate Arcjet Guard into Microsoft Agent Framework for Go
`github.com/arcjet/arcjet-go/agentframework` wraps the application's existing
`arcjet.GuardClient`. Shared Guard fundamentals (client, rules, labels,
decisions, capture) live in
[../arcjet/references/guards_go.md](../arcjet/references/guards_go.md). Load
that reference for anything that is not framework-specific.
Three surfaces, one decision rule:
- **Any Go function** → `arcjet.GuardAction` in the root module. No
framework dependency. Returns `*arcjet.GuardDeniedError` or
`*arcjet.GuardUnavailableError`.
- **A `tool.FuncTool` you can name at wiring time** (from `functool.New`,
`mcptool.ListTools`, or `agenttool.New`) → `agentframework.GuardTool`, or
`GuardTools` for a list. The result is still a `tool.FuncTool`.
- **An agent whose tools the model picks, or user text to screen** →
`agentframework.GuardMiddleware` in `agent.Config.Middlewares`.
This is the Go framework. The .NET and Python Microsoft Agent Framework
implementations have no Arcjet adapter. Do not import `@arcjet/guard` or
`arcjet.guard` here.
## Denials are tool results, never errors
The framework replaces a tool error with `Error: Function failed.` and
allows three consecutive rounds of failing tool calls before the fourth ends
the run. `GuardTool` therefore returns `arcjet.GuardDenialResult` as a
successful result. Do not "fix" this by returning an error, and do not set
`IncludeDetailedErrors` to make errors carry the denial.
## Fa