dsh-automode Pipeline

dsh-automode Pipeline A workflow diagram generated by Archify. 01 / Agent Runtime 02 / Pre-execute Gate 03 / Approval Waterfall EX / Breaker & Human Fallback 05 / Execution Path Intercept Decide Execute LLM verdict pipeline Tool Call · pre-execution · Agent Runtime › Intercept Tool Call pre-execution Pre-execute Gate · deterministic · Pre-execute Gate › Intercept · all tools Pre-execute Gate deterministic all tools Soft Rules · prose · cache · Approval Waterfall › LLM verdict pipeline › Decide Soft Rules prose · cache Two-stage Classifier · filter → review · Approval Waterfall › LLM verdict pipeline › Execute · fail-closed Two-stage Classifier filter → review fail-closed Rejected · reshape or ask · Breaker & Human Fallback › Decide Rejected reshape or ask Circuit Breaker · human resumes · Breaker & Human Fallback › Execute · 3 / 20 DENY Circuit Breaker human resumes 3 / 20 DENY Fast Approve · zero-LLM approvals · Execution Path › Decide Fast Approve zero-LLM approvals Tool Executes · returns result · Execution Path › Execute Tool Executes returns result escalation intent deny regex cache miss verdict: allow DENY · fail-closed counts DENY Legend Agent logic Policy Tool action Cloud service

Deterministic layer

  • • Deny regexes hard-reject before any LLM call
  • • Allow prefix-globs approve with zero LLM cost
  • • Fast Approve = read-only tools, allow globs, in-tree ops
  • • Unmatched non-escalating calls pass through to the DSH sandbox

Fail-safe semantics

  • • Classifier timeout or parse error rejects the call (failClosed)
  • • Classifier failures never count toward the breaker
  • • 3 consecutive or 20 total DENY trips the breaker and pauses auto mode
  • • Any human decision resumes auto mode and resets counters

Cost control

  • • Most calls never reach the LLM classifier
  • • Stage 1 costs about one token; stage 2 runs only when flagged
  • • Identical actions reuse cached verdicts for 5 minutes
  • • Every decision lands in ~/.dsh/auto-mode/decisions.jsonl