princezuda/safeclaw

SafestClaw flips the usual AI assistant script. Instead of leaning on large language models (LLMs) running in the cloud, it builds a deterministic AI assistant driven by classical machine learning and local AI models. This approach delivers over 90% of the features of comparable LLM-based assistants like OpenClaw β€” but with zero monthly cost, stronger security by design, and multi-channel integration that works offline.

What safestclaw does and how it is built

SafestClaw is a Python-based AI assistant framework designed with a clear focus on classical ML over LLMs. The repo bundles speech-to-text (Whisper), text-to-speech (Piper), and deterministic natural language processing pipelines, creating an assistant that runs entirely locally by default. This means no calls to cloud APIs are needed unless the user opts in, which keeps operation costs at zero and avoids the risks associated with prompt injection attacks common in LLMs.

Its architecture supports multiple interaction channels: command-line interface (CLI), Telegram bot, webhooks, and a localhost web UI. This multi-channel design allows users to engage with the assistant in the environment that suits them best. Additionally, SafestClaw offers an optional Model Context Protocol (MCP) server that exposes every action as a callable tool, enabling advanced integration and extensibility.

Under the hood, instead of using large and often opaque LLM calls, SafestClaw employs classical ML tools like VADER for sentiment analysis, Sumy for text summarization, YOLO for object detection, and Tesseract for OCR. These components are deterministic and auditable, which improves reliability and security. The local AI model presets start at about 1.3GB, which is reasonable for modern machines.

Technical strengths and design tradeoffs

The core strength of SafestClaw lies in its choice to prioritize classical ML pipelines over LLMs. This decision makes the assistant inherently immune to prompt injection. Since the NLP pipelines are deterministic and do not rely on probabilistic language generation, the risk vectors common in LLM-based agents are eliminated by default.

Code quality in the repo is pragmatic and focused on ease of use. The setup commands handle complex configuration automatically, sparing users from editing YAML or JSON files. This lowers the entry barrier to running a capable AI assistant locally.

The multi-channel support is implemented thoughtfully, with consistent setup workflows across CLI, web UI, and Telegram, guiding users through local-only, cloud, or hybrid configurations. This uniformity enhances developer and user experience.

The tradeoff is clear: by avoiding LLMs, SafestClaw will not match the generative creativity or deep contextual understanding that models like GPT-4 provide. This means certain conversational or complex reasoning tasks may be limited. However, for many practical tasks like summarization, sentiment analysis, speech transcription, and command execution, the classical approach is sufficient and more secure.

The modular plugin-like architecture with MCP server support allows advanced users to extend functionality or integrate external LLMs if desired, providing a flexible upgrade path.

Quick start

SafestClaw offers a straightforward installation and setup process documented in the README, with commands designed to simplify AI setup and configuration:

### πŸ€– Super Simple AI Setup
* **Just enter your key** β€” `setup ai sk-ant-your-key` and you're done. Auto-detects Anthropic, OpenAI, Google, Groq
* **Or go local** β€” `setup ai local` auto-installs Ollama, downloads a model, configures SafestClaw
* **Model presets** β€” `setup ai local small` (1.3GB), `setup ai local coding`, `setup ai local writing`
* **Status check** β€” `setup ai status` shows what's configured
* **Zero config files** β€” No YAML editing needed, the command does it for you

### πŸ› οΈ First-Run Setup, Anywhere
* **Same walkthrough in every channel** β€” CLI, web UI, Telegram all guide first-time users through local-only / cloud / hybrid / skip
* **Conversational** β€” type a number or `skip`; no rich prompts that only work in a TTY
* **Web UI banner** β€” driven by `/api/health.needs_setup`
* **CLI nudge** β€” yellow setup-needed panel right after launch when config isn't complete
* **Triggers any time `setup_completed` isn't set** β€” not just first launch; perfect for users who never finished setup

## Installation

### From PyPI (recommended)

```bash
pip install safestclaw                  # core
pip install "safestclaw[mcp]"           # + FastMCP plugin (Model Context Protocol)
pip install "safestclaw[caldav]"        # + CalDAV calendar sync
pip install "safestclaw[telegram]"      # + Telegram bot channel
pip install "safestclaw[smarthome]"     # + Philips Hue / Home Assistant MQTT
pip install "safestclaw[all]"           # everything except heavy ML deps

Using pipx (isolated CLI install)

# AI Setup (super simple)
safestclaw setup ai sk-ant-your-key  # Enter Anthropic key, done
safestclaw setup ai sk-your-key      # Or OpenAI key
safestclaw setup ai local            # Or auto-install Ollama (free)
safestclaw setup ai local coding     # Install coding-optimized model
safestclaw setup ai status           # Check your setup

These commands auto-detect and configure AI backends, removing the need for manual YAML or config file edits. The setup process is consistent whether you use the CLI, web UI, or Telegram bot.

verdict

SafestClaw is a compelling choice if you want an AI assistant that runs locally with no ongoing cost and strong security guarantees. Its deterministic classical ML pipelines trade off some generative flexibility but deliver a reliable, prompt-injection-free experience. The multi-channel support and automated setup commands make it accessible for developers and power users alike.

It’s especially relevant if you want to avoid cloud dependencies or protect sensitive workflows from LLM prompt injection risks. On the other hand, if your use case demands deep conversational AI or complex generative reasoning, SafestClaw may feel limited.

Overall, SafestClaw demonstrates that with careful design, classical ML approaches can cover a large portion of AI assistant functionality securely and cheaply. It’s worth understanding for anyone building local AI tooling or concerned about prompt injection vulnerabilities.


β†’ GitHub Repo: princezuda/safeclaw ⭐ 276 Β· Python