agentleFS
d-o-hubd-o-hub/github-template-ai-agents/.agents/skills/agentic-abstention/SKILL.md

agentic-abstention

Skill2 starsChanged 11 days agoMITView on GitHub

Encode CONVOLVE-style stopping rules: decide when to stop acting instead of continuing tool calls on an infeasible task. Use this skill whenever an agent must determine if further execution is warranted. Not for general task planning (use goap-agent).

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When any rule fires, emit the following and halt:

    line 66
  2. Distinctive:

    Halt: Do NOT retry the failed action

    line 81
  3. Distinctive:

    Do not retry after a rule fires — the rule indicates futility

    line 85
  4. Distinctive:

    Do not bypass rules by rephrasing the same tool call

    line 86
  5. Distinctive:

    Do not ignore timeout because "almost done" — budget is absolute

    line 87
  6. Distinctive:

    Do not treat a single empty result as Rule 1 — requires 2+ repetitions

    line 88
  7. Very specific:

    Call 1: glob("missing.txt") → empty (no abstain)

    line 101
  8. Very specific:

    Call 2: glob("missing.txt") → empty (Rule 1 fires: 2+ empty results)

    line 102

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agentic Abstention

Decide when to stop acting instead of continuing tool calls on an infeasible task.

When to Use This Skill

  • Agent has made repeated tool calls with no progress
  • Task appears blocked by environment constraints
  • Resource errors indicate the goal is unreachable
  • Agent must decide between retrying and emitting ABSTAIN

Core Stopping Rules (CONVOLVE-derived)

Any single rule triggers mandatory abstention. All thresholds reference AGENTS.md named constants.

Rule 1: Empty-Result Repetition

Agent returns 2+ consecutive tool calls that yield identical empty or null results. A single empty result does NOT trigger abstention.

Check: result[N] == result[N-1] == empty (N ≥ 2)

Rule 2: Resource Unavailable

Target resource returns HTTP 404, connection refused, DNS resolution failure, or equivalent "does not exist" signal from the environment.

Check: Error code ∈ {404, 502, 503, ECONNREFUSED, ENOENT}

Rule 3: No-Progress Step Budget

Agent has taken ≥ DEFAULT_MAX_RETRIES (3) steps without measurable progress toward the goal. Progress is measured by state change in the task output.

Check: steps_since_last_progress ≥ DEFAULT_MAX_RETRIES

Rule 4: Infeasibility Signal

External system, user, or tool explicitly states the task cannot be completed (e.g., "not supported", "does not exist", "permission denied", "cannot be done").

Check: Output contains explicit infeasibility keyword

Rule 5: Timeout Budget Exceeded

Elapsed wall-clock time since task start exceeds DEFAULT_TIMEOUT_SECONDS (1800s). Agent must track start time at task initiation.

Check: now - task_start_time > DEFAULT_TIMEOUT_SECONDS

ABSTAIN Protocol

When any rule fires, emit the following and halt:

  1. Log: Record which rule triggered and relevant context
  2. Emit: Return structured ABSTAIN response:

    {
      "action": "ABSTAIN",
      "rule": "<rule-name>",
      "reason": "<brief explanation>",
      "steps_taken": <int>,
      "elapsed_seconds": <int>
    }
  3. Halt: Do NOT retry the failed action

What NOT to Do

  • Do not retry after a rule fires — the rule indicates futility
  • Do not bypass rules by rephrasing the same tool call
  • Do not ignore timeout because "almost done" — budget is absolute
  • Do not treat a single empty result as Rule 1 — requires 2+ repetitions

Integration with Existing AGENTS.md Constants

ConstantValueApplies to Rule
DEFAULT_MAX_RETRIES3Rule 3 (No-Progress Step Budget)
DEFAULT_TIMEOUT_SECONDS1800Rule 5 (Timeout Budget Exceeded)

Example Usage

Scenario: Agent searches for a file 3 times, each returning empty.

  1. Call 1: glob("missing.txt") → empty (no abstain)
  2. Call 2: glob("missing.txt") → empty (Rule 1 fires: 2+ empty results)
  3. Action: Emit ABSTAIN with rule: "empty-result-repetition"

Scenario: Agent calls API, receives 404.

  1. Call 1: GET /api/v1/resource/999 → 404
  2. Action: Emit ABSTAIN with rule: "resource-unavailable"

Rationalizations

RationalizationReality
"One more try might work"If a stopping rule fired, the evidence says it will not. Retrying wastes tokens.
"The timeout hasn't hit yet"Rules are independent — timeout is one of five triggers, not the only one.
"I'll rephrase and try again"Rephrasing the same infeasible request still wastes resources. Halt and report.

Red Flags

  • Continuing execution after any stopping rule fires
  • Treating first empty result as a stopping condition (Rule 1 requires 2+)
  • Ignoring explicit "cannot be completed" messages
  • Skipping ABSTAIN emission and silently failing

References

  • CONVOLVE stopping rules — origin of the 5-rule framework
  • AGENTS.md named constants — DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT_SECONDS

See Also

  • goap-agent — Task decomposition and planning
  • iterative-refinement — When to continue refining (opposite of abstention)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.