selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

safepilot logo

Self-host safepilot

v0.2.0

Security-first AI assistant for Telegram with approval

AlphaOpen SourceApache-2.0
Updated7 months ago
LanguageRust
Setup difficultyAdvanced
Stars
190
RAM
~6MB RSS
Requires
SQLite
Docker
ghcr.io/3dcf-labs/safepilot
Install with Docker Compose
safepilot screenshot 1safepilot screenshot 2safepilot screenshot 3safepilot screenshot 4safepilot screenshot 5safepilot screenshot 6safepilot screenshot 7safepilot screenshot 8safepilot screenshot 9safepilot screenshot 10

What is safepilot?

SafePilot is a self-hosted AI assistant that operates through Telegram, turning messages into durable, checkpointed automation runs. It uses a risk-tiered execution model where every task is classified by risk level, with explicit checkpoints before high-risk actions run. The system persists context in SQLite with optional compression, supports both direct LLM API calls and an agent mode with tool-calling loops, and integrates with many third-party services. It runs as a single Rust binary with no external database server, deployed via Docker Compose or cargo build. Security features include SSRF-protected fetch, allowlisted shell commands with bash/sh refusal, cleared subprocess environments, optional bubblewrap sandboxing, and at-rest encryption of sensitive database fields. The project is in early development (v0.2.0) with a security-first design philosophy.

Should you self-host safepilot?

safepilot scores 42/100 on selfhost.directory (how scoring works) and ranks #80 of 120 in AI Assistant. It has 190 GitHub stars.

It shipped 2 stable releases in the past year. The latest, v0.2.0, came out on 4 March 2026. New versions land roughly every 7 days.

Setup is advanced: plan for several services and some ongoing maintenance. An official Docker image is available. It is Apache-2.0-licensed and written mostly in Rust.

Its closest alternative on selfhost.directory is hermes-agent (89/100, 258 015 stars). It scores higher overall, so compare the two before you pick. See safepilot vs hermes-agent side by side.

Features

  • 3DCF context compression
  • Allowlisted shell commands
  • At-rest encryption
  • Explicit approval checkpoints
  • Multiple LLM modes
  • Optional bubblewrap sandboxing
  • Public runtime bindings
  • Risk-tiered task execution
  • SSRF-protected fetch
  • Subprocess isolation
  • Telegram bot interface
  • Third-party Integrations
  • Workspace Isolation

safepilot README

How to install safepilot

Install safepilot with Docker Compose

Docker and Docker Compose
Environment variables
BOT_TOKEN_FILE, ALLOWED_USER_ID, DEFAULT_REPO, DATA_DIR, LOG_DIR, LLM_MODE, LLM_PROVIDER, OPENAI_API_KEY_FILE, ORCH_MASTER_KEY_FILE, STRICT_SECRET_FILE_PERMS, ALLOW_PRIVATE_FETCH, AGENT_ENABLE_WRITE_TOOLS, AGENT_ENABLE_BROWSER_TOOL, TG_ORCH_DANGEROUS_SANDBOX, TG_ORCH_SAFE_PATH, ALLOWED_SHELL_COMMANDS

git clone https://github.com/3DCF-Labs/safepilot cd safepilot docker compose up -d

Recommended deployment method with read-only root filesystem, non-root user, secrets via files

How to configure safepilot

  • AGENT_ENABLE_BROWSER_TOOLfalseEnable agent-mode browser tool

    Enable agent-mode browser tool

    values: true, false

  • AGENT_ENABLE_WRITE_TOOLSfalseEnable agent-mode write tools

    Enable agent-mode write tools

    values: true, false

  • ALLOWED_SHELL_COMMANDSbuilt-in allowlist (pwd, echo, git, cargo, python3, etc.)Comma-separated list of allowed shell commands

    Comma-separated list of allowed shell commands

  • ALLOWED_USER_IDTelegram user ID of the owner (required)

    Telegram user ID of the owner (required)

  • ALLOW_PRIVATE_FETCHfalseAllow fetch to reach private networks

    Allow fetch to reach private networks

    values: true, false

  • ANTHROPIC_API_KEYAnthropic API key

    Anthropic API key

  • ANTHROPIC_API_KEY_FILEPath to file containing Anthropic API key

    Path to file containing Anthropic API key

  • ANTHROPIC_MODELclaude-haiku-4-5-20251001Anthropic model to use

    Anthropic model to use

  • BOT_TOKENTelegram bot token (required)

    Telegram bot token (required)

  • BOT_TOKEN_FILEPath to file containing Telegram bot token

    Path to file containing Telegram bot token

  • BRAVE_API_KEYBrave Search API key

    Brave Search API key

  • BRAVE_API_KEY_FILEPath to Brave Search API key file

    Path to Brave Search API key file

  • CLAUDE_TIMEOUT_SECS90Timeout for summarization calls

    Timeout for summarization calls

  • DATA_DIR/var/lib/tg-orchData directory for SQLite database and workspaces

    Data directory for SQLite database and workspaces

  • DEFAULT_REPODefault Git repository for repo-oriented tasks

    Default Git repository for repo-oriented tasks

  • DISCORD_BOT_TOKEN_READDiscord bot token for read operations

    Discord bot token for read operations

  • DISCORD_BOT_TOKEN_WRITEDiscord bot token for write operations

    Discord bot token for write operations

  • GITHUB_TOKEN_READGitHub token for read operations

    GitHub token for read operations

  • GITHUB_TOKEN_WRITEGitHub token for write operations

    GitHub token for write operations

  • JIRA_API_TOKEN_READJira API token for read operations

    Jira API token for read operations

  • JIRA_API_TOKEN_WRITEJira API token for write operations

    Jira API token for write operations

  • JIRA_DOMAINJira domain

    Jira domain

  • JIRA_EMAILJira email

    Jira email

  • LINEAR_API_KEY_READLinear API key for read operations

    Linear API key for read operations

  • LINEAR_API_KEY_WRITELinear API key for write operations

    Linear API key for write operations

  • LLM_HTTP_TIMEOUT_SECS60LLM HTTP timeout in seconds

    LLM HTTP timeout in seconds

  • LLM_MAX_TOKENS2048Maximum tokens for LLM responses

    Maximum tokens for LLM responses

  • LLM_MODEdirectLLM interaction mode

    LLM interaction mode

    values: direct, agent

  • LLM_PROVIDERLLM provider

    LLM provider

    values: anthropic, openai

  • LLM_REQUEST_TIMEOUT_SECS90LLM request timeout in seconds

    LLM request timeout in seconds

  • LOG_DIR/var/log/tg-orchLog directory for job logs

    Log directory for job logs

  • MAX_LLM_ITERATIONS10Maximum LLM iterations in agent mode

    Maximum LLM iterations in agent mode

  • NOTION_API_KEY_READNotion API key for read operations

    Notion API key for read operations

  • NOTION_API_KEY_WRITENotion API key for write operations

    Notion API key for write operations

  • OPENAI_API_KEYOpenAI API key

    OpenAI API key

  • OPENAI_API_KEY_FILEPath to file containing OpenAI API key

    Path to file containing OpenAI API key

  • OPENAI_MODELgpt-4o-miniOpenAI model to use

    OpenAI model to use

  • OPENWEATHER_API_KEYOpenWeather API key

    OpenWeather API key

  • OPENWEATHER_API_KEY_FILEPath to OpenWeather API key file

    Path to OpenWeather API key file

  • ORCH_MASTER_KEY_FILEPath to master encryption key file

    Path to master encryption key file

  • RUST_LOGinfo,teloxide=warnLog level configuration

    Log level configuration

  • SENSITIVE_PATH_PREFIXES/run/secrets,/var/run/secretsPaths that trigger blocking unless approved

    Paths that trigger blocking unless approved

  • SLACK_BOT_TOKEN_READSlack bot token for read operations

    Slack bot token for read operations

  • SLACK_BOT_TOKEN_WRITESlack bot token for write operations

    Slack bot token for write operations

  • STRICT_SECRET_FILE_PERMStrueRequire 600 permissions on secret files

    Require 600 permissions on secret files

    values: true, false

  • TELEGRAM_BOT_TOKENToken used by agent telegram tool actions (falls back to BOT_TOKEN)

    Token used by agent telegram tool actions (falls back to BOT_TOKEN)

  • TG_ORCH_DANGEROUS_SANDBOXautoBubblewrap sandbox mode for dangerous jobs

    Bubblewrap sandbox mode for dangerous jobs

    values: auto, bwrap, off

  • TG_ORCH_DANGEROUS_SANDBOX_NEToffEnable network isolation in sandbox

    Enable network isolation in sandbox

    values: on, off

  • TG_ORCH_SAFE_PATH/usr/local/bin:/usr/bin:/bin:/opt/homebrew/binSubprocess PATH for jobs

    Subprocess PATH for jobs

  • TODOIST_API_KEY_READTodoist API key for read operations

    Todoist API key for read operations

  • TODOIST_API_KEY_WRITETodoist API key for write operations

    Todoist API key for write operations

  • UNSAFE_SHELL_COMMANDSemptyAdditional commands allowed only during /unsafe window

    Additional commands allowed only during /unsafe window

  • X_API_BEARER_TOKEN_READX API bearer token for read operations

    X API bearer token for read operations

  • X_API_BEARER_TOKEN_WRITEX API bearer token for write operations

    X API bearer token for write operations

safepilot releases & version history

More in Chat

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…