Skip to content

About

failproofai policy pack — chhhee10/cost-guard

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

cost-guard

Policies that stop your agent spending money nobody approved.

failproofai policies add chhhee10/cost-guard

The failure mode: you say "get this deployed" or "run the benchmark", and the agent provisions a GPU fleet, copies a bucket across regions, or launches an unbounded parallel job. Nothing it did was wrong in kind. Every command exited 0 and reported success. The only signal is the invoice, thirty days later.

17 policies in 4 categories. Nine are on by default; the other eight are opt-in, because switching on a stranger's every policy unattended is an opinion nobody asked for.

Compute

policy default
block-gpu-instance-launch — 8-GPU or A100/H100-class instances on
block-large-scale-up — scaling nodes or replicas to a large absolute count on
block-terraform-apply-without-plan — non-interactive apply with no saved plan on
block-oversized-instance-launch — 24xlarge-and-up or bare metal off
block-managed-cluster-create — EKS/GKE/AKS/EMR, which bills while idle off

Data

policy default
block-whole-bucket-recursive-copy — a recursive copy whose source is the whole bucket on
block-cross-region-bucket-transfer — where egress is the charge and the command never says so on
block-whole-database-export-or-restore — a full dump, or a snapshot restored into a new instance off
block-unbounded-storage-retention — multi-year retention and replication rules off

Inference

policy default
cap-frontier-eval-row-count — a frontier model over a full dataset on
bound-inference-job-concurrency — unbounded fan-out, one model call per item on
require-max-output-tokens-in-call-loops — where the cap is otherwise the context window off
sample-before-embedding-or-finetuning — a fine-tune or embedding pass over a whole corpus off

Most of these instruct() rather than deny(). The work is usually legitimate, and "cap it, then scale up" is worth more than a refusal.

Runaway

Things that keep costing after the agent has stopped looking.

policy default
block-unreaped-background-spend — a billable job detached with nothing to reap it on
block-unbounded-retry-loop — a loop that re-issues a billed call forever on
block-unbounded-fanout-to-paid-work — xargs -P0 and friends, where each worker costs off
require-deadline-on-billable-wait — a metered command that can hang off

What is deliberately not blocked

Every regex here is narrow on purpose, because a policy that fires on ordinary work gets switched off within a day — and then it protects nobody.

  • --dry-run, terraform plan, --what-if, --validate-only are never blocked. Explicitly asking for a no-op is the opposite of the problem.
  • Local emulators — LocalStack, moto, MinIO, the gcloud and Azure emulators, kind/k3d/minikube — bill nobody, and are carved out everywhere.
  • Spot and preemptible instances change the number by an order of magnitude and are evidence somebody already thought about cost.
  • A same-region copy is not a cross-region one. The policy compares the two ends rather than matching on the verb.
  • Prose is stripped before flags are scanned, so git commit -m "switch to p5.48xlarge" does not read as launching one — while --instance-type "p5.48xlarge" still does.
  • A local model — ollama, llama.cpp, vllm on localhost — costs nothing per call and is exempt from every inference policy.
  • npm run dev & is a dev loop, not a leak. Only plausibly billable background work is guarded.

If one does fire on real work, tighten the regex and re-publish — failproofai publish dates the next version for you.

Seeing it before you install it

failproofai policies show chhhee10/cost-guard             # what it contains
failproofai policies show chhhee10/cost-guard --releases  # every version, and which is here

Both read the manifest and the release list only. Looking at a pack never runs a pack.

Taking part of it

failproofai policies add chhhee10/cost-guard                      # the nine defaults
failproofai policies add chhhee10/cost-guard --all                # all seventeen
failproofai policies add chhhee10/cost-guard --category Inference
failproofai policies add chhhee10/cost-guard --policy block-gpu-instance-launch

The files

compute.mjs      provisioning that bills by the hour
data.mjs         moving or storing data at a price
inference.mjs    paying per model call
runaway.mjs      what keeps costing after the agent stopped looking

Each is a plain ESM module calling customPolicies.add. ctx.toolName and ctx.toolInput are canonical across all twelve agent CLIs failproofai supports, so one policy written once works everywhere.

Licence

MIT.

About

failproofai policy pack — chhhee10/cost-guard

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages