Repository navigation
fix(transport,harness): validate collect_metadata/parent_record_hash, bound SDK float-to-int by safe int, and reject duplicate JSON keys in harness (#286) - #291
Conversation
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed exact head 9e81cc380152ff2b2f01e35e5df706cb3fa58c0a in an isolated checkout.
The adapter refuses non-object metadata and empty supplied parent hashes, SDK float conversion is bounded to finite safe integers, and the hardware harness rejects ambiguous configuration/chain JSON before provider work. The focused adapter boundary control passes here and fails against the baseline adapter module. Valid adapter and harness software controls remain passing; this review does not claim hardware acceptance.
Independent validation in a fresh repository-hash-locked Python 3.12.10 environment: 780 tests passed, 16 skipped; pip check, configured Ruff, mypy, Bandit and diff whitespace checks passed. Commit sign-offs are present. Hosted CI and applicable independent maintainer/security gates remain separate prerequisites to merge.
Reviewed with OpenAI Codex.
9e81cc3 to
1889ce4
Compare
… bound SDK float-to-int by safe int, and reject duplicate JSON keys in harness (agentrust-io#286) Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed current head 2a0c45e478818b899285b2eab9f1faad05d46cba in an isolated checkout.
The adapter rejects non-object metadata and empty parent hashes, SDK integer normalization is limited to finite safe-integer values, and the hardware-harness JSON loader rejects duplicate members. This is software input/transport validation; I did not run a hardware acceptance session.
Fresh Python 3.12.10 validation: 836 passed, 16 skipped; Ruff, mypy and configured Bandit pass. The installed dependencies are consistent, and the PR commit carries a DCO sign-off. The required format check and whitespace check pass. Hosted CI and the required independent security approvals remain separate.
Reviewed with OpenAI Codex.
What
Validate
message_or_requestandmetadatamapping types and reject empty stringparent_record_hashina2a_adapter, boundmetadata_from_sdk_messagefloat-to-int conversion by RFC 8785 safe-integer limits (2**53 - 1), and reject duplicate JSON keys andNaN/Infinityinhardware_acceptance.Why
Closes #286.
Security impact
Prevents unhandled
AttributeError/TypeErroron malformed A2A envelopes, prevents lossy IEEE-754 floats>= 2**53in protobufStructmetadata from being coerced into imprecise integers, and closes duplicate-key JSON smuggling in the hardware acceptance harness.Test plan
pytestpasses (pytest tests/unit/test_hardware_acceptance.py tests/unit/test_a2a_adapter.py -q:27 passed, 1 skipped)ruff checkpasses (ruff check src tests/unit/test_hardware_acceptance.py:All checks passed!)mypypassesDCO sign-off
Developer Certificate of Origin (https://developercertificate.org).