fix: add usedforsecurity=False to hashlib calls in agent/ (FIPS compliance) - #65561
Open
AlexFucuson9 wants to merge 1 commit into
Open
fix: add usedforsecurity=False to hashlib calls in agent/ (FIPS compliance)#65561AlexFucuson9 wants to merge 1 commit into
AlexFucuson9 wants to merge 1 commit into
Conversation
…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
This was referenced Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
usedforsecurity=Falseto allhashlib.sha256/md5/sha1calls inagent/that were missing it.Problem
Python's
hashlibdefaultsusedforsecurity=True, which causes aValueErrorcrash on FIPS-compliant systems (RHEL 8+, Ubuntu FIPS mode, AWS GovCloud):Changes
11 call sites across 8 files:
agent/anthropic_adapter.py— PKCE challenge generationagent/tool_guardrails.py— tool input hashingagent/credential_persistence.py— credential fingerprintingagent/moa_loop.py— MoA cache signatureagent/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 keyagent/transports/codex_event_projector.py— event dedup keyRisk
None — all calls are for cache keys, fingerprints, or deduplication. None are used for security verification (signatures, HMAC, certificates).
usedforsecurity=Falseis a no-op on non-FIPS systems.