Skip to content

fix(trace): add missing agent_identity fields to the trace claim schema - #632

Merged
imran-siddique merged 2 commits into
agentrust-io:mainfrom
qubeena07:fix/trace-claim-agent-identity-schema-622
Sep 12, 2026
Merged

fix(trace): add missing agent_identity fields to the trace claim schema#632
imran-siddique merged 2 commits into
agentrust-io:mainfrom
qubeena07:fix/trace-claim-agent-identity-schema-622

Conversation

@qubeena07

Copy link
Copy Markdown
Collaborator

Closes #622.

gateway.agent_identity in schemas/trace-claim.schema.json declared 8 properties, while AgentIdentityOut (src/cmcp_runtime/audit/trace_claim.py:156) carries 11. The three missing ones, intent_hash, agent_key_thumbprint, and enforcement_mode, reach the signed claim whenever an Agent Manifest binding is configured. Since enforcement_mode defaults to enforcing and startup.py always supplies it, any deployment with a manifest binding was signing a claim that failed the project's own normative schema, a TRACE 001 violation.

imran-siddique confirmed the exact numbers and ruled on direction in the issue thread: fix the schema, not the code, since these three fields are real evidence rather than incidental plumbing. He also asked for a second part, a stated policy for what a verifier does when it meets claim members it does not recognize, since additionalProperties false on an evidence format that grows fields over time is the same problem tracked at agentrust io/trace spec#116, evidence outliving the verifiers that check it.

What this PR does

Adds intent_hash, agent_key_thumbprint, and enforcement_mode to gateway.agent_identity in the schema, matching the patterns and enum already used on the model and its sibling fields.

Adds a schema evolution paragraph to SPEC.md stating that additionalProperties false is a producer side authoring aid, not a contract external verifiers should enforce against a pinned older copy of the schema, and that a verifier should not reject a claim solely for carrying members it does not yet know. Cites trace spec#116 and names this issue as its first concrete instance in cmcp.

Updates the agent_identity field table and prose in docs/spec/session-policy.md so the docs describe all three fields, not just agent_key_thumbprint.

Adds a regression test in tests/unit/test_trace_claim.py that builds a claim with intent_hash and enforcement_mode set through generate_trace_claim and validates it against the schema. Confirmed it fails on the schema as it stood before this change and passes after.

Testing

Ran the full test suite, 1736 passed, 14 skipped. Three failures are present on main as well, unrelated to this change, all subprocess module resolution issues in a local editable install rather than anything to do with the schema or trace claim code. Ran ruff on the touched files, clean.

Closes agentrust-io#622. The gateway.agent_identity object in trace-claim.schema.json
declared 8 properties while AgentIdentityOut carries 11. The three missing
ones, intent_hash, agent_key_thumbprint, and enforcement_mode, reach the
signed claim whenever an Agent Manifest binding is configured, which is
the default once agent_manifest is set. Any such deployment was signing
a claim that failed its own normative schema, a violation of TRACE-001.

Adds the three properties to the schema, documents the schema evolution
policy in SPEC.md so future additions do not repeat this, updates the
agent_identity field table in session-policy.md, and adds a regression
test that builds a claim with all three fields set and validates it
against the schema. Verified the new test fails on the unmodified
schema and passes once the properties are added.
@qubeena07
qubeena07 requested review from a team, carloshvp and zohebk8s as code owners September 11, 2026 22:00
@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!

@rajnisht7

Copy link
Copy Markdown
Contributor

the regression test test_claim_schema_accepts_current_optional_fields covers intent_hash and enforcement_mode, but agent_key_thumbprint is not actually set in the test. As this change adds all three fields, can you also populate agent_key_thumbprint in the test

… subject

The regression test in this PR carries intent_hash and enforcement_mode but not
agent_key_thumbprint, so a third of the schema change had no coverage. Caught by
@rajnisht7 in review.

Adding it to the existing case would have pinned a combination the runtime is
documented never to emit: session/manager.py omits the thumbprint deliberately
because AgentManifestBinding carries no agent key bytes, and the schema says it
is only ever set when subject_source names a live-authenticated source, while
that test uses subject_source="config". So this is a sibling test with
subject_source="svid", which is the shape the schema must already accept on the
day agentrust-io#425 wires a real key source.

Verified in both directions: it fails against main's schema and passes against
this branch's.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X27MBo6tGVw1UmmchuGFnW

@imran-siddique imran-siddique 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.

Approving. Both halves of the #622 ruling are here: the three properties in schemas/trace-claim.schema.json, and the statement in docs/spec/session-policy.md that a verifier MUST NOT reject a claim solely for carrying members its own copy of the schema does not declare, with trace-spec#116 named as the general case. The second half is the part that stops this recurring for whoever pinned the old file.

@rajnisht7 was right that agent_key_thumbprint had no coverage, and I have pushed it as 77e94d0 rather than send this back for one line.

It needed a sibling test rather than an addition to the existing one, and the reason is worth recording. session/manager.py:385 omits the thumbprint deliberately, because AgentManifestBinding carries no agent key bytes yet, and the schema description says it is only ever set when subject_source names a live-authenticated source. The existing case uses subject_source="config", so setting the thumbprint there would have pinned a combination this runtime is documented never to emit. The new test uses subject_source="svid", which is the shape the schema has to accept on the day #425 wires a real key source.

Verified in both directions: it fails against main's schema and passes against this branch's. Full CI green on 77e94d0, including all six test matrix jobs and governance.

Merging.

@imran-siddique
imran-siddique merged commit 0db343a into agentrust-io:main Sep 12, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TRACE-001 is violated: claims carrying gateway.agent_identity fail the published schema

4 participants