Skip to main content
Glama
README.md
# monaa-guard

[![CI Passing](https://github.com/monaa-research/monaa-guard/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/monaa-research/monaa-guard/actions/workflows/ci.yml)
[![Release v0.1.0](https://img.shields.io/badge/release-v0.1.0-0EA5E9?style=flat-square)](https://github.com/monaa-research/monaa-guard/releases/tag/v0.1.0)
[![License Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-10B981?style=flat-square)](./LICENSE)
[![Pure Safe Rust](https://img.shields.io/badge/Pure%20Safe%20Rust-forbid%20unsafe__code-F97316?style=flat-square)](./crates/monaa-guard/src/lib.rs)
[![100% BYOK](https://img.shields.io/badge/100%25%20BYOK-0%20Keys%20Sent-10B981?style=flat-square)](#free-local-vs-178x-cloud)

**Stop Claude Code, Cursor & Antigravity from burning $20 reading `node_modules`, leaking `.env`, or drifting mid-build.**
Cut local MCP token bloat **40%–65% free forever**—or unlock **17.8x KV-cache compression** in the cloud.

![monaa-guard demo: blocking .env leaks, rm -rf, and cutting token bills 17.8x](./assets/demo.gif)

---

## 1-Line Install

```sh
curl -fsSL https://raw.githubusercontent.com/monaa-research/monaa-guard/main/install.sh | sh
```

**Or paste this repo URL directly into Cursor / Claude Code / Antigravity chat:**

```text
Install and set up https://github.com/monaa-research/monaa-guard in this project using install.sh, wrap our MCP servers with monaa-guard proxy, and run monaa-guard doctor.
```

What happens in ~10 seconds:
1. Downloads the **SHA-256 verified** Rust binary (`v0.1.0`) for macOS or Linux (`x86_64` / `arm64`, zero Python dependencies).
2. Wires `.mcp.json` to proxy MCP tools through `monaa-guard`—your LLM API keys stay `100%` on your machine (`0` keys transmitted).
3. Blocks `.env` reads, `rm -rf`, symlink escapes, and reverse-engineering attempts in **`27 µs`** locally before any tool executes.

```sh
monaa-guard init "Real-time invoice schema validator CLI"  # Create SPEC.md, TASKS.md, SKILL.md, & .mcp.json
monaa-guard savings                                        # Print your token savings card + share badge
monaa-guard doctor                                         # Benchmark local latency (<50 us) & key custody
```

---

## Before vs. After (Real Audited Billing Proof)

On **190.37M+ audited input tokens**, deterministic prompt/prefix alignment drops billed input cost from **`$22.31` -> `$1.25`** (`$0.1172 -> $0.0066` per `1M` tokens, **`17.8x`** cheaper):

| What Changes | Unprotected Coding Agent | `monaa-guard` Free Local (`Apache-2.0`) | `monaa-guard` + 17.8x Cloud Trial |
| --- | --- | --- | --- |
| **Token Bloat (`node_modules`, `target/`, loops)** | Full raw dump into context | **40%–65% smaller locally** (unlimited, free forever) | Stacks **17.8x KV-cache alignment** on top |
| **Bill on 190.37M Tokens (`$0.1172 -> $0.0066/1M`)** | `$22.31` uncached bill | `$7.81 – $13.39` (40%–65% cut locally) | **`$1.25`** verified cached rate (`17.8x` drop) |
| **`.env` Leaks & `rm -rf` Mistakes** | Depends on prompt luck | **Blocked in `27 µs`** deterministically before run | Blocked + signed execution audit trail |
| **Mid-Build Tool / Schema Drift** | Silent tool/schema changes | Shared `SPEC.md` + `monaa-guard.toml` lock | Strict post-handshake schema pinning |
| **LLM API Key Custody** | Depends on proxy | **100% local (`0` keys leave host)** | **100% BYOK (`0` keys leave host)** — hashes only |

![Audited DeepSeek billing proof: $0.1172 down to $0.0066 per 1M tokens across 190.37M+ tokens](./assets/billing-proof.png)

### Track Every Dollar Locally (`monaa-guard savings`)

```text
+----------------------------------------------------------------------+
| monaa-guard // Free Local Token Compactor & 27 us Wire Shield        |
+----------------------------------------------------------------------+
| Responses Compacted : 142                                            |
| Tokens Saved Local  : 1,840,200                                      |
| Payload Reduction   : 54%                                            |
| Bloat / Loops Cut   : 9,410 bloat lines · 312 echoes                 |
| Est. Local Savings  : $0.22                                          |
| Extra Cloud Waiting : $20.35 (17.8x KV-Cache Multiplier)             |
+----------------------------------------------------------------------+
```

---

## Start Your Free 7-Day 17.8x Cloud Trial

The **local token compactor & `27 µs` firewall stay free and unlimited forever** (zero daily caps, zero credit card). When you want the **17.8x cloud KV-cache compression**, strict schema pinning, and **Day-1 priority on the upcoming MONAA Native AI Model**:

```sh
monaa-guard trial <you@company.com> --github <your_github_username>
```

Or claim your pass visually at **[monaa.tech/guard](https://monaa.tech/guard)**!

- **No wasted clock:** Your 7 full days begin only on your **first cloud request**—claiming early burns zero time.
- **No surprise lockouts:** After Day 7, `monaa-guard` cleanly keeps your **unlimited free local compactor & `27 µs` shield** active.
- **Launch pricing when you upgrade (through Dec 31, 2026):** `₹9` for 30 days in India (manual UPI/card, strictly no AutoPay) -> `₹999` / 30d; or `$3.90` Month 1 globally -> `$30/mo` (`$306/yr`).

---

<a id="free-local-vs-178x-cloud"></a>
## Connect Any IDE or Terminal Agent

- **Claude Code:**
  ```sh
  claude mcp add guarded-tools -- monaa-guard proxy --upstream "npx -y @modelcontextprotocol/server-filesystem ."
  ```
- **Cursor / VS Code / Antigravity (`.mcp.json`):**
  ```json
  {"mcpServers":{"guarded-tools":{"command":"monaa-guard","args":["proxy","--upstream","npx -y @modelcontextprotocol/server-filesystem ."]}}}
  ```
- **Agent guides:** See [AGENTS.md](./AGENTS.md) and [CLAUDE.md](./CLAUDE.md). Built in Pure Safe Rust (`#![forbid(unsafe_code)]`, `#![deny(clippy::unwrap_used)]`, `#![deny(clippy::expect_used)]`).