Skip to content

Self-created skills lack mechanism-level guarantees for correctness and execution consistency #25833

Description

@fancpp

Problem: Self-created skills lack mechanism-level guarantees for correctness and execution consistency

Background

Hermes Agent has a powerful skill auto-creation loop — after complex or error-prone tasks, the agent can persist its approach as a reusable skill. This is one of the system's strongest differentiators.

However, the current mechanism has a structural defect: the agent is simultaneously the author, executor, and quality inspector of its own skills. There is no external validation point or consistency check, which creates several failure classes that prompt-level mitigations cannot fully address.

Related Prior Issues

Issue Focus Status
#6051 Auto-creation learns transient failures → persistent tool avoidance ("learned helplessness") ✅ Fixed (PR #23004) — prompt-level fix telling reviewer not to persist env-dependent failures
#416 No automated quality checks on create/edit (YAML linting, file existence) ❌ Open
#7816 Skill lifecycle: usage metadata, staleness, archival ⚡ Partially landed (Curator)
#16077 RFC: Curator — background skill maintenance ✅ Implemented

What Remains Unaddressed

The existing fixes share a common pattern: they are prompt-level or post-hoc mitigations, not mechanism-level guarantees.

  1. Skill auto-creation learns from transient failures, causing persistent tool avoidance (learned helplessness) #6051's fix is a prompt adjustment — it tells the background reviewer "don't capture transient failures." But it doesn't prevent the agent from encoding suboptimal approaches, incorrect workflows, or session-specific lucky paths as durable skills.

  2. There is no reproducibility check — When a skill is created, there is no automated step like "run this skill's instructions in an isolated context once to verify they produce the claimed result."

  3. There is no cross-session consistency guarantee — Running the same skill twice on the same input can produce different results (model temperature, context variation, tool availability), but there is no mechanism to detect, quantify, or flag this drift.

  4. Self-validation problem — The same model that writes a skill is also the sole judge of its correctness. Without an external validation step (e.g., secondary model review, isolated dry-run), blind spots are structurally invisible.

Proposed Design Directions

We should consider adding mechanism-level guardrails — not just better prompts:

1. Reproducibility Verification on Create

When a skill is created, if its instructions include a runnable workflow (commands, API calls, code), the system should:

  • Automatically execute it in an isolated context (or simulate a fresh session)
  • Compare actual output against the claimed behavior
  • Tag the skill as verified: true/false based on the outcome
  • Block or warn when verification fails

Scope: Only for skills with executable content. Pure knowledge/description skills would be exempt.

2. Consistency Metadata

Each skill should carry runtime metadata that anchors it to the execution context in which it was created:

# Proposed sidecar fields (in .usage.json or frontmatter, not just prompt text)
runtime:
  model_created: "claude-sonnet-4-20250514"
  model_version: "..."          # model hash / version if available
  execution_count: 0
  success_rate: 0.0             # % of recent runs that completed without error
  last_verified_with_model: "claude-sonnet-4-20250514"
  last_verified_at: null        # ISO timestamp of last successful re-verification
  consistency_score: null       # similarity score between 2+ runs of same task

This allows the system (and Curator) to make informed decisions:

  • A skill with success_rate: 0.3 gets lower priority in prompt injection
  • A skill from a different model version can be flagged for re-verification when the model changes
  • A skill never re-verified after creation can be tagged as experimental

3. Secondary-Review Gate

Before a newly created skill is persisted to ~/.hermes/skills/ and becomes discoverable, run a lightweight secondary review:

  • Parse any tool references and validate against the live tool registry (partial: #416)
  • Detect TODO, FIXME, placeholder values in the skill body
  • Flag skills whose instructions reference tools/endpoints that don't exist
  • Reject skills that encode negative claims about tool availability

This is a write-time gate, not a prompt tweak — a hard check before the skill enters the system.

4. Cross-Run Consistency Scoring (Optional / Advanced)

For skills that produce deterministic outputs (code generation, data transformation), periodically execute the same task twice and compare:

  • Output structure / schema
  • Error rate
  • Behavior differences

If divergence exceeds a threshold, downgrade the skill's confidence level or notify the user.

Why Prompt-Level Fixes Aren't Enough

The #6051 fix works for the specific case of "transient env failure → negative constraint." But it's a software patch on top of a structural gap:

  • Prompt instructions can drift, be overridden, or be ignored by future prompt changes
  • The reviewer model itself has no way to know whether its instructions are correct — it only knows what the prompt told it
  • The underlying mechanism (write skill → use skill → no re-validation) is unchanged

Mechanism-level fixes, by contrast, are:

  • Model-independent — they work regardless of which model writes or reviews the skill
  • Self-correcting — a verification failure is visible and actionable, not silently absorbed
  • Auditable — the system can report "skill X has never been verified" or "skill Y has inconsistent outputs"

Concrete Failure Scenario (Not Covered by Existing Fixes)

  1. User asks for "generate a data processing pipeline"
  2. Agent writes a pipeline that works in the current session but uses a deprecated API endpoint
  3. Agent creates skill data-pipeline-generator encoding the deprecated approach
  4. Two weeks later, user asks the same question
  5. Agent loads the skill, generates code with the now-broken API endpoint
  6. Failure — but no mechanism detects that the skill itself is the root cause

Without mechanism-level verification, this scenario is invisible to both the agent and the user.

Related

  • #10666 — Skill quality tiers (core / recommended / experimental). A verification_status field could feed directly into tier assignment.
  • #7816 — Curator lifecycle. Verification metadata would give the Curator concrete signals for consolidation and archival decisions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/agentCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointtool/skillsSkills system (list, view, manage)type/featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions