← Back to Discover

Runcap

A local command-line gateway that estimates and hard-caps what AI coding agents spend, compresses their requests, and checks in CI that an agent's claimed success holds up before a pull request can merge.

AI security & guardrailsCode review

What it does

Runcap sits between an AI coding agent and the model provider. You bring your own OpenAI or Anthropic key and your own agent, such as Claude Code, Codex or any script that calls those APIs. You point the agent at a local gateway, which records token usage, prices it from a sourced table and rejects calls once a daily ceiling is reached. Estimates are given as a range rather than an exact figure. The gateway also trims waste from each request without changing instructions or code meaning, for example by collapsing long logs, replacing repeated blocks and sending a line-level diff when an agent re-reads an edited file. The page reports one real OpenAI call where such a re-read fell from 1,186 to 737 prompt tokens. It can flag when an agent keeps sending near-identical prompts, and a preflight check warns when a request looks too broad. A second part measures the cost of a verified result. A mission policy file sets budget, allowed paths and a verification command, and a pinned GitHub Action recomputes the verdict in a clean CI job from the pull request's base commit, returning pass, blocked or human approval required. The page says paid plans, hosted sync and team reporting are not available for purchase today, and the code is MIT licensed.

Capabilities

  • Cost range estimate and hard spending cap enforced by a local gateway
  • Lossless request compression, including line diffs for re-read files
  • Loop detection when an agent repeats near-identical prompts
  • Verified outcome cost: spend measured against a passing verification command
  • Mission policy file with budget, allowed paths and protected files
  • GitHub Action that gates pull requests with pass, blocked or approval-required verdicts

When to use it

  • You run coding agents against your own API keys and want a firm limit on spend
  • You want to catch an agent that edits tests or checks so a build turns green
  • You need a required pull request check for AI-generated changes
  • You want to compare agents by cost per verified result rather than tokens