The execution safety layer for AI agents.
- ✓Open-source license (Apache-2.0)
- ✓Actively maintained (<30d)
- ✓Clear description
- ✓Topics declared
- ✓Documented (README)
claude mcp add ctrlrun -- python -m ctrlrun{
"mcpServers": {
"ctrlrun": {
"command": "python",
"args": ["-m", "ctrlrun"]
}
}
}MCP Servers overview
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/CTRLRun/ctrlrun/main/docs/assets/wordmark-dark.svg">
<img src="https://raw.githubusercontent.com/CTRLRun/ctrlrun/main/docs/assets/wordmark-light.svg" alt="CTRLRun" width="300">
</picture>
</p>
<p align="center">
<strong>CTRLRun stops AI agents from taking wrong, restricted, or malicious actions in your workflows.</strong><br>
Every action is checked against your rules before it runs. Allowed actions go through.<br>
Sensitive ones wait for a person. Forbidden ones are blocked.<br>
<br>
Execution safety for AI agents. A Python library that sits between the decision to act and the call that acts.<br>
A consequential action happens at most once, exactly as approved, and leaves a receipt.<br>
When the outcome is unknown, CTRLRun says so instead of guessing.<br>
<br>
Runs in production on a single file, or on Postgres across hosts. Apache-2.0.
</p>
<!-- generated from tools/docs_audit/render_badges.py (readme) — edit the list, not this -->
<p align="center">
<a href="https://github.com/CTRLRun/ctrlrun/blob/badges/clones-history.json"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/CTRLRun/ctrlrun/badges/clones-badge.json" alt="Clones"></a>
<a href="https://pypi.org/project/ctrlrun/"><img src="https://img.shields.io/pypi/v/ctrlrun?color=B8730A&label=pypi" alt="PyPI"></a>
<a href="https://pypistats.org/packages/ctrlrun"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/CTRLRun/ctrlrun/badges/downloads-badge.json" alt="Downloads"></a>
<a href="https://docs.ctrlrun.dev/"><img src="https://img.shields.io/badge/docs-docs.ctrlrun.dev-B8730A" alt="Docs"></a>
<a href="https://github.com/CTRLRun/ctrlrun/actions/workflows/ci.yml"><img src="https://github.com/CTRLRun/ctrlrun/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI"></a>
<a href="https://github.com/CTRLRun/ctrlrun/actions/workflows/codeql.yml"><img src="https://github.com/CTRLRun/ctrlrun/actions/workflows/codeql.yml/badge.svg?branch=main" alt="CodeQL"></a>
<a href="https://github.com/CTRLRun/ctrlrun/actions/workflows/fuzz.yml"><img src="https://github.com/CTRLRun/ctrlrun/actions/workflows/fuzz.yml/badge.svg?branch=main" alt="Fuzz"></a>
<a href="https://docs.ctrlrun.dev/how-this-is-built"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/CTRLRun/ctrlrun/badges/tests-badge.json" alt="Tests"></a>
<a href="https://docs.ctrlrun.dev/security/verify-guarantees"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/CTRLRun/ctrlrun/badges/verify-badge.json" alt="CTRLRun verified"></a>
<a href="https://scorecard.dev/viewer/?uri=github.com/CTRLRun/ctrlrun"><img src="https://api.scorecard.dev/projects/github.com/CTRLRun/ctrlrun/badge" alt="OpenSSF Scorecard"></a>
<a href="https://www.bestpractices.dev/projects/14615"><img src="https://www.bestpractices.dev/projects/14615/badge" alt="OpenSSF Best Practices"></a>
<a href="https://github.com/CTRLRun/ctrlrun/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/ctrlrun?color=B8730A" alt="License"></a>
</p>
<!-- end generated -->
<p align="center">
<img src="https://raw.githubusercontent.com/CTRLRun/ctrlrun/main/docs/assets/demo.gif" alt="A terminal recording of the three steps below. A policy file gives refunds up to €500 to the agent, sends refunds up to €10,000 to a human, and denies the rest. The agent refunds €500 on its own; a €5,000 refund stops and names the request a human answers. ctrlrun approve grants it against the hash of that exact action. The agent runs the €5,000 refund, then tries €9,000 on the same approval, and that is refused: calls that reached the provider, 1, the €9,000 never left." width="800">
</p>
```bash
pip install ctrlrun && ctrlrun demo
```
## What it does
**The model guesses. CTRLRun does not.** The ticket says refund €500. The agent asks for
€5,000, one extra zero. The tool is in its list, the arguments are well formed, and the model
is completely confident. Nothing above the call disagrees, because nothing above the call is a
check: a tool being callable is not permission to call it with those arguments.
| Without CTRLRun | With CTRLRun |
|---|---|
| Nothing checks the amount. The call goes through. **€4,500 too much.** | Your rule checks the amount. The call never leaves. **€0 wrongly paid.** |
CTRLRun is that check. It reads the arguments about to leave your process and answers what may
happen to them: let it run, ask a human, or stop it cold. Four rules do the work, and each one
is a test in this repository before it is a sentence here.
| | |
|---|---|
| **Exact means exact** | Changed arguments need a new approval. |
| **Once stays once** | Same effect key, shared store, no repeat. |
| **Unknown means wait** | Confirm the outcome before retrying. |
| **Every answer is kept** | Requests, decisions and results, refusals included. |
The third one is the half people forget. A correct €500 refund commits at the provider and the
reply is lost coming back, so the agent retries. Retry libraries, agent frameworks and tool
loops collapse *this failed* into *I do not know what happened*. CTRLRun keeps them apart: a
lost reply is `AMBIGUOUS`, never `FAILED`, and a retry against an `AMBIGUOUS` effect is refused
until a human, or a `reconcile` hook, says what happened.
<details>
<summary>What <code>ctrlrun demo</code> shows: five failures and five refusals, byte for byte</summary>
```console
$ ctrlrun demo
CTRLRun demo — five ways an agent action goes wrong, and what stops it.
Policy: refunds up to €1,000 are autonomous, up to €10,000 need a human, above that are denied.
1. Duplicate effect after a lost response
refund €500 → remote commits → response lost → effect: AMBIGUOUS
agent retries the same refund
✗ BLOCKED — effect may already have committed; blind retry refused
remote refund calls: 1
only a human moves it on: ctrlrun resolve refund:txn_1 --committed|--failed
2. Approval mutation
agent proposes refund €2,000 → human approves apr_0aa78e0380ba55d77a601dc782f57095 (bound to the action hash)
agent executes refund €5,000 →
✗ BLOCKED — approved action ≠ requested action (mismatch)
3. Concurrent agents, same effect
Agent A reserve refund:txn_123 → ACQUIRED → executes
Agent B reserve refund:txn_123 →
✗ BLOCKED — already reserved (in_progress)
4. Approval replay
approval apr_dbc8bc6f06690cdf2e2c55a4e591ef3b used once → consumed
same approval presented again →
✗ BLOCKED — single-use approval already consumed
5. Authority escalation
human €100,000 delegable → finance agent €25,000 → support agent €2,000
support agent's grant: dlg_5f8d41938a3f29972d5489d676cd9edb
support agent requests €50,000 →
✗ BLOCKED — outside the delegated grant (authority_constraint)
remote refund calls: 0
finance agent tries to delegate €50,000 under its own €25,000 → refused (containment: constraints)
support agent requests €1,500 → authority permits it, and the policy asks a human (apr_f86eca24dd80206ab5189ccb1b62aa55)
two axes, and an action needs both: the stricter of the pair wins
Receipts (8): .ctrlrun/demo/receipts.jsonl
Events: .ctrlrun/demo/events.jsonl
Read them: CTRLRUN_STATE=.ctrlrun/demo/state.db ctrlrun receipts
```
Approval and delegation ids are generated per run; everything else is exactly what the demo
prints, and a test fails if the two drift apart. No network, no external service, under a
second. `pip install ctrlrun && ctrlrun demo` runs it locally in about the same time.
</details>
**Where it stops.** It does not detect prompt injection: it contains the consequence rather
than reading the cause. It cannot promise exactly-once against a remote it does not control, it
refuses to *knowingly* act twice, and it rolls nothing back. Receipts are chained, so an alteration
is detected; a truncation at the end and a forged append are not, because the head that would catch
them is a row in the same database, and closing that is what `ctrlrun anchor` is for. They are not
signed: alteration is not authorship. The badge above means the
**declared guarantees pass** in the setup they ran against, and it does not mean secure, safe,
compliant, certified or audited:
[what the badge means](https://docs.ctrlrun.dev/verify#what-the-badge-means)
· [`OWASP-AGENTIC-TOP10.md`](https://docs.ctrlrun.dev/OWASP-AGENTIC-TOP10)
names the four entries this does not address.
If an agent only reads and answers, you do not need CTRLRun. The moment it can **send, pay,
refund, delete, deploy, grant, revoke, approve, submit, purchase or cancel**, you do.
## Use it in three steps
The animation above is this section, recorded against the real library: one policy file, two
short programs, four commands, nothing staged.
**1. Install it.**
```bash
pip install ctrlrun
```
**2. Write down what the agent may do.** One file, `ctrlrun.yaml`. Amounts are integer minor
units, so `50000` is €500. Both ends of every band are bound, because an upper bound alone lets
a negative amount through, and a refund of a negative amount is a charge. Anything not listed is
denied; there is no default-allow.
```yaml runnable
schema: ctrlrun.policy/v2
actions:
stripe.refund:
effect: "refund:{payment_id}"
rules:
- when: { amount_gte: 0, amount_lte: 50000 }
decision: allow # up to €500: the agent acts alone
- when: { amount_gte: 0, amount_lte: 1000000 }
decision: approve # up to €10,000: a human decides
- decision: deny # above that: never
```
**3. Wrap the call that has the consequence.** The decorator names the action, the effect key
names the consequence it has in the world, and the context names who is acting. `stripe` here
is a stand-in that records calls instead of What people ask about ctrlrun
What is CTRLRun/ctrlrun?
+
CTRLRun/ctrlrun is mcp servers for the Claude AI ecosystem. The execution safety layer for AI agents. It has 22 GitHub stars and its last recorded update is dated 2026-09-16.
How do I install ctrlrun?
+
You can install ctrlrun by cloning the repository (https://github.com/CTRLRun/ctrlrun) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is CTRLRun/ctrlrun safe to use?
+
Our security agent has analyzed CTRLRun/ctrlrun and assigned a Trust Score of 95/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.
Who maintains CTRLRun/ctrlrun?
+
CTRLRun/ctrlrun is maintained by CTRLRun. The last recorded GitHub activity is dated 2026-09-16, with 7 open issues.
Are there alternatives to ctrlrun?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy ctrlrun to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/ctrlrun-ctrlrun)<a href="https://claudewave.com/repo/ctrlrun-ctrlrun"><img src="https://claudewave.com/api/badge/ctrlrun-ctrlrun" alt="Featured on ClaudeWave: CTRLRun/ctrlrun" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ
The fastest path to AI-powered full stack observability, even for lean teams.