Reins Logo

🪢 Reins

Security controls for AI agents.

github.com/pegasi-ai/reins

npm downloads License: Apache 2.0 TypeScript Node.js >= 18.0.0

> In Greek myth, Athena gave Bellerophon the golden bridle — reins included — that let him guide Pegasus. Reins applies the same idea to AI agents: raw power is not enough — what matters is making it controllable. Reins enforces deterministic security policies on every agent action, scans your configs for OWASP ASI10 vulnerabilities, and tracks drift over time. Policies evaluate in under 50ms. Works with Claude Code PreToolUse and PostToolUse hooks, OpenClaw, and any MCP-compatible agent. ## Quickstart ```bash npm install -g @pegasi-ai/reins reins init ``` ## Purple-team quickstart Compare an agent's shell permissions and installed skill manifests before and after a configuration change. The offline viewer shows which OWASP Agentic Skills Top 10 categories have related scan evidence and which still need review. ![Reins viewer comparing baseline and retest scans, displaying ARTEX and Shirudo reports, and filtering OWASP evidence gaps](public/reins-purple-team-preview.gif) The preview uses a real Reins fixture scan and synthetic ARTEX findings and Shirudo verifier results. **1. Clone and run the exercise.** From a terminal with Git, Node.js 18 or later, and npm, run: ```sh git clone https://github.com/pegasi-ai/reins.git cd reins npm ci --ignore-scripts npm run build node scripts/purple-demo.cjs > purple-review.json ``` **2. Review the results in Codex.** Open the cloned `reins` folder in Codex and paste this prompt into a new chat. The checkout includes the [purple-team skill](.agents/skills/reins-purple-review/SKILL.md). ```text $reins-purple-review Review purple-review.json. Which checks changed after the configuration edits, and which OWASP Agentic Skills risks still need evidence? ``` **3. Open the local viewer.** Double-click `docs/purple-review/index.html` in the checkout. Use **Theme** to choose Dark, Light, or System. Choose **Open reports** and select `purple-review.json` from the repo root. Look for `SHELL_COMMAND_ALLOWLIST` changing from FAIL to PASS and `CLAWHAVOC_IOC` from WARN to PASS. Select **Need evidence** to see the gaps. To explore the viewer without building, open the same HTML file and load the bundled `docs/purple-review/example.json`. You can also load a saved ARTEX findings export and a Shirudo verifier JSON alongside the scan. ## Claude Code Skill The [Claude Code skill](plugin/skills/reins/SKILL.md) documents the Reins plugin hooks. To copy its instructions into your personal skills directory from this checkout, run: ```bash mkdir -p ~/.claude/skills/reins cp plugin/skills/reins/SKILL.md ~/.claude/skills/reins/SKILL.md ``` ## Demo ![Reins demo](./public/reins-demo.gif) An OpenClaw agent tries to bulk-delete 4,382 Gmail messages. Reins blocks it before execution. ## What Reins does - **Prevent** — Block destructive actions before execution. Score irreversibility. Detect risky browser state. - **Pause** — Route high-impact actions through terminal or messaging approval flows. Require explicit `CONFIRM-*` tokens for catastrophic operations. - **Prove** — Preserve an immutable audit trail of every decision, approval, and block. ## Security guarantees - **Zero Trust** — every action evaluated before execution - **Synchronous** — agent cannot proceed until the hook exits - **No network in the hot path** — policies cached locally, enforced offline - **Fail-closed** — any unhandled hook error blocks the action - **Immutable audit** — append-only JSONL at `~/.openclaw/reins/decisions.jsonl` ## Documentation Full docs at [reins.sh/docs](https://reins.sh/docs): - [Getting Started](https://reins.sh/docs/getting-started) - [How It Works](https://reins.sh/docs/how-it-works) - [Security Policies](https://reins.sh/docs/policies) - [CLI Reference](https://reins.sh/docs/cli) - [Security Scan](https://reins.sh/docs/scan) - [Reins Cloud](https://reins.sh/docs/reins-cloud) - [Use as a Library](https://reins.sh/docs/library) - [Architecture](https://reins.sh/docs/architecture) ## Contributing PRs welcome. See [CONTRIBUTING.md](CONTRIBUTING.md). ## License Apache 2.0 — see [LICENSE](LICENSE).