Repository navigation
fix(trace-adapters): validate timestamps/counts, require bool signature_verified, and reject private JWKs in build_record (#375) - #380
Conversation
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed exact head ce90b47c25a0ab4ce60470557d4d59f941f91f9c in an isolated checkout.
The evidence/record builders now require literal boolean signature_verified, bounded integer timestamps/counts, public-only JWK inputs and integer ingestion times. The focused control passes here and fails with the baseline modules restored, including the package's public exports. All 128 adapter tests, pip check, the repository CI Ruff subset and diff whitespace checks passed in a fresh hash-locked adapter environment. This validates input/evidence handling, without independently certifying a source system's appraisal or provenance. No blocking finding in the changed paths; hosted checks and maintainer policy remain separate.
Reviewed with OpenAI Codex.
There was a problem hiding this comment.
the overall changes looks good, a few points needs to be addressed:
iat validation still accepts values below the TRACE schema floor.
Current check:
0 < iat <= 9_007_199_254_740_991but TRACE v0.2 schema + TrustRecord require:minimum: 1700000000
so build_record(..., iat=1) and iat=1699999999 succeed here but produce schema-invalid records. Same package already enforces 1_700_000_000 for ingested_at
align:
1_700_000_000 <= iat <= _MAX_SAFE_INTand add tests for the exact bounds (1699999999 reject, 1700000000 accept)
non-blocking: new tests use verifier="v" / policy_ref="p". schema marks both as format: uri not a regression vs current model behaviour, but an integration assert (appraisal_from_evidence -> drop into record -> TrustRecord.model_validate) will be good.
…re_verified, and reject private JWKs in build_record (agentrust-io#375) - Require literal bool signature_verified and bounded integer timestamp in AppraisalEvidence, and exact int ingested_at in SourceSystem. - Enforce TRACE v0.2 schema floor 1_700_000_000 <= iat <= _MAX_SAFE_INT, bounded integer tool_call_count, and public-only JWK without private key parameters in build_record. Closes agentrust-io#375 Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
|
@rajnisht7 @carloshvp Rebased onto
|
ce90b47 to
a6e2f8f
Compare
Closes #375
Summary
signature_verified is True, non-emptystrverifier/policy_ref, and positive RFC 8785 safeinttimestampinAppraisalEvidence.__post_init__.intingested_atinSourceSystem.__post_init__.iat(positive RFC 8785 safeint),tool_call_count(non-negative RFC 8785 safeint), and reject private/symmetric JWK parameters ("d","p","q","dp","dq","qi","oth","k") inbuild_record.packages/agentrust-trace-adapters/tests/test_appraisal.py.Validation
pytest packages/agentrust-trace-adapters/tests/test_appraisal.py packages/agentrust-trace-adapters/tests/test_builder.py -q— passed (34 passed)