BONNIE
Durable agent runs for Go.
Create an agent and join a Knight Rider-themed conversation with openai/gpt-6.1-sol. Follow the Quick start for the commands.
Build an agent once. Keep its conversation after a process stops. Wait days for a human answer without keeping an agent process running. Connect through HTTP, Slack, Discord, Telegram, GitHub, or NATS.
BONNIE is early and experimental. The API can change. No release is proven in production. Do not use it for work whose loss would hurt.
Start in five minutes
First, follow the manual release installation. Installation also has an optional download-and-review installer path. The commands below assume the CLI is installed and on PATH.
export ANTHROPIC_API_KEY=your-provider-key
bonnie init my-agent --model anthropic/claude-sonnet-4-5
cd my-agent
go mod tidy
bonnie dev
Use Linux with Landlock enabled and Go 1.27 or newer to build an agent. Read Installation first if your host is not ready. Then follow the Quick start.
Choose your path
| Your goal | Start here |
|---|---|
| Build your first agent | Quick start |
| Understand durability and human input | Core concepts |
| Add instructions, context files, and Go tools | Agent trees and Tools and skills |
| Choose containment or stronger isolation | Sandboxes |
| Connect an application or bot | Channels |
| Run tasks on a schedule | Scheduling |
| Ship a static binary | Deployment |
| Embed BONNIE in Go | Runtime API and Options |
| Find a flag or inspect a run | CLI reference |
| Diagnose a failure | Troubleshooting |
What BONNIE adds to Kit
BONNIE wraps the public Kit SDK. It adds a SQLite journal, lossless conversation replay, human-input suspension, channel routing, and sandbox lifecycle management. It does not fork Kit.
The journal stores typed messages, including tool calls and results. A committed tool-calling step is stored atomically. A new process can restore that history instead of asking the model to reconstruct it.
Durability is not exactly-once execution. An external action can finish before its journal commit. A crash in that interval can cause the action to repeat. Use idempotency keys for payments, deployments, and other external actions.
Configuration is code
An agent tree has instructions.md, context/, skills/, and optional Go packages under tools/. Settings belong in main.go. There is no BONNIE configuration manifest.
package main
import "github.com/mark3labs/bonnie"
func main() {
bonnie.New(
bonnie.WithModel("anthropic/claude-sonnet-4-5"),
).Serve()
}
bonnie build embeds the authored files and compiles one static binary. The target host does not need Go or the BONNIE CLI.
Before deployment
- The default Landlock sandbox confines filesystem access. It does not block network access or provide a separate kernel.
- Custom Go tools run in the host process. Their permissions and secrets are your responsibility.
- Human approval stops the next model step, not another tool call in the same step.
- Authenticate HTTP callers. Use one server to execute runs from a journal. SQLite write safety does not coordinate turns across servers.
- Keep the journal and sandbox data. Waiting runs must retain both.
Read Deployment for the operating checklist and Sandboxes for the security boundaries.