Stop runaway agents.
Cap per-user spend.
Audit every LLM decision your team ships.
Hard cost ceilings and loop detection for every agent your team ships. Five lines of code. Zero infrastructure.
Works with LangGraph · CrewAI · OpenAI Agents SDK · any framework
Same atomic Redis check, two problems.
My agent might loop and burn $200.
Runtime governance for agent runs — hard budget ceilings, loop detection, and a kill switch that fires before the money is spent.
My users could drain my OpenAI bill.
Per-user spend enforcement with atomic Redis. Blocks the API call before it executes — no tokens burned, no cost incurred.
Your agent shouldn't be able to spend $200 on a $2 task.
Autonomous agents are non-deterministic by design. One stuck loop, one bad tool call, one hallucinated retry — and a $0.40 task becomes a $40 incident. You won't see it until the OpenAI bill arrives.
Thskyshield wraps each run with a hard dollar budget, loop detection, an iteration cap, and a timeout. You set the limits when the run starts; the kill fires on whichever one trips first. Every step lands in your dashboard.
An agent retries the same call over and over. Killed at the loop signature, not at midnight when you read the bill.
A run crosses its dollar ceiling. Stopped with whatever it has, instead of grinding on into a $40 surprise.
A run blows past the step count you allowed. Capped before it keeps planning forever.
A step hangs and the run outlives its timeout. Ended cleanly instead of left running in the dark.
import { Thskyshield, ShieldKilledError } from '@thsky-21/thskyshield'
const shield = new Thskyshield({
siteId: process.env.THSKYSHIELD_SITE_ID!,
apiKey: process.env.THSKYSHIELD_KEY!,
})
const run = await shield.beginRun({ budgetLimitUsd: 2.00, loopThreshold: 5 })
try {
while (!done) {
const { requestId } = await run.beforeStep({
stepType: 'llm',
model: 'gpt-4o-mini',
promptInput: prompt,
})
const out = await callYourLLM(prompt)
await run.afterStep({ requestId, actualTokens: out.usage, model: 'gpt-4o-mini' })
}
} catch (e) {
if (e instanceof ShieldKilledError) console.log('stopped:', e.reason)
} finally {
await run.end()
}It wraps the loop you already have — works with LangGraph, CrewAI, the OpenAI Agents SDK, or a plain while-loop.
Design partners. We're working with a small group of teams to shape the agent SDK. Free forever for the first five. Want in?
Talk to usThree calls wrap the whole loop.
Wrap your agent loop with beginRun, beforeStep, and afterStep. The control plane enforces your policy on every call — atomically, in under 10ms.
shield.beginRun()Set a dollar budget, max iterations, timeout, and loop detection threshold. Returns a run handle tied to your API key and site.
run.beforeStep()A single atomic Redis round-trip checks all four limits — budget, iterations, timeout, loop — before the API call fires. Returns allowed or throws ShieldKilledError.
run.afterStep() + run.end()afterStep reconciles the actual token cost in Redis. end() writes the final summary to Supabase — total cost, iteration count, kill reason if applicable.
import { Thskyshield, ShieldKilledError } from '@thsky-21/thskyshield'
const shield = new Thskyshield({ siteId, apiKey })
const run = await shield.beginRun({
budgetLimitUsd: 2.00,
iterationLimit: 30,
loopThreshold: 5,
})
try {
while (!done) {
const { requestId } = await run.beforeStep({
stepType: 'llm',
model: 'gpt-4o-mini',
estimatedTokens: { input: 500, output: 200 },
promptInput: currentPrompt,
})
const result = await callYourLLM(currentPrompt)
await run.afterStep({
requestId,
actualTokens: result.usage,
model: 'gpt-4o-mini',
})
}
} catch (e) {
if (e instanceof ShieldKilledError) {
// e.reason: 'killed_budget' | 'killed_loop' | 'killed_iterations' | 'killed_timeout'
console.log(`Agent stopped: ${e.reason}. Spent: $${e.spent}`)
}
} finally {
const summary = await run.end()
console.log(`Total: $${summary.totalCostUsd}`)
}killed_budgetkilled_loopkilled_iterationskilled_timeoutNot a library. A layer above your code.
runs in-process · per developer · stops with the process
runs above your code · per org · persists across deploys
Drop-in budget libraries are great — for one developer protecting one script. They run inside your process, log to stdout, and stop where your code stops.
The moment you have a team, multiple services, policies that need to match across them, or a finance lead who wants to see what's actually happening — you need a layer above the code. A place where policy lives. A place where every decision is logged. A place that doesn't disappear when the process exits.
That's Thskyshield. The SDK is two functions. Everything else — policies, dashboards, audit logs, alerts, cross-service visibility — lives in the control plane.
Free while you build. $49 when you scale.
- 1,000 agent runs / month
- 100 LLM-app active users
- 1 policy
- 7-day audit retention
- —Webhooks
- Community support
- Unlimited agent runs
- Unlimited active users
- Unlimited policies
- 90-day audit retention
- Webhooks
- Email + Slack support
Things people ask us.
Give your agents a kill switch.
Free to start, no credit card. You can wrap your first run in a few minutes.