Skip to content

test(verify): reproduce malformed audit-bundle shape escapes - #597

Draft
altrudev wants to merge 2 commits into
agentrust-io:mainfrom
altrudev:fix/audit-bundle-shape-boundary-593
Draft

test(verify): reproduce malformed audit-bundle shape escapes#597
altrudev wants to merge 2 commits into
agentrust-io:mainfrom
altrudev:fix/audit-bundle-shape-boundary-593

Conversation

@altrudev

Copy link
Copy Markdown
Contributor

What

Executable reproducer for #593.

This draft adds a focused matrix for the public verify_audit_bundle() result boundary. It exercises malformed JSON container shapes in both the bundle itself and the optional claim-binding input.

The asserted invariant is intentionally narrow:

malformed external audit-bundle/claim structure returns a failed AuditBundleResult and does not leak a host-language exception.

Coverage

Bundle-side vectors:

  • entries as string, integer, boolean, or object;
  • entries containing string, integer, boolean, list, or null;
  • existing missing-entries failure preserved.

Optional claim-binding vectors:

  • malformed gateway;
  • malformed gateway.audit_chain;
  • malformed trace;
  • malformed trace.tool_transcript;
  • malformed trace.cnf / trace.cnf.jwk.

A one-entry bundle helper computes the actual entry hash, so claim-side shape failures are not hidden behind an unrelated bundle hash/link failure.

Baseline

Pinned to 2c0a601805bfb31fddc49db32ae122bae8e2251e.

Expected current result

The new vectors are expected to fail on current main where .items() / chained .get() calls consume malformed container types. This PR is therefore kept draft as a test-first reproducer until the narrow structural classification implementation is added.

No wire-format, evidence semantics, hash construction, or claim-verification precedence change is proposed.

AI-assistance disclosure: ChatGPT assisted with source triage, adversarial matrix design, and drafting. altrudev reviewed the bounded claim and remains responsible for the contribution.

…st-io#593)

Signed-off-by: altrudev <266135212+altrudev@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🟡 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 Aug 30, 2026
@imran-siddique

imran-siddique commented Aug 31, 2026

Copy link
Copy Markdown
Member

Batch response for this cluster is here: agentrust-io/agent-manifest#357 (comment)

Short version: the finding class is real and welcome. Your CI had never run, held under first-time-contributor gating, until I released 36 runs across your PRs an hour ago, and five of your eight are now red. Please fix those, sequence trace-spec#258 against #252 which touch the same two files, and tell me the order you want them reviewed in.

Copy link
Copy Markdown
Contributor Author

I reconciled the released CI failure here as well. Lint/type/security were already green; the red pytest step was the draft reproducer doing exactly what #593 reports: malformed bundle/claim containers escaped as TypeError / AttributeError.

At e7a41a4 the tests now xfail only when those known host-language exceptions escape. If verify_audit_bundle() returns an AuditBundleResult, the original verified == False / failures assertions run normally. Missing-entries remains an ordinary passing control.

That keeps this draft executable without treating a known-current defect as a general CI regression, and it does not pretend #593 is implemented. I am keeping #597 out of the review queue until the narrow structural implementation is ready. Fresh CI is currently waiting on workflow approval; no green claim yet.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

3 participants