@thsky-21/thskyshield-demo
v0.1.1
Published
Zero-login demo: watch a runaway AI agent repeat itself and get killed at its loop gate. Runs locally — no signup, no API key, no network. npx @thsky-21/thskyshield-demo
Maintainers
Readme
@thsky-21/thskyshield-demo
Watch an AI agent get stuck in a retry loop and killed at its loop gate — in one command.
npx @thsky-21/thskyshield-demoNo signup. No API key. No network. Takes about 4 seconds.
What you'll see
An agent gets stuck retrying the same failing prompt. The loop detector counts the repeats climbing toward the gate, and on the 20th identical prompt the step is denied before the model is called:
step 19 allowed ████████████ 100% of loop gate
↳ loop detector: identical prompt ×19 of 19
KILLED step 20 — loop threshold reached
The step was denied before the model was called. 19 identical prompts in a row — the gate held.
Steps allowed 19 of 50
Loop gate 19 of 19 identical prompts
Killed by loop
Time to kill 4394 ms from run start
Prevented an unbounded retry loop — the same prompt, foreverHow honest is this?
Worth being precise, because a demo that flatters itself isn't worth running:
- The decisions are real. The kill order, the off-by-one semantics, and the fact that a killed step is denied rather than logged after the fact all match production and are pinned by tests.
- The gate lands exactly on the threshold. Nineteen identical prompts are allowed; the twentieth is not. That off-by-one is production's, not the demo's.
- The LLM call is simulated. The demo doesn't need an OpenAI key. The governance decision around the call is the real thing either way.
- The engine is a local port, not the engine. In production the decision logic runs as Lua inside Redis — atomic and distributed. Here it runs in your process so the demo works with no account. Same decisions, different substrate.
- "Prevented: an unbounded retry loop" is not a number on purpose. The agent has no stopping condition — no retry cap, no convergence check, no notion of its own repetition. Any specific figure would be invented, and far too small.
The real thing
This demo governs a fake agent locally. To govern your actual agents:
npm install @thsky-21/thskyshieldimport { Thskyshield } from '@thsky-21/thskyshield';
const shield = new Thskyshield({ apiKey });
const run = await shield.beginRun({ loopThreshold: 5, iterationLimit: 30 });
const { requestId } = await run.beforeStep({
stepType: 'llm',
model: 'gpt-4o',
promptInput: prompt, // hashed client-side; raw prompt never leaves your process
});
// ... call your model ...
await run.afterStep({ requestId });Start free at thskyshield.com/start — no infra.
License
MIT
