Skip to content

fix(security): enforce disabled toolsets after dynamic injection (#49386) - #70016

Closed
egilewski wants to merge 1 commit into
NousResearch:mainfrom
egilewski:codex/security-issue-49386
Closed

fix(security): enforce disabled toolsets after dynamic injection (#49386)#70016
egilewski wants to merge 1 commit into
NousResearch:mainfrom
egilewski:codex/security-issue-49386

Conversation

@egilewski

@egilewski egilewski commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fix dynamic toolset state by ensuring disabled tool sets remain locked after injection and prevent runtime re-enable pathways.
  • preserves existing behavior for enabled toolsets.

Root cause and behavior

Static registry filtering happened before memory-provider tools were injected or refreshed, so a disabled memory toolset could reappear in published schemas, dispatch ownership, and prompt guidance. Several entrypoints also failed to carry the disabled policy into late tool discovery.

Normalize toolset policy at each entrypoint and apply final subtraction to provider schemas, ownership, prompts, API discovery, and reload publication. Publish policy and tool snapshots atomically so concurrent or failed refreshes cannot restore stale provider capabilities, while preserving enabled provider tools, passive provider context, and generic dispatch for name collisions.

Validation

Focused owner-file validation passes 392 tests. The final full-suite run reached 36,123 passes before host /tmp exhaustion made later file-fixture results nondiagnostic; two earlier unrelated readiness assertions also failed. Ruff, byte-compilation, and diff checks pass. CodeRabbit's prior cycle was clean; the requested final cycle remained rate-limited after its retry.

The account owner loosely reviews Codex actions and receives the usual GitHub notifications.

Agent Disclosure

  • Created by: GPT-5.6-sol-xhigh in Codex
  • Human looked at and manually signed the commit

Fixes #49386
Related #46171

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/acp Agent Communication Protocol adapter comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery comp/tui Terminal UI (ui-tui/ + tui_gateway/) tool/mcp MCP client and OAuth tool/memory Memory tool and memory providers area/config Config system, migrations, profiles needs-decision Awaiting maintainer decision before any implementation sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related: #49386 and #30468 cover the disabled-toolset policy family. This PR extends enforcement into multiple runtime assembly and refresh paths, so a maintainer should review the unified policy and compatibility trade-offs.

…sResearch#49386)

Static registry filtering happened before memory-provider tools were injected
or refreshed, so a disabled memory toolset could reappear in published
schemas, dispatch ownership, and prompt guidance. Several entrypoints also
failed to carry the disabled policy into late tool discovery.

Normalize toolset policy at each entrypoint and apply final subtraction to
provider schemas, ownership, prompts, API discovery, and reload publication.
Publish policy and tool snapshots atomically so concurrent or failed refreshes
cannot restore stale provider capabilities, while preserving enabled provider
tools, passive provider context, and generic dispatch for name collisions.

Focused owner-file validation passes 392 tests. The final full-suite run
reached 36,123 passes before host /tmp exhaustion made later file-fixture
results nondiagnostic; two earlier unrelated readiness assertions also failed.
Ruff, byte-compilation, and diff checks pass. CodeRabbit's prior cycle was
clean; the requested final cycle remained rate-limited after its retry.

Fixes NousResearch#49386
Related NousResearch#46171
@egilewski
egilewski force-pushed the codex/security-issue-49386 branch from 05f708e to 6d6b244 Compare July 25, 2026 19:30
@egilewski

Copy link
Copy Markdown
Contributor Author

Closing this PR because the implementation grew beyond one comfortably reviewable unit. It combined disabled-policy propagation, snapshot-consistent dispatch and retry machinery, and unrelated test cleanup that should be reviewed independently.

The complete work has been preserved and is being split into focused PRs. The exact disabled_toolsets=["memory"] bypass reported in #49386 was already fixed by merged PR #69221; a replacement focused PR will address the remaining all / * global-alias bypass and close #49386.

Signed: GPT-5.6-sol-xhigh in Codex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/acp Agent Communication Protocol adapter comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery comp/tui Terminal UI (ui-tui/ + tui_gateway/) needs-decision Awaiting maintainer decision before any implementation P2 Medium — degraded but workaround exists sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state tool/mcp MCP client and OAuth tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security] Hermes Agent mainline tool policy bypass exposes external memory-provider tools despite disabled_toolsets=["memory"]

2 participants