Thskyshield for Agents

Your agent can only do what you said it could.

Thskyshield gives every agent run a declared boundary — which tools it may call, whether it may write, and hard limits on loop, budget, steps and time. The check happens before the call fires.

Watch an agent hit its boundary — no signup, no key, no network

$ npx @thsky-21/thskyshield-demo

About four seconds, on your own machine.

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,
  allowedTools:     ['search', 'read_file'],
  maxMutationClass: 'reversible',
})

try {
  while (!done) {
    const { requestId } = await run.beforeStep({
      stepType:        'tool',
      toolName:        'search',
      mutationClass:   'read_only',
      estimatedTokens: { input: 500, output: 200 },
      promptInput:     currentPrompt,
    })

    const result = await callYourTool(currentPrompt)

    await run.afterStep({
      requestId,
      actualTokens: result.usage,
      model:        'gpt-4o-mini',
    })
  }
} catch (e) {
  if (e instanceof ShieldKilledError) {
    // e.reason: 'killed_scope_tool' | 'killed_scope_mutation' | 'killed_loop'
    //         | 'killed_budget' | 'killed_iterations' | 'killed_timeout'
    console.log(`Agent stopped: ${e.reason}`)
  }
} finally {
  await run.end()
}

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

Kill reasons — thrown as ShieldKilledError

What gets killed.

killed_scope_tool

Tool not on the list.

Denied before the call fires.

killed_scope_mutation

Write too destructive.

Denied before the call fires.

killed_loop

Same prompt fingerprint repeated 5×.

Loop detected and killed.

killed_timeout

Run exceeded time limit.

Killed after T seconds.

killed_iterations

Iteration limit reached.

Agent stopped at step N.

killed_budget

Budget ceiling hit.

Run terminated. Partial result returned.

Get help

Want a hand wiring this in?

  • A personal audit of your first boundary, before you flip enforce on.
  • 30-minute integration call — we wire it into your agent with you.
  • A direct line if something doesn't behave the way the docs say it should.

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