Runcap
Cap routed AI coding spend, constrain what an agent may change, and require CI replay before an AI-generated PR earns merge eligibility.
- Source repo
- kirder24-code/ai-agent-manager
- Stars
- ★ 10
- Last updated
- 4mo ago
- FARS reviewed
- Sep 30, 2026
- License
- MIT
- Primary language
- JavaScript
- FA score
- 67/100 · Some gaps
At a glance
- Works with
- Universal · cross-platformCodex · Claude Code · OpenAI API · Claude API
- You'll need
- Typical use
- A solo developer running Claude Code or Codex who wants a $5/day ceiling to fail the next API call rather than surprise them on the invoice.
- Main limitation
- Spend control only covers traffic routed through Runcap; the CI gate explicitly does not independently meter all model usage or enforce budgets.
- Maintenance
- Commits in the last 6 monthslast commit 2026-06-29
- Source review
- 67/100 · Some gaps
What does this agent do, and when should you use it?
Runcap (published as the ai-agent-manager repository) is a Node.js CLI and local gateway that puts a hard spend ceiling, a scope limit and verification evidence around AI coding agents. You point an OpenAI- or Anthropic-compatible agent at the local proxy on 127.0.0.1:8792; every request is priced from a sourced multi-provider table, compressed losslessly, and blocked with 429 budget_guard once the daily ceiling is crossed. The --guard mode freezes a Task Contract before the run (baseline commit, SHA-256 of the verifier files, package.json scripts) and re-checks it afterwards, grading the outcome VERIFIED_STRONG, VERIFIED_WEAK, UNVERIFIED or VERIFIER_COMPROMISED. A mission declared in .runcap/mission.yaml adds budget, call-count, runtime and path-scope rules, and runcap ci --mode adjudicate replays the verification in a clean GitHub Actions job pinned to an immutable release commit to return PASS, BLOCKED or HUMAN_APPROVAL_REQUIRED on a pull request. Everything runs on your machine or in your own CI: there is no hosted sync, team pool or paid plan today, and v0.6 is MIT-licensed, maintained by a solo consultant in Calgary.
runcap plan returns a cost range plus a recommended cap before anything is spent, and runcap preflight grades a prompt's scope risk and fuel level. runcap gateway starts a local OpenAI-/Anthropic-compatible proxy on 127.0.0.1:8792 that records provider token usage, prices it from a sourced table (Anthropic Opus/Sonnet/Haiku, OpenAI GPT-5 and GPT-4, DeepSeek) with cache-read and batch discounts, compresses every request in three lossless layers (per-field trim, identical-block dedup, line-diff delta encoding of near-duplicate file re-reads) and answers the next call with 429 budget_guard once AIM_DAILY_BUDGET_USD is hit. runcap run wraps an arbitrary agent command, parses the failure and emits a copyable rescue prompt, while gateway-side loop detection flags loop.looping when three consecutive prompts reach 92%+ similarity with no progress. runcap outcome run --verify "<cmd>" divides total run cost by tasks that passed verification, writes an outcome receipt to .runcap/outcomes/<id>/receipt.json with per-field truth labels (observed, calculated, provider_usage, manual_calibration, unknown), and --guard adds the Task Contract checks plus a clean-worktree replay from the baseline commit. runcap mission run enforces .runcap/mission.yaml and exits 1 on BLOCKED. runcap ci --mode adjudicate is the PR gate: it reads policy, verifier and dependencies from the pull request's base commit, replays in a clean job, never reads the agent receipt, and issues PASS / BLOCKED / HUMAN_APPROVAL_REQUIRED. runcap dashboard serves a local cockpit on port 8791 and runcap export writes evidence JSON.
- A solo developer running Claude Code or Codex who wants a $5/day ceiling to fail the next API call rather than surprise them on the invoice.
- A platform or FinOps owner committing .runcap/mission.yaml so a breached budget, an out-of-scope edit or a verifier change turns a pull request red.
- A reviewer who suspects an AI-generated PR went green by editing the failing test, and wants the base-commit replay to return BLOCKED or HUMAN_APPROVAL_REQUIRED.
- A team comparing agents on verified delivery instead of token price, using runcap outcome receipts for the same fix across gpt-4o, deepseek-chat and claude-sonnet-4.
- A developer whose agent keeps circling the same missing import and needs a paste-ready rescue prompt plus an in-flight loop warning.
- Someone running large agent loops on DeepSeek's OpenAI-compatible endpoint who wants pricing, capping and compression with no extra adapter.
- A maintainer who wants the merge gate pinned to an immutable release commit so a candidate PR cannot rewrite its own judge.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
npm install -g runcap # exposes `runcap` (and `aim` as a legacy alias)
- Environment variables
OPENAI_API_KEYOPENAI_BASE_URLANTHROPIC_API_KEYANTHROPIC_BASE_URL- Config files
examples/runcap-adjudicate.yml.runcap/mission.yaml
How do you install or deploy this agent?
Runcap is a Node.js CLI distributed on npm. You need your own OpenAI or Anthropic API key (Runcap does not sell or supply model access) plus an agent such as Claude Code, Codex, or any script calling those APIs; the README does not state a minimum Node.js version.
npm install -g runcap # exposes `runcap` (and `aim` as a legacy alias)A no-API-key demo straight from a clone:
git clone https://github.com/kirder24-code/ai-agent-manager.git
cd ai-agent-manager
npm run setup
npm run demoRun from source without a global install:
node ./bin/runcap.mjs <command>To install the required PR check, copy the pinned workflow and pin the action to a full 40-character commit SHA:
cp examples/runcap-adjudicate.yml .github/workflows/
git rev-parse "vX.Y.Z^{}" # peel the tag to its commit; never use the annotated tag object SHA or @v1Then configure the hardened branch profile from docs/trust-model.md: protected branch, Runcap adjudicate as a required status check, up-to-date-before-merge, dismiss stale approvals, CODEOWNERS for workflow/policy/verifier/dependency/protected paths, and no bypass for ordinary authors.
How do you use this agent?
Estimate and pre-check a mission before spending anything:
runcap plan --fuel 24 -- "build a small auth feature and verify it"
runcap preflight -- claude "build the full mobile app with auth payments and production deploy"Start the capping gateway and point your agent at it:
OPENAI_API_KEY=sk-... AIM_DAILY_BUDGET_USD=5 runcap gateway
# then set: OPENAI_BASE_URL=http://127.0.0.1:8792/v1Anthropic-native tools (Claude Code, /v1/messages) use the same command:
ANTHROPIC_API_KEY=sk-ant-... AIM_DAILY_BUDGET_USD=5 runcap gateway
# then set: ANTHROPIC_BASE_URL=http://127.0.0.1:8792/v1Declare the mission policy in .runcap/mission.yaml:
version: v1
identity:
project: checkout
team: payments
mission:
name: Fix the failing checkout test
task_class: bugfix
budget:
mission_hard_limit_usd: 10
max_llm_calls: 12
max_runtime_minutes: 30
verification:
command: "pnpm test && pnpm build"
guard: strict
protect: ["tests/**", "package.json"]
allow: ["src/checkout/**"]Validate it, run the agent under it, and open the local cockpit:
runcap policy validate
runcap mission run -- claude "fix the failing checkout test, then stop"
runcap outcome run --guard --task "Fix the failing test" --verify "pnpm test" --allow src/ -- claude "fix one failing check, then stop"
runcap dashboard # local cockpit on http://127.0.0.1:8791The PR gate needs no extra command: the workflow's runcap ci --mode adjudicate step ends in PASS, BLOCKED or HUMAN_APPROVAL_REQUIRED and fails the check on BLOCKED.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
What are this agent's strengths and limitations?
- The cap is enforced live at the proxy (
429 budget_guard), not reported after the invoice, and one command covers OpenAI-compatible agents, Anthropic-native agents and DeepSeek via its OpenAI-compatible endpoint. - The CI gate deliberately distrusts the agent:
runcap ci --mode adjudicaterecomputes the verdict from the PR base commit with the action pinned to an immutable release SHA, so a candidate PR cannot rewrite its own judge. - Verification Integrity catches what token dashboards miss — a green produced by editing the verifier, repointing a package.json script or hardcoding the answer is graded VERIFIER_COMPROMISED, not delivered.
- Published evidence is measured and reproducible: a real OpenAI edited-file re-read dropping from 1,186 to 737 prompt tokens (37.9% saved) and a 6-run table of Verified Outcome Cost across models and agent behaviors.
- Three lossless compression layers ship with
js-yamlas the only runtime dependency, avoiding native or ML build pain.
- Spend control only covers traffic routed through Runcap; the CI gate explicitly does not independently meter all model usage or enforce budgets.
- The Proof Gate's strength rests on a hardened GitHub setup you must configure yourself (protected branch, required check, up-to-date-before-merge, CODEOWNERS, no bypass); the README says plainly it is not "unspoofable" or "fully independent".
- You must bring your own provider API key and agent — nothing works end to end without paid model access (the demo runs in
--mock). - Verified Outcome Cost excludes subscriptions, CI minutes, sandbox compute and human review time, and the published benchmark is one run per row, not a vendor ranking.
- It requires a long-running local proxy process and changing
OPENAI_BASE_URL/ANTHROPIC_BASE_URLin your agent's environment; hosted sync, team budget pools and organization reporting do not exist yet.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Runcap This agent | 67 · Some gaps | — | ★ 10 | 4mo ago | JavaScript | Codex · Claude Code · OpenAI API · Claude API |
| OmniRoute — The Free AI Gateway | 69 · Some gaps | CLIFree + model costs | ★ 90k | today | TypeScript | Codex · Claude Code · OpenAI API · Claude API |
| Vet Code Change Verifier | 47 · Major gaps | CLIFree + model costs | ★ 471 | 2mo ago | Python | Codex · Claude Code · OpenAI API · Claude API |
| DeepSeek Harness for GitHub | 85 · Good | Chat botFree + model costs | ★ 67 | 25d ago | TypeScript | — |
How does FollowAgents rate this agent?
Why each dimension lost points
README states spend controls apply only to requests routed through Runcap, and provides --allow/--protect scope constraints plus a HUMAN_APPROVAL_REQUIRED human path, supporting least privilege and confirmation (2). Data-flow transparency: local gateway, upstream base URL, compression and dedup are described (2). Sensitive data: only that users hold their own API keys and Runcap does not sell model access; no concrete key storage or log redaction detail (1). Dependency security: single pure-JS js-yaml dependency, no native/ML deps, small surface (2). External effects: local-first, --mock offline, CI gate is a read-only replay (2). Rollback: BLOCKED/human approval and git worktree isolation exist, but no recovery flow for merged changes or already-spent budget (1). Source attribution: LICENSE and package.json author/repo/homepage are consistent (2).
Self-consistency: PASS/BLOCKED/HUMAN_APPROVAL_REQUIRED semantics align with mission.yaml budget/verification fields and package.json test scripts (2). Dependency availability: engines node>=20, single js-yaml dep, clear npm ci flow (2). Failure messages: 429 budget_guard, BLOCKED reasons such as VERIFIER_COMPROMISED, and copyable rescue prompts are readable (2).
Audience and scenarios: explicitly targets developers with their own provider key, own agent, and CLI comfort, and states who it is not for (3). Capability boundaries: repeatedly disclaims exact cost oracle, independent metering of all usage, independent budget enforcement, and unspoofability (3). Trigger precision: preflight scope risk and loop detection thresholds (3 prompts at 92% similarity) are parameterized, but tuning and false-positive handling are thin (2). Environment fit: supports OpenAI/Anthropic/DeepSeek-compatible endpoints and a local gateway, but requires a resident local process and hardened GitHub setup (2).
Information architecture: README is well structured, but several referenced docs (trust-model, current-product-status, delta-encoding-evidence) are not in evidence and cannot be verified (2). Install notes: global npm install, source run, and consumer-repo wiring steps are complete (2). Naming stability: package name runcap coexists with legacy alias aim, showing a naming migration (2). Examples and FAQ: 60-second demo, command examples, and a real results table, but no standalone FAQ (2). Known limitations: a dedicated honesty section enumerates what is not covered, notably strong (3). License: full MIT text consistent with package.json (3). Versioning/changelog: package.json is 0.6.0 but no CHANGELOG file (1). Maintenance responsibility: author and contact exist, but publisher is unverified and no governance/maintenance commitment is stated (1).
Output usability: receipt.json, policy hash, PASS/BLOCKED verdicts, and copyable rescue prompts are directly usable (2). Marginal value: adds in-run hard caps and verification-integrity adjudication beyond observability and gateways, a differentiated position (2). Cost benefit: local-first, zero native deps, offline mock trial, low adoption cost; but requires a local gateway and hardened GitHub config, and value depends on an existing agent workflow (2).
Claim traceability: most claims cite sources or point to docs and the demo repo/PRs (2). Cross-source corroboration: referenced docs (trust-model, current-product-status, delta-encoding-evidence) and the demo repo are not in evidence, so claims cannot be cross-checked (1). Fact/inference separation: explicitly distinguishes calculated signals from proven savings and labels truth values with N>=5 statistical caveats, a high degree of separation (3).
- Several key referenced docs (docs/trust-model.md, docs/current-product-status.md, docs/delta-encoding-evidence.md) and the demo repo/PRs are not in evidence, so their security and verification claims cannot be checked.
- Publisher identity is unverified, maintenance responsibility and update path are unclear, and there is no CHANGELOG, so version evolution is not traceable.
- Sensitive-data handling is thin: no concrete detail on API key storage, log redaction, or what local data is persisted.
- No rollback/recovery flow is described for already-spent budget or already-merged changes.
- CI gate integrity depends on external hardened GitHub configuration (protected branch, CODEOWNERS, etc.); without it the verdict strength degrades.
FAQ
Is Runcap open source?
Is Runcap safe to use?
Is Runcap still maintained?
Who makes Runcap?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.