Reference

Guardrails & Detector Catalog

Highbeam runs 32 core detectors (DET-01..DET-32), 8 habit coaches, and 6 local Blind-Spot Sensors in fast local JavaScript. Zero extra LLM judge tokens are ever spent.

Canonical Detector Catalog (DET-01 to DET-32)

Four rules carry a Ring-0 Security tag (DET-01, DET-02, DET-18, DET-19). Ring-0 guards protect secrets, shell safety, repo settings, and subagent inputs, and block unsafe calls with exit 2. If the hook itself hits an internal fault it fails open by default (see Hooks Lifecycle).

ID Detector Name Default / Severity What It Detects & How to Remediate
DET-01 Option Argument Skipping & Destructive Git/Shell Guard Ring-0 guard · CRITICAL Reads git and shell flags safely to stop flag-smuggling tricks. Blocks risky commands like git reset --hard, git push --force, broad rm -rf, and branch deletes unless you ask for them.
DET-02 Zero-Token Secret & Sensitive File Guard Ring-0 guard · CRITICAL Blocks reads or writes to .env*, SSH private keys, cloud keys, ~/.gemini/oauth_creds.json, and token files before secrets enter chat context.
DET-03 Lockfile & Migration Scope Drift Guard guard · WARN Stops hand edits to generated lockfiles (package-lock.json, pnpm-lock.yaml, Cargo.lock) or past DB migrations unless you ask for them.
DET-04 3-Strike Consecutive Tool Failure Breaker guard · HIGH Trips when 3 tool calls in a row fail with the same unfixed error (consecutiveFailureLimit: 3). Check the root cause before retrying.
DET-05 Destructive Code-Strip, Test-Weakening & Flip-Flop Guard guard · CRITICAL Blocks edits that delete test asserts in bulk, add .skip or only to hide broken tests, or flip-flop between A and B code states.
DET-06 Unmodified File Re-Read & Blind-Edit Guard advisory · MEDIUM Flags repeat full reads of files unchanged on disk since earlier turns. Also warns before editing a file never read in the session.
DET-07 Exit-Safe CLI Compressor & Output Bomb Guard guard · HIGH Catches shell outputs over 4,096 chars (or 25k tokens), strips ANSI noise, and saves full logs in SQLite FTS5 (with centered snippets and a built-in table polyfill on Node 22 builds lacking SQLITE_ENABLE_FTS5). Keeps exact exit codes and error lines intact.
DET-08 KV-Cache Gravity Cross-Model Switch Guard guard · HIGH Checks single-turn C* and multi-turn C_max payback on PreModelSwitch. Uses a $0.02 floor (minSwitchPenaltyUSD), lets unknown non-Anthropic models pass, and defaults holds to permissionDecision: "ask" ("deny" in headless runs).
DET-09 Warm Prefix-Cache Mutation Fence guard · HIGH Holds writes to AGENTS.md, CLAUDE.md, and Turn-0 rules—plus mid-TTL effort, thinking, speed, and mcp_tools changes—above computeDet09BreakEvenTokens (det09MinCachedTokens). Queues edits in TurnZeroGate until TTL ends or PostCompact.
DET-10 Idle 5m Implicit-Cache Watchdog advisory · WARN Watches idle breaks nearing the 300s cache limit. Shows an amber warning at 45s and saves the State Baton at 10s.
DET-11 Shadow File Context Bloat & Confabulation Guard advisory · MEDIUM Spots stale backup copies, scratch duplicates, or guessed file names before edits drift away from the real source file.
DET-12 Haiku 100k Cliff Breaker & Zombie Subprocess Leak Guard guard · CRITICAL Stops Claude Haiku sessions before hitting the 100,000-token 5x price jump (98k warn, 100k stop) and flags orphan background processes.
DET-13 Eager MCP Override & Startup Bloat Auditor advisory · MEDIUM Checks Turn-0 eager MCP tool schemas that pad every turn and suggests lazy-loading servers you rarely use.
DET-14 Premature Stop Gate & Test Verification Guard guard · HIGH Stops the agent from finishing on Stop when edited source files still have failing tests or no test run yet.
DET-15 Batched Stop-Phase Formatter & Placeholder Slop Guard advisory · MEDIUM Saves formatter runs for the end of a task and flags unfinished TODO, FIXME, or stub code in diffs.
DET-16 Hybrid Quota Fan-Out Throttle & Subagent Recursion Cap advisory · HIGH Caps parallel subagents to 1 worker at 80% quota, asks at 90%, and limits workers to 40,000 tokens or 12 turns to avoid 168-hour lockouts.
DET-17 Blind Edit Mid-Batch & Progressive Checkpoint Deferral advisory · MEDIUM Counts dirty files without a test check (default: 4 files) and nudges you to run a quick check before editing more.
DET-18 Untrusted Workspace Settings & Hook Injection Guard Ring-0 guard · CRITICAL Blocks agent edits to .claude/settings.json, hooks.json, or IDE run settings that could widen permissions or add shell hooks.
DET-19 Subagent IPI Boundary & Unicode Tag Sanitizer Ring-0 guard · HIGH Strips hidden Unicode tag chars (U+E0000..U+E007F), zero-width joiners, and prompt-injection lines from subagent and web outputs.
DET-20 Multi-Agent Scope Collision & Hard Quota Brake guard · CRITICAL Enforces file locks in .agents/locks/active_scopes.json across parallel agents and warns on Vision Overage HTTP 400 image bugs.
DET-21 Scratchpad Loop Guard (Compatibility Alias → DET-30) guard · CRITICAL Saved alias that routes straight to DET-30 thinking-loop detection.
DET-22 Diff-Thrashing & Rapid Code Mutation Sensor guard · HIGH Spots rapid rewrites of the exact same lines over a few turns and nudges you to re-check requirements.
DET-23 Empty Catch-Block & Swallowed Error Sensor advisory · HIGH Flags new empty catch {} blocks that hide runtime errors without logging or handling them.
DET-24 Context Degradation & High-Turn Prompt Bloat Sensor advisory · MEDIUM Warns when turn count passes trust_decay_turn_threshold (10 turns) while middle-of-prompt clutter climbs.
DET-25 Cascade 70k Progressive Checkpoint Sensor advisory · INFO Prompts a short progress note near 70,000 tokens so long chats never hit 140k without a saved checkpoint.
DET-26 Monolithic Prompt Decomposer Sensor advisory · INFO Spots huge multi-goal prompts and suggests splitting separate tasks into clean turns or worktrees.
DET-27 Rule File Bloat & Prefix Diet Auditor advisory · WARN Flags AGENTS.md or CLAUDE.md files over 8,000 tokens and suggests running /evolve to split out skills.
DET-28 Subagent Phantom & Orphan Process Sensor advisory · HIGH Checks that files claimed by subagents exist on disk and spots stuck language-server or test PIDs (clean up with highbeam doctor --reap-orphans).
DET-29 Reflector Queue Starvation & Async Feedback Gate guard · MEDIUM Keeps staged learning queues from growing unchecked and surfaces saved lessons once the cache is cold.
DET-30 Scratchpad Loop & Reasoning Hallucination Guard guard · CRITICAL Spots stuck thinking loops and reasoning spikes with no real tool progress, setting loopTriggered: true in Cost Radar.
DET-31 Cross-Worktree Git Merge Conflict Sensor advisory · HIGH Runs safe in-memory git merge-tree checks across active worktrees to warn before two branches clash on the same lines.
DET-32 IOEDR / REMORY Semantic Drift & Contradiction Guard guard · HIGH Checks new plans and edits against locked user rules and the State Baton to catch silent rule drift.

Semantic Habit Detectors (semanticDetectors)

Along with numbered IDs, .attention-horizon.json includes eight readable habit slugs you can set via highbeam config set <slug> <default|off|warn|block>:

Antigravity 6 Local Blind-Spot Sensors

During Antigravity's PreInvocation hook, src/core/blindspot_sensors.mjs runs six fast local disk checks:

  1. DIRTY_SNAP: Spots when a file read earlier in chat was changed on disk by you, a formatter, or git.
  2. SCHEMA_TAX: Measures Turn-0 MCP and tool schema token size against your window limit.
  3. UNSEEN_CALLERS: Scans repo imports when an exported function changes so callers outside ACTIVE_SET do not break.
  4. LEGACY_POISON: Warns when reads pull code from deprecated_paths (**/legacy/**, **/deprecated/**, **/v1/**).
  5. QUOTA_AND_STREAM_SHIELD: Guards against low 5-hour quota (<10%) and single-file writes over 600 lines.
  6. LOOP_AND_GIT_GUARD: Pairs 3-strike command loop checks with dirty-tree reminders.