The RunGuard embed widget
A self-contained, dependency-free interactive widget that asks the reader what one runaway agent loop would cost them — and shows the answer in real time. Drop it on a blog post, a doc page, or a "we got a $400 bill" teardown. Every render is a backlink to runguard.dev.
Drop-in snippet
Paste these two lines anywhere in your page body. The widget mounts into the empty div; the script auto-runs once it loads.
<!-- RunGuard loop-cost estimator -->
<div id="runguard-embed"></div>
<script async src="https://runguard.dev/embed.js"></script>
What it does
- Three inputs — tool calls in the loop, tokens per call, $/Mtok.
- One number — the unguarded burn cost, recomputed live as the reader types.
- One CTA — links to runguard.dev with UTM tagging so we can measure which embeds drive signups.
- Attribution line — every render carries a "Powered by RunGuard" backlink. Removing it breaks the brand promise; keeping it is the deal.
What it isn't
- Not a script that loads other scripts. One file, no third-party deps, no analytics beacons, no cookies.
- Not a tracker. The widget never sends data anywhere — the math runs entirely in the visitor's browser.
- Not a polluter. All CSS classes are namespaced
rg-*and injected as a single<style>tag scoped to the widget; nothing leaks into the host page's styles.
Constraints we hold ourselves to
- Under 8 KB of source. Slow blogs are nobody's friend.
- No frameworks. Vanilla JS, runs on any browser from the last five years.
- Idempotent mount. If two copies of the script load, the second one no-ops — we set
data-rg-initon the mount node. - No remote calls. No fetch, no XHR, no images from our domain. The host page can be offline and the widget still computes.
Where it shines
Best paired with a post-mortem post or a tutorial that already discusses agent reliability — readers are primed to think about runaway costs, the widget gives them the number for their own setup, and the CTA lands on a page that solves it. Think:
- "How we got a $437 OpenAI bill in 43 minutes" engineering retros
- browser-use / CrewAI / LangGraph debugging guides
- "Pricing my AI feature" tutorials in dev newsletters
Want a tweak?
The widget is intentionally opinionated. If you need a custom variant — e.g. a per-vendor price preset, or a different default scenario — open a thread on @bitinvestigator and we'll cut a copy.