Skip to content

New guardrail: Two-Failures Rule #212

Closed

Description

Summary

Add a concise guardrail heuristic: "If the same approach fails twice, stop and switch strategies."

Source

Extracted from the Codex compiler project's CLAUDE.md session rules (rule #8). Permission was granted by the author for semantic extraction.

Concept

"If the same approach fails twice, stop and switch strategies."

This is a decision-making heuristic that prevents a common AI agent antipattern: retrying the same failing approach with minor variations, consuming tool capacity and context window in a futile loop.

Why This Matters for Agents

AI agents have a strong tendency to:

  1. Try an approach
  2. See it fail
  3. Try the same approach with a small tweak
  4. See it fail again
  5. Try again with another small tweak
  6. Repeat until context window is exhausted

The two-failures rule provides a clear, memorable trigger to break this cycle. After two failures of the same approach, the agent must:

  • Reassess assumptions
  • Try a fundamentally different strategy
  • Ask the user for guidance
  • Or explicitly document why the approach cannot work

Integration Options

This could be:

  • A standalone micro-guardrail
  • A numbered rule in guardrails/operational-constraints
  • A phase in reasoning/root-cause-analysis (escalation trigger)

Value for PromptKit

Small but high-impact. Prevents the most common waste pattern in agent-assisted development. The rule is concise enough to remember and specific enough to enforce.

Proposed Component Type

  • Type: guardrails protocol (or addition to operational-constraints)
  • Category: guardrails/ (standalone or integrated)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions