← Back to library

Foreman

A local, terminal-first security gateway for Claude Code, Codex, Gemini CLI, Hermes, OpenClaw and any MCP agent: every tool call is checked against policy and risk rules, risky ones wait for your approval in the TUI or with one tap in Telegram, Slack or Discord, and everything is logged. It can also organise your agents like a company, with departments, roles, reporting lines and per-role permissions.

OperationsCLIPackaged

Screenshots and demos

foreman demo in the terminal: one agent reaches for .env and another is told to pipe a script into bash, and Foreman holds both calls until the user answers.
foreman demo in the terminal: one agent reaches for .env and another is told to pipe a script into bash, and Foreman holds both calls until the user answers.

Installation

Version 2.4.0 · The foreman-agent package on npm: the foreman and foreman-hook commands, with README, LICENSE, FOREMAN.md and FOREMAN-TUI.md. The repository also holds the source, tests, docs, the install script and release tooling that are not needed to use it.

  1. Install the command

    Needs Node.js 22.12 or later on macOS or Linux (x64 or arm64); on Windows, use WSL2. The install script reuses a supported Node on your PATH, or sets up Node 22 LTS through nvm, then installs the npm package. You can also run npm install -g foreman-agent yourself, use Homebrew, or download a standalone binary from the GitHub release.

    Install guide ↗
    curl -fsSL https://raw.githubusercontent.com/tuzlu07x/foreman/main/install.sh | bash
    foreman --version
  2. Try it in a sandbox

    foreman demo runs a made-up company of agents in a throwaway folder with its own FOREMAN_HOME, so you can watch approvals, a poisoned instruction being caught and a budget alert in the real TUI. No keys are needed and your real agents and files are not touched.

    foreman demo
  3. Connect Claude Code and your phone

    foreman quickstart connects Claude Code and Telegram and sends a real approval card to your phone. It lists the files it will change and changes Claude Code's settings only after you type y; foreman agent remove claude-code undoes it. For other agents, Slack or Discord, run foreman init and foreman start, which opens the guided setup on first run.

    Foreman website ↗
    foreman quickstart
  4. Keep it running and check it

    Approvals are only shown while foreman start is open or the background service runs. foreman service install starts the gateway at every login, and foreman doctor checks Node, paths, database, policy, agents, the Claude Code hook and channels.

    foreman service install
    foreman doctor

Manual setup

  • Node.js 22.12 or later (the install script can set it up through nvm). Native Windows is not supported; use WSL2.
  • Foreman must be running (foreman start, or the background service from foreman service install) for approvals to reach you. A call that needs approval and gets no answer is denied after 60 seconds for MCP agents and 10 minutes for the Claude Code hook.
  • Optional: a Telegram, Slack or Discord bot token and chat or channel id for approvals and commands from your phone.
  • Optional: API keys for MCP servers and integrations you add (for example a GitHub token), stored in Foreman's encrypted secret store.
  • Optional: an LLM provider (Anthropic, OpenAI, Google Gemini, Ollama or an OpenAI-compatible endpoint) for a second check of risky calls and daily summaries. Decisions do not need a model.

Additional notes

  • Free and open source under MIT. Runs on your machine with no account and no telemetry; policy, org chart, secrets and the SQLite audit log stay in local, owner-only files.
  • It only talks to what you connect: your agents, the MCP servers and integrations you add, the chat channels you enable, and an LLM provider if you turn on the optional LLM features.
  • It is a pre-execution gate and fails closed: if Foreman cannot decide, the call does not run. It does not undo the side effects of a call you approved.
  • Supported platforms: macOS and Linux (glibc or musl) on x64 and arm64 through npm; the standalone binary (about 130 MB, Node built in) covers macOS and glibc Linux.
Find us on