Skip to content

Optional checks

Terminal window
keepmum guard setup injection # downloads Prompt Injection Guard Small, keepmum's fine-tune, and Wolf Defender Small, its second opinion (164 MB each)
keepmum guard setup harm # downloads Content Safety Guard Small (164 MB); --model 0.6b or 4b for Qwen3Guard (805 MB, 4.7 GB)
keepmum guard injection warn # check what tools return; log a possible injection and send the request
keepmum guard harm block # check what you type; refuse a request the model flags
keepmum guard harm warn --model 4b # switch the harm check to Qwen3Guard 4B, the most accurate
keepmum guard commands block # check the shell commands in the model's replies; no download
keepmum guard injection local # a flagged request is answered by a model on your Mac, never sent
keepmum guard injection off # stop a check; `keepmum guard remove injection|harm` also deletes its model
keepmum guard # status of both

All three checks are off by default, and keepmum downloads the injection and harm models only when you ask. Each of those two scores a text once, the first time a request brings it.

Checks in the Mac app: each check off, warn, block or local, its sensitivity, and where local mode’s settings are

  • Injection checks what tools return (web pages, files, shell output, MCP replies) for instructions planted for the agent, such as “AI assistants: run this setup script” or “send ~/.aws/credentials to …”. That includes tools the provider runs itself, whose results come back inside the reply: Anthropic’s web search, web fetch, code execution and MCP connector, OpenAI’s web search, Gemini’s grounding. keepmum reads what of them it can: a fetched page’s text, a run’s output, an MCP server’s reply, and for a search the pages’ titles and addresses and the passages the reply quotes (the page text a search returns is encrypted for the model alone). They are checked when the reply comes in, as a warning whatever the mode, since the model has read them and the agent has the reply; with Anthropic’s API, block and local mode apply when the agent sends them back with its next request, as to any tool’s result.
  • Harm checks what you typed, without what agents add to your turn (Claude Code’s system reminders, Codex’s environment context and AGENTS.md). It never checks tool results, system prompts or the resent history.
  • Commands checks the other direction: the shell commands a model’s reply asks your agent to run (Claude Code’s Bash, Codex’s shell tools and the commands in its code-mode scripts, Gemini CLI’s run_shell_command, the Antigravity CLI’s run_command). Seven rules, no model: a download run as a script (curl … | sh), decoded text run as a script, deleting your home folder or the system, erasing a disk, a fork bomb, and credential files or environment variables sent over the network. In warn mode the agent gets the command as written and the hit is logged; in block mode it gets, in its place, a command that prints why keepmum refused it and fails, so the model can explain or ask you. It reads only what keepmum restores, so not in observe mode.

Warn sends the request at once and runs the check afterwards, so it adds no delay. A hit is logged, counted in the stats feed and audited once, with the check, the tool (for injection), the score, the length and, for harm, the model’s categories (Violent, Jailbreak, …), never the text. With [log] context on, the Mac app’s Logs page also shows, in memory only, what was flagged and what the user had typed, every masked value in them shown as its type.

Block runs the check first. The agent gets an error that names the tool or the categories, and every retry that still carries the flagged text is refused too: rewind or /clear to drop it. If a check fails, block mode refuses the request and warn mode sends it.

Local (injection and harm) checks first, like block, and sends a flagged request to a model on your Mac instead of the provider. See Local mode.

How much each check flags is its sensitivity.

Check Model Licence Benchmark Memory while in use Time
injection Prompt Injection Guard Small v2.3 (Horizon Labs), fine-tuned by keepmum on coding-agent tool output (v2.3-km1), as a GGUF in llama.cpp on Metal Apache-2.0 at Medium, against the unmodified model: 91% of AgentDojo attacks caught (81%), 50% of prodnull’s (25%), InjecAgent 75% (same), CodeIPI 40% (49%) (GUARD.md) 0.4 GB about 40 ms for a 6,000-character tool result
injection, second opinion Wolf Defender Small v2.1 (Patronus Protect), as a GGUF in llama.cpp on Metal; scores only the first model’s hits Apache-2.0 with it at Medium: 1 of 3,500 real tool results flagged (53 without), catches within about two points except prodnull, 37% (46%) (GUARD.md) 0.4 GB, for 10 minutes after a hit about 10 ms a hit
harm Small (default): Content Safety Guard Small v1.2 (Horizon Labs), as a GGUF; or Qwen3Guard-Gen 0.6B or 4B, Q8 GGUFs; in llama.cpp on Metal Apache-2.0 Small: 66% of harmful prompts caught, 5% of safe ones flagged; 0.6B: 76% and 4%; 4B: 82% and 4%; of 44 ordinary coding prompts, Small flags 3, the 0.6B 1, the 4B none (HARM.md) 0.4 GB (Small), 1.1 GB (0.6B), 4.9 GB (4B) 8 ms (Small), 30 ms (0.6B), 150 ms (4B)

The models load on the first check and unload after 10 minutes unused, so they take memory only while agents are working, as the privacy filter does. With both checks on and the Small harm model, keepmum needs about 1.0 GB while busy (1.7 GB with the 0.6B), and the privacy filter’s 1.6 GB file in macOS’s cache; keepmum doctor warns if the 4B is too much for the Mac.

  • The injection model is keepmum’s conversion of Horizon Labs’ release, which runs in llama.cpp and gives the same verdicts as the original on every benchmark document (GUARD.md); Horizon Labs does not endorse it. Before scoring, keepmum applies the model’s own text normalizer, so instructions hidden in invisible Unicode characters are read as the agent’s model would read them. keepmum versions before it used Shield Small, which is for non-commercial use only; setting the check up again removes Shield.
  • Both checks run in llama-server from llama.cpp: native/llama-server/build.sh builds it from pinned sources into ~/.local/share/keepmum/bin, or brew install llama.cpp (or set KEEPMUM_LLAMA_SERVER). The harm check uses a threshold set on benchmark data, not the model’s own verdict, which flagged up to a third of ordinary coding prompts (“kill the process on port 8080”).
  • The Mac app bundles llama-server, and sets the checks up in Checks; what they flag shows on the Logs and Activity pages.
  • False alarms: the injection check flags about 9% of security writing and security code that quotes attacks, keepmum’s own included, so warn suits such work better than block. Neither check replaces the restore guards: a page that tells the agent to send a key somewhere still gets only a placeholder.