Thskyshield for Agents

Your agent shouldn't be able to spend $200 on a $2 task.

Thskyshield wraps every agent run with a hard budget, loop detection, and a kill switch. Set the policy. Enforce it across every agent your team ships.

Live kill demo — recording soon

Watch a runaway agent get terminated mid-run

The integration

Five lines. Drop into any agent loop.

agent/run.ts
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}`)
}

Works with LangGraph · CrewAI · OpenAI Agents SDK · AWS Strands · or any custom agent loop.

Kill reasons — thrown as ShieldKilledError

What gets killed.

killed_budget

Budget ceiling hit.

Run terminated. Partial result returned.

killed_loop

Same prompt fingerprint repeated 5×.

Loop detected and killed.

killed_iterations

Iteration limit reached.

Agent stopped at step N.

killed_timeout

Run exceeded time limit.

Killed after T seconds.

Design partners

Free forever for the first five teams.

  • Free forever for the first five teams.
  • 30-minute integration call — we wire it into your agent with you.
  • Direct line for bugs. Co-design the v1 roadmap.

Works with LangGraph · CrewAI · OpenAI Agents SDK · AWS Strands · or any custom agent loop.