npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tripwired

v0.1.7

Published

Behavioral control kernel for autonomous systems

Readme

TRIPWIRED

npm version License CI

Behavioral control kernel for autonomous AI agents


What is Tripwired?

Tripwired is not an AI agent framework. It is a behavioral control kernel designed to observe autonomous AI agents and determine when they should stop acting.

Tripwired does not generate strategies, optimize outcomes, or execute actions. It monitors behavior over time, detects loss of control, and triggers early, explainable intervention.

Autonomous agents rarely fail because of a single bad decision. They fail because they continue acting after they should have stopped.

Tripwired exists to catch that moment.


What Tripwired is NOT

Tripwired is intentionally narrow in scope.

It is not:

  • an AI agent framework
  • an optimization tool
  • a prompt engineering library
  • an execution engine
  • a platform or workflow orchestrator

Tripwired does not tell agents what to do. It tells them when to stop.


Core Idea

Tripwired treats autonomous behavior as a signal, not outcomes.

Instead of asking:

  • "Is this output correct?"
  • "Is this optimal?"

Tripwired asks:

  • "Is control degrading?"
  • "Is behavior accelerating?"
  • "Are anomalies accumulating?"
  • "Should this agent continue acting?"

When the answer becomes uncertain, Tripwired intervenes early.


How Tripwired Works

Tripwired operates as a deterministic decision pipeline:

AgentEvent
  → ActivityState (IDLE / WORKING / LOOPING / RUNAWAY)
    → IntentDecision (CONTINUE / PAUSE / STOP)
      → SafetyDecision (allowed / veto)
        → Intervention Signal

Key signals Tripwired monitors:

  • Token acceleration: Token consumption rate increasing faster than expected
  • Tempo compression: Decisions occurring at increasing frequency
  • Loop detection: Repetitive output patterns (similarity > 90%)
  • Health degradation: Execution quality declining over time

These are behavioral anomalies, not content judgments.

Key properties:

  • Behavior-first: evaluates patterns, not content
  • Deterministic: same input always produces the same decision
  • Explainable: every intervention has a primary reason
  • Conservative by design: early stop is preferred over late recovery

Intervention Model

Tripwired supports two forms of intervention:

  • Soft suspend (PAUSE) New actions are blocked while observation continues.

  • Hard stop (STOP) The agent is halted and requires manual reactivation.

Intervention decisions are driven by a health model that degrades based on behavioral anomalies, not single events.


Deployment Modes

Shadow Mode

  • Observes a live agent
  • Produces intervention signals
  • Does not enforce them

Used for: validation, post-mortem analysis, pilot deployments

Embedded Gate

  • Integrated directly into the decision path
  • Enforces PAUSE / STOP signals

Used for: production control, safety-critical automation

Replay / Post-Mortem

  • Runs deterministically on historical data
  • Answers: "When should this agent have stopped?"

LLM Safety Brain + Rust Kernel

Tripwired includes a high-performance Rust kernel for real-time log analysis:

Log → Regex Pre-Filter (3μs) → LLM (Llama 3.2) → KILL/SUSTAIN → SIGKILL
        ↓                           ↓
    Safe logs                  Anomaly detected
    (instant bypass)           (~164ms decision)

Architecture:

  • Rust Sidecar - Zero-GC, deterministic latency
  • Named Pipe / Unix Socket - Native IPC (TCP fallback)
  • Audit Trail - Immutable JSONL with model fingerprinting

Benchmark (Llama 3.2 3B, AMD RX 6700):

| Scenario | Latency | | ------------------- | ----------- | | Pre-filtered (safe) | 0.003ms | | Cold start | 467ms | | Warm (anomaly) | 164ms |

See CHANGELOG.md for details.


Design Philosophy

Tripwired is built around the following principles:

  • Early stop > late recovery
  • Behavior > outcome
  • Stability > performance
  • Determinism > adaptivity
  • Explainability > cleverness

False positives are acceptable—stopping unnecessarily is recoverable. Silent failure is not—continuing when you should have stopped is irreversible.


Where Tripwired Fits

Tripwired is designed for any system that:

  • acts autonomously
  • operates continuously
  • lacks a reliable internal stop condition

Primary use cases:

  • LLM Agent frameworks (CrewAI, Langchain, Autogen)
  • Autonomous coding agents
  • Customer service bots
  • Research automation pipelines
  • Any AI system with API costs at risk

Quick Start

Install

pnpm install

Run Tests

pnpm test    # 32 tests

Project Structure

src/
├── core/              # Types and contracts
│   ├── types.ts       # AgentEvent, ActivityState, SafetyDecision
│   └── contracts.ts   # SAFETY_GATE_CONFIG
├── activity-engine/   # IDLE / WORKING / LOOPING / RUNAWAY detection
├── intent-core/       # CONTINUE / PAUSE / STOP logic
├── safety-gate/       # Token budget, API rate, veto decisions
├── execution/         # Execution adapter interface
├── monitoring/        # DriftMonitor
└── runtime/           # Pipeline orchestration

Key Configuration

// SAFETY_GATE_CONFIG
MAX_TOKENS_PER_MINUTE: 50_000
MAX_TOOL_CALLS_PER_MINUTE: 60
LOOP_SIMILARITY_THRESHOLD: 0.9
LOOP_WINDOW_SIZE: 5
TEMPO_COMPRESSION_RATIO: 0.3
COOLDOWN_DURATION_MS: 60_000

Status

Tripwired v0.2 is an experimental kernel under active development.

  • APIs may change
  • Defaults are intentionally conservative
  • All thresholds are configurable
  • Stability is prioritized over feature growth

This project is designed to be embedded, not extended.


Closing Note

Tripwired does not make agents smarter. It makes them safer.

If your agent can act on its own, it should also know when to stop.