Skip to content

fix: add usedforsecurity=False to hashlib calls in agent/ (FIPS compliance) - #65561

Open
AlexFucuson9 wants to merge 1 commit into
NousResearch:mainfrom
AlexFucuson9:fix/hashlib-fips-agent-core
Open

fix: add usedforsecurity=False to hashlib calls in agent/ (FIPS compliance)#65561
AlexFucuson9 wants to merge 1 commit into
NousResearch:mainfrom
AlexFucuson9:fix/hashlib-fips-agent-core

Conversation

@AlexFucuson9

Copy link
Copy Markdown
Contributor

Summary

Add usedforsecurity=False to all hashlib.sha256/md5/sha1 calls in agent/ that were missing it.

Problem

Python's hashlib defaults usedforsecurity=True, which causes a ValueError crash on FIPS-compliant systems (RHEL 8+, Ubuntu FIPS mode, AWS GovCloud):

ValueError: [digital envelope routines] unsupported

Changes

11 call sites across 8 files:

  • agent/anthropic_adapter.py — PKCE challenge generation
  • agent/tool_guardrails.py — tool input hashing
  • agent/credential_persistence.py — credential fingerprinting
  • agent/moa_loop.py — MoA cache signature
  • agent/secret_sources/onepassword.py — env fingerprint (2 sites)
  • agent/secret_sources/bitwarden.py — file hash + token fingerprint (2 sites)
  • agent/transports/codex.py — request dedup key
  • agent/transports/codex_event_projector.py — event dedup key

Risk

None — all calls are for cache keys, fingerprints, or deduplication. None are used for security verification (signatures, HMAC, certificates). usedforsecurity=False is a no-op on non-FIPS systems.

…iance)

hashlib.md5/sha1/sha256 default to usedforsecurity=True which crashes
on FIPS-compliant systems (RHEL, Ubuntu FIPS mode). Add the flag to
all 11 call sites across 8 agent/ files.

Files: anthropic_adapter, tool_guardrails, credential_persistence,
moa_loop, onepassword, bitwarden, codex transport, codex_event_projector
@alt-glitch alt-glitch added type/security Security vulnerability or hardening comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint codex P3 Low — cosmetic, nice to have needs-decision Awaiting maintainer decision before any implementation sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 16, 2026
@teknium1 teknium1 added sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants