Skip to content

mikepenz/agent-buddy

Agent Buddy

Agent Buddy

A desktop application that gives you full control over what AI coding agents can do on your machine.

CI License


Agent Buddy is a human-in-the-loop gateway for AI coding agents like Claude Code and GitHub Copilot. It intercepts tool requests (file edits, shell commands, web fetches, etc.) via hook events, displays them in a review UI, and lets you approve or deny each action before it executes.

Approval queue    History tab    Stats tab

Key Features

  • Approval UI — Review pending tool requests with syntax-highlighted diffs, command previews, and context
  • Protection Engine — Built-in rules that block dangerous operations (destructive commands, credential access, supply-chain attacks)
  • Risk Analysis — Optional AI-powered risk scoring (1-5) via Claude CLI or GitHub Copilot to auto-approve safe operations
  • Always Allow — Grant persistent permissions for trusted tool patterns
  • Away Mode — Disable timeouts for remote/async approval workflows
  • History — Searchable log of all past approval decisions
  • System Tray — Runs in the background with badge notifications for pending approvals
  • Cross-Platform — macOS, Windows, and Linux (currently only macOS pre-built packages are provided)

Quick Start

1. Install

Download the latest macOS DMG from Releases, or build from source for any platform:

git clone https://github.com/mikepenz/agent-buddy.git
cd agent-buddy
./gradlew :composeApp:run    # requires JDK 17+

macOS note: The release DMG is currently unsigned. On first launch, macOS will block it. Go to System Settings > Privacy & Security and click Open Anyway to allow it.

2. Connect Your Agent

Agent Buddy integrates via hooks — lightweight HTTP callbacks that AI agents fire before executing tools. The app registers two types of hooks:

Hook Purpose Claude Code GitHub Copilot
PreToolUse Runs the Protection Engine to block or modify dangerous requests before the agent acts Supported Supported
PermissionRequest Presents the request in the Approval UI for interactive human review Supported Supported¹

¹ Requires GitHub Copilot CLI v1.0.16 or later (added the permissionRequest hook event) and v0.0.422 or later for user-scoped hook loading from ~/.copilot/hooks/.

Both Claude Code and GitHub Copilot now support the full interactive approval flow plus PreToolUse Protection Engine pre-checks.

Claude Code — In Settings > Integrations, click Register Hooks to add both hook entries to ~/.claude/settings.json.

GitHub Copilot — In Settings > Integrations, click Register under GitHub Copilot. This installs the bridge scripts under ~/.agent-buddy/ and writes both hook entries (permissionRequest + preToolUse) into a single user-scoped ~/.copilot/hooks/agent-buddy.json — no per-project setup needed.

3. Review & Approve

When Claude Code requests permission to use a tool:

  1. The request hits Agent Buddy's local HTTP server
  2. The Protection Engine evaluates it against built-in safety rules — dangerous requests are blocked or modified automatically
  3. If the request passes, it appears in the Approvals tab for your review
  4. You approve or deny — the response is sent back to the agent
  5. All decisions are logged in the searchable History tab

Protection Engine

Built-in modules detect and block dangerous patterns, inspired in part by claude-hooks:

Module Examples
Destructive Commands rm -rf, git reset --hard, force push
Credential & Supply-Chain Protection .env files, SSH keys, curl | bash, base64 decode + exec
Tool Bypass Prevention sed -i, perl -pi, echo redirects bypassing Edit tool
Environment Safety Bare pip install, absolute paths, uncommitted file edits

Each module can be configured to: Auto Block, Ask (prompt user), Auto-correct, Log Only, or Disabled.

Risk Analysis

Agent Buddy can optionally score each request's risk level (1–5) using AI, allowing safe operations (risk 1) to be auto-approved and critical ones (risk 5) to be auto-denied.

Two backends are supported:

  • Claude — Spawns a claude CLI process to analyze the request.
  • Copilot — Uses the GitHub Copilot API for risk assessment.

macOS note (Claude backend): Because risk analysis spawns a claude CLI process, macOS may show a file access permission dialog. This permission is not required — you can safely deny it. The risk analysis will still work correctly.

Approval detail with risk analysis

General settings    Protection engine guardrails    Session capabilities settings

Tech Stack

  • Kotlin 2.3 with Kotlin Multiplatform (JVM target)
  • Compose Multiplatform for the desktop UI
  • Ktor for the embedded HTTP server that receives hook callbacks
  • SQLite for persistent history storage
  • Nucleus for native window decorations and macOS dock integration

Design System

The UI is built on a small set of theme-aware primitives living under composeApp/src/jvmMain/kotlin/com/mikepenz/agentbuddy/ui/:

  • Theme tokensui/theme/Theme.kt exposes AgentBuddyColors.* (theme-aware semantic colors) and AgentBuddyDimens.* (canonical icon/density tokens).
  • Shared primitivesui/components/ (PillSegmented, AgentBuddyCard, StatusPill, RiskPill, ToolTag, SourceTag, DesignToggle, ScreenLoadingState, ScreenErrorState, …).
  • Previews — every composable has one or more @Preview functions covering the state matrix (empty / loading / full / error / hover / light+dark).

Generating screenshots

Screenshots are rendered headlessly with compose-buddy-cli — the same tool the iter 1–5 design passes used to verify every change. Build the CLI once (./gradlew :compose-buddy-cli:installDist in the compose-buddy repo) and point COMPOSE_BUDDY_CLI at the installed binary, then:

export COMPOSE_BUDDY_CLI=/path/to/compose-buddy-cli/build/install/compose-buddy-cli/bin/compose-buddy-cli

# Render every @Preview as PNG (desktop renderer, headless)
$COMPOSE_BUDDY_CLI render \
  --project . --module :composeApp --renderer desktop \
  --output /tmp/agent-approver-previews \
  --build --format agent --hierarchy --semantics all

# Filter to a single surface while iterating
$COMPOSE_BUDDY_CLI render \
  --project . --module :composeApp --renderer desktop \
  --preview '*ApprovalCard*' --output /tmp/agent-approver-previews

Output goes to <output>/manifest.json plus one PNG per preview (including *_Light / *_Dark multi-preview variants). The --hierarchy --semantics all flags emit the semantic tree used for the a11y audit. Any UI change must re-render and be verified visually before commit.

See composeApp/DESIGN.md for the full token table, state-matrix coverage, and the preview-authoring playbook.

Contributing

See CONTRIBUTING.md for development setup and guidelines.

Acknowledgements

The Protection Engine modules are inspired in part by claude-hooks by @jspanos.

License

Licensed under Apache 2.0. See LICENSE for details.

About

Helper app for centralized claude code approvals + auto-approve + protection rules

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors