approval-gate

approval-gate is an agent for Claude Code from ShaheerKhawaja/ProductionOS. It costs 33 tokens per session (1,120 once invoked), scanned C, original, MIT.

A safety check for coding-agent actions that sorts them by risk and requires human approval before high-stakes operations.

In plain words
What is it for?
It reviews proposed file and system changes, explains the action and rollback plan, pauses for approval when needed, and records the decision.
Why use it?
It prevents an agent from deploying to production, deleting data, changing authentication, or making similar risky changes without explicit permission.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the productionos plugin — 4 skills, 41 commands, 11 agents shipped together

Good fit It reviews proposed file and system changes, explains the action and rollback plan, pauses for approval when needed, and records the decision.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/shaheerkhawaja/productionos/approval-gate
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/ShaheerKhawaja/ProductionOS

Made for: Claude Code.

Or install productionos, the plugin that ships this one along with the rest of its 4 skills, 41 commands, 11 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for approval-gate

README.md
[![agentmods](https://agentmods.dev/badge/agents/shaheerkhawaja/productionos/approval-gate/github.svg)](https://agentmods.dev/agents/shaheerkhawaja/productionos/approval-gate)
Your own site
<a href="https://agentmods.dev/agents/shaheerkhawaja/productionos/approval-gate"><img src="https://agentmods.dev/badge/agents/shaheerkhawaja/productionos/approval-gate/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for approval-gate

Your own site · 80×15
<a href="https://agentmods.dev/agents/shaheerkhawaja/productionos/approval-gate"><img src="https://agentmods.dev/badge/agents/shaheerkhawaja/productionos/approval-gate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,120 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.01120
Opus 5 $0.00016 $0.00560
Sonnet 5 $0.00007 $0.00224
Haiku 4.5 $0.00003 $0.00112

Measured 9d ago against content hash 0c1fe09d07b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

approval-gate scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

{"ts":"2026-03-20T22:05:00Z","action":"rm -rf dist/","stakes":"high","decision":"denied","reason":"user wants to preserve build artifacts","files":["dist/"]}
agents/approval-gate.md · 107 lines

How it starts

The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Core Principle

Approval is a TOOL CALL, not a separate flow. When an agent encounters a high-stakes action, it invokes the approval gate as a regular tool — the same way it calls Read or Edit. This collapses the approval layer into the tool layer.

Stakes Classification

Stakes Examples Action
HIGH Deploy to production, delete data, modify auth, push to main, drop tables, modify CI/CD BLOCK until human explicitly approves
MEDIUM Refactor shared code, change API contracts, modify DB schema, update security configs WARN with context and proceed with logging
LOW Edit test files, update docs, lint fixes, add comments, format code AUTO-APPROVE silently

Approval Protocol

When a HIGH-stakes action is requested:

  1. Classify — Determine stakes level from the action + target files
  2. Present — Show the user exactly what will happen:
    • What action is proposed
    • What files will be affected (list each)
    • What the rollback plan is
    • Why this is classified as HIGH-stakes
  3. Wait — Do NOT proceed until the user explicitly approves
  4. Log — Record the approval decision to ~/.productionos/analytics/approval-log.jsonl:
    {"ts":"ISO8601","action":"description","stakes":"high","decision":"approved|denied","files":["list"]}
    

Auto-Classification Rules

HIGH-stakes patterns (always block):

  • git push to main/master/production branches
  • Modifying files matching: auth*, payment*, .env*, credential*, admin*
  • Deleting files (rm, unlink, shutil.rmtree)
  • Database destructive operations (DROP, ALTER TABLE DROP, TRUNCATE, DELETE FROM without WHERE)
  • Modifying CI/CD pipelines (.github/workflows/*, Jenkinsfile, .gitlab-ci.yml)
  • Changing security configurations (CORS, CSP, auth middleware)
  • Force operations (--force, --hard, -f on destructive commands)

Read the full file on GitHub · 107 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 107 lines · 33 tokens per session scan C 0c1fe09d07b8

Subscribe to this mod's changes

approval-gate is an agent published in the GitHub repository ShaheerKhawaja/ProductionOS (8 stars, last pushed 4mo ago), licensed MIT. It adds 33 tokens to every session and 1,120 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

palantir

Background monitor during fellowship execution. Reports the CLI's health sweep (stalled/zombie/struggling) and cross-references quest histories for scope drift and file conflicts. Spawned by Gandalf alongside quest teammates. Reports issues to the lead via SendMessage.

justinjdev/fellowship · 56 tokens

balrog

Adversarial validation agent. Spawned by quest as the first step of its Review phase, before the conventions and code-quality reviews. Analyzes the quest diff for failure modes, writes targeted test cases, runs them, and delivers a severity-ranked findings report. Critical/High findings must be addressed before the…

justinjdev/fellowship · 70 tokens

scout

Research & analysis agent. Investigates questions and analyzes codebases without modifying source code. Can write research notes to docs/research/ or .fellowship/. No git operations, no commits, no PRs.

justinjdev/fellowship · 46 tokens

validator

Read-only adversarial validator. Spawned by scout to verify research findings against the actual code. Challenges assumptions, confirms or refutes claims, and reports CONFIRMED/CONTESTED/UNVERIFIED. Cannot modify files or run commands — enforced by tool restrictions.

justinjdev/fellowship · 56 tokens

project-auditor

Use for /audit or when no PROJECT.md exists. Auditor + Architect hybrid — stack detection, vulnerability analysis, outdated dependency scan, architectural debt, and a concrete refactoring plan.

avelikiy/great_cto · 41 tokens

edtech-reviewer

Education-technology specialist pre-implementation reviewer for edtech archetype. Specialises in COPPA verifiable parental consent, FERPA student-data handling, GDPR-K (digital age of consent), Section 508 + WCAG 2.2 AA accessibility, child-safety content moderation (CSAM hash, NCMEC reporting), and US state…

avelikiy/great_cto · 112 tokens