Skip to content

fix(telemetry): close tuple privacy bypass, reject array AgenTrust headers in TS propagation, and validate digests in TRACE finalization - #102

Open
drk-ram wants to merge 2 commits into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-telemetry-privacy-propagation-digest
Open

drk-ram wants to merge 2 commits into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-telemetry-privacy-propagation-digest

Conversation

@drk-ram

@drk-ram drk-ram commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

Closes #101

  • Walk (list, tuple) in _prohibited_paths, prohibited_paths, and _json_shape_error in src/agentrust_telemetry/validation.py and conformance/runner/validate.py, and reject duplicate JSON object keys via object_pairs_hook when loading JSON files.
  • Reject array-valued and non-string carrier headers with PropagationError in packages/typescript/src/propagation.ts, and check !== undefined instead of truthiness in ExtractedContext.eventFields, matching Python ^[xtract_context.
  • Validate �uild_digest / �uildDigest and policy �undle_digest (^Glgorithm and �alue) against canonical lowercase ^sha(256:[0-9a-f]{64}|384:[0-9a-f]{96})$ syntax in both src/agentrust_telemetry/trace_adapter.py and packages/typescript/src/trace-finalizer.ts before signing.

Contract impact

  • No wire-contract change
  • Backward-compatible contract change with fixtures
  • Breaking contract change with migration notes

Evidence

  • python tools/sync_schemas.py (passed)
  • python tools/check_schemas.py (passed: 8 bundled schemas match normative bytes)
  • python conformance/runner/validate.py (passed: all 18 conformance and appraisal fixtures pass)
  • python -m unittest discover -s tests -v (passed: 165 tests, 163 passed, 2 Ubuntu-only workflow tests skipped on Windows)
  • [x]
    pm --prefix packages/typescript run check (passed: 46 TypeScript tests passed, sc build and
    pm pack --dry-run succeeded)
  • python -m build (not run; �uild module not installed in local venv)

Privacy and security

  • No real prompts, source, credentials, personal data, or production identifiers added
  • New fields have capture semantics and privacy classification
  • Security-sensitive changes received maintainer review

Limits

Validates digest syntax and JSON/container shapes in Python and TypeScript SDKs; does not alter the JSON Schema wire contract or cryptographic verification semantics in ^Ggentrust-trace.

…S propagation, and validate digests in TRACE finalization

Closes agentrust-io#101

Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com>
Co-authored-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com>
@drk-ram
drk-ram requested review from a team and imran-siddique as code owners October 23, 2026 01:35
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🟡 Contributor Check: MEDIUM

Check Result
Profile MEDIUM
Credential LOW
Overall MEDIUM

Automated check by AgenTrust Contributor Check.

@github-actions github-actions Bot added the needs-review:MEDIUM Contributor check flagged MEDIUM risk label Oct 23, 2026

@dinakarjs dinakarjs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 4f42131 (full commit attached). Checked tuple traversal for privacy/JSON-shape checks, duplicate-member schema/fixture parsing, digest validation and TypeScript propagation/header refusal. With hash-locked Python test dependencies, all 165 unittest cases and conformance validation passed. TypeScript build passed and all 46 tests passed using node --import tsx --test test/*.test.ts (the tsx CLI IPC socket is unavailable here). The first Python run inherited a host 1% OTel sampler; clearing OTEL_TRACES_SAMPLER/ARG resolved the three sampling-dependent failures, which also reproduced on main. Hosted CI/CodeQL/fuzz are still action_required, so this is a source/local-test approval and does not claim hosted validation.

@rajnisht7 rajnisht7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the overall changes looks good, a few things needs to be addressed:

  • Digest tests - Python suite tests trailing newline (sha256:…\n). TS regex rejects it too, but the new test matrix doesn’t cover it, add the same case for both buildDigest and policy bundle_digest.
  • extractContext wording -The changelog/PR says “carrier headers”, but the code only validates the three AgenTrust headers (run-id, workflow-id, agent-id). OTel headers (traceparent etc.) are still passed through, matching Python, kindly narrow the wording to “AgenTrust carrier headers” so the claim matches the implementation.

…ildDigest and policy.bundle_digest

Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@drk-ram drk-ram changed the title fix(telemetry): close tuple privacy bypass, reject array headers in TS propagation, and validate digests in TRACE finalization fix(telemetry): close tuple privacy bypass, reject array AgenTrust headers in TS propagation, and validate digests in TRACE finalization Oct 25, 2026
@drk-ram

drk-ram commented Oct 25, 2026

Copy link
Copy Markdown
Author

Thanks @rajnisht7! Added trailing-newline (sha256:...\n) regression cases for both buildDigest and policy.bundle_digest in packages/typescript/test/trace-finalizer.test.ts, and narrowed the PR title and description wording to "AgenTrust carrier headers".

This branch has not been deployed

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

Labels

needs-review:MEDIUM Contributor check flagged MEDIUM risk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(telemetry): close tuple privacy bypass, reject array headers in TS propagation, and validate digests in TRACE finalization

3 participants