Skip to content

fix(guardrails): enable hard_stop_enabled by default - #26015

Open
zccyman wants to merge 1 commit into
NousResearch:mainfrom
atyou2happy:fix/25823-guardrails-hard-stop-default
Open

zccyman wants to merge 1 commit into
NousResearch:mainfrom
atyou2happy:fix/25823-guardrails-hard-stop-default

Conversation

@zccyman

@zccyman zccyman commented May 15, 2026

Copy link
Copy Markdown
Contributor

Problem

tool_loop_guardrails.hard_stop_enabled defaults to false. Guardrails detect retry loops (same failing command, same tool failure, idempotent no-progress) and inject warning text, but models frequently ignore text guidance and continue retrying until max_iterations (90). A single terminal failure loop can consume 90+ API calls doing nothing useful.

Fix

Change default from falsetrue in two locations:

  1. ToolCallGuardrailConfig.hard_stop_enabled dataclass default
  2. hermes_cli/config.py default config dict

Users who prefer unlimited retries can opt out via:

tool_loop_guardrails:
  hard_stop_enabled: false

Validation

Updated 3 existing tests that assumed hard_stop_enabled=False to explicitly pass hard_stop_enabled=False. Updated 1 test that asserted the default value. All 13 guardrail tests pass.

Closes #25823

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists labels May 15, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused guardrail coverage. Current main still has the warning-only default, so the underlying retry-cost report is real.

Problems

  • The global flip conflicts with the current documented design for interactive sessions: website/docs/user-guide/configuration.md:1344-1362 says warning-only is intentional for CLI/TUI and hard stops are an explicit unattended-deployment setting. agent/tool_guardrails.py:65-73 and hermes_cli/config.py:1394-1399 implement that same contract.
  • The diff changes that contract without updating website/docs/user-guide/configuration.md:1344-1362 or website/docs/user-guide/docker.md:73-82.
  • The updated tests cover the dataclass default, but not the production load_config()agent/agent_init.py:1307-1318 path or an explicit false opt-out.

Suggested changes

  • Resolve the global-versus-platform-specific behavior decision before salvage; related PR #49189 describes the platform-aware alternative.
  • If the global default is chosen, update both docs and add configuration-to-runtime coverage.

This is an automated hermes-sweeper review.

Comment thread agent/tool_guardrails.py

warnings_enabled: bool = True
hard_stop_enabled: bool = False
hard_stop_enabled: bool = True

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the documented interactive-session contract globally. Current main explicitly preserves warning-only CLI/TUI behavior and requires an opt-in for unattended deployments (website/docs/user-guide/configuration.md:1344-1362); please resolve that product decision and update the corresponding docs before changing this default.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-broad Sweeper blast radius: broad — a core path most sessions hit labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists sweeper:blast-broad Sweeper blast radius: broad — a core path most sessions hit sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: feat: enable tool_loop_guardrails hard_stop_enabled by default

3 participants