# Habits prompt-injection guard

> Habits prompt-injection guard is a freemium MCP server for ai models and llm tooling. Check user prompts for injection and jailbreaks with a guard that learns from your labels. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Freemium
- **Platforms:** API, Web
- **Website:** https://habits.darmousseh.com
- **MCP Registry name:** com.darmousseh/habits-guard
- **Categories:** AI models and LLM tooling, security
- **Listing updated:** 2026-11-14

## About

Habits starts from a trained prompt-injection guard and adapts it to your own traffic. You send each user prompt to your guard, get back a score from 0 to 1 and which answerer replied, then send corrections when a moderator or log shows a wrong call. The site reports false alarms falling from 15.4% to 4.1% after fifty labels in its test, and says the habit takes over once it beats the model on held-out labels, passing uncertain prompts back to the model.

The MCP server works without a key using the public guard through `check_prompt`. Calling `get_free_key` creates a free key; with it as a bearer token, `check_prompt` asks your own guard and `teach_guard` records corrections. A free key can spend up to $0.10 a day, which the site says covers more than 10,000 prompts of 200 tokens.

The site says it is built for what users type, and that on tool output and retrieved documents the model alone does better. The guard model is clef-flash on Cloudflare Workers AI. Paid plans with higher limits are not open yet.

## Features

- **Prompt scoring:** Returns a 0 to 1 injection score and who answered.
- **Learns from labels:** Send corrections so false alarms drop on your own traffic.
- **Keyless start:** The public guard works without any key.
- **Free key:** Create a key with no card or email for your own guard copy.
- **Handover logic:** The habit answers alone only after beating the model on held-out labels.
- **Low per-token pricing:** Billed per million input tokens after the free allowance.

## Good for

- Screen user prompts for jailbreaks before they reach your model
- Reduce false alarms on role-play heavy products
- Teach a guard from moderator decisions
- Add a quick injection check inside an agent workflow

## Install

### Claude Code (Terminal)

```sh
claude mcp add --transport http habits-guard https://habits.darmousseh.com/mcp
```

### Claude Desktop (Settings → Connectors → Add custom connector)

```sh
https://habits.darmousseh.com/mcp
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "habits-guard": {
      "url": "https://habits.darmousseh.com/mcp"
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "habits-guard": {
      "type": "http",
      "url": "https://habits.darmousseh.com/mcp"
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "habits-guard": {
      "serverUrl": "https://habits.darmousseh.com/mcp"
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "habits-guard": {
      "type": "http",
      "url": "https://habits.darmousseh.com/mcp"
    }
  }
}
```

## Tools

- `check_prompt`: Is this user-typed text a prompt injection or jailbreak (an attempt to override, hijack or extract an AI system's instructions)? Returns flagged true/false and a 0-1 score. Without a key it uses the public guard (30 checks per day per network). With a key it uses your own guard, which learns from teach_guard; the result carries a request_id. Built for user prompts; it is weak on injections hidden 
- `teach_guard`: Label one prompt for your own guard so it stops repeating a mistake (a false alarm on a normal request, or a missed injection). Needs an API key (get_free_key). About 50 of your own labels cut false alarms from 15% to 4% in our benchmark.
- `get_free_key`: Create a free Habits account and API key (no email). The key is shown once; set it as the Authorization: Bearer header for this MCP server. The free plan has a fixed $0.10/day spend cap and its own trainable injection guard.

## FAQ

### Do I need an API key?

No. check_prompt works keyless against the public guard. A free key gives you your own guard.

### What does it cost?

$0.04 per million input tokens for a habit's first 100 decisions, then $0.02. Free keys can spend up to $0.10 a day.

### Does it check tool output?

It is built for user prompts. On tool output and retrieved documents the site says the model alone does better.

### Which model backs it?

clef-flash on Cloudflare Workers AI.

### Is Habits prompt-injection guard free?

Habits prompt-injection guard has a free plan, with paid plans for more usage or features.

### How do I add Habits prompt-injection guard to Claude Code?

Run this command in your terminal: claude mcp add --transport http habits-guard https://habits.darmousseh.com/mcp

### What are the best alternatives to Habits prompt-injection guard?

The closest alternatives to Habits prompt-injection guard are REA, Claude Code Ultimate Guide, Agent Roast, Midplane and Leash.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Agent Roast](https://ai-powered.com/mcp/agent-roast): Agent Roast is an open-source MCP server for developer tools.
- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.
- [Leash](https://ai-powered.com/mcp/leash): Leash is a free MCP server for security.
- [SecureCloud](https://ai-powered.com/mcp/securecloud): SecureCloud is a free MCP server for security.
- [Tinplate Edge AI Safety, Security & EU Compliance](https://ai-powered.com/mcp/tinplate-edge-ai-safety-security-and-eu-compliance): Tinplate Edge AI Safety, Security & EU Compliance is a freemium MCP server for security.
- [Eikino](https://ai-powered.com/mcp/eikino): Eikino is a freemium MCP server for security.

---
Source: https://ai-powered.com/mcp/habits-prompt-injection-guard
