Skip to content

fix(agent-manifest): wire runtime enforcement_mode into manifest verification - #584

Merged
imran-siddique merged 14 commits into
agentrust-io:mainfrom
rajnisht7:fix-576
Aug 27, 2026
Merged

fix(agent-manifest): wire runtime enforcement_mode into manifest verification#584
imran-siddique merged 14 commits into
agentrust-io:mainfrom
rajnisht7:fix-576

Conversation

@rajnisht7

@rajnisht7 rajnisht7 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What

Adds a runtime enforcement-mode cross-check to Agent Manifest binding verification. Previously only the policy_bundle hash was checked against the manifest in the runtime's actual enforcement mode (enforce / advisory / audit-only) and was never verified against what the manifest declares, so a runtime could silently run in a weaker mode than its manifest requires while still passing verification.

kindly merge this after agentrust-io/agent-manifest#345

Why

Fixes: #576

A manifest's policy_bundle can declare enforcement_mode: "enforce", but cMCP never checked the running instance was actually attested as being in that mode. Same approved policy bundle, same hash match, but the runtime could be configured for advisory (warn-only, doesn't block) or silent, and verify_agent_manifest_binding would still report success. This closes that gap: cMCP now passes its own config.attestation.enforcement_mode into the verification call (via a small mapping, since cMCP's own vocabulary enforcing / advisory / silent that doesn't match the Agent Manifest spec's enforce / advisory / audit-only), and a mismatch (or an unattested mode when the manifest requires one) now fails closed instead of passing silently.

Companion fix in agentrust-io/agent-manifest (adds the enforcement_mode field and cross-check to VerificationContext / verify_manifest this PR is the cMCP-side consumer of that).

Security impact

Yes. This touches capability/policy enforcement verification.

Test plan

  • pytest passes
  • ruff check passes
  • mypy passes
  • Manual test performed (describe steps below if applicable)

Executed:

pytest tests/unit/test_agent_manifest.py tests/unit/test_agent_manifest_cose.py -q
ruff check src/cmcp_runtime/agent_manifest.py src/cmcp_runtime/startup.py tests/unit/test_agent_manifest.py tests/unit/test_agent_manifest_cose.py
mypy src/cmcp_runtime/agent_manifest.py src/cmcp_runtime/startup.py

DCO sign-off

@rajnisht7
rajnisht7 requested a review from a team as a code owner August 26, 2026 22:10
Signed-off-by: rajnisht7 <rajnishtiwari9787@gmail.com>
@codecov-commenter

codecov-commenter commented Aug 26, 2026

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

rajnisht7 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

This PR depends upon agentrust-io/agent-manifest#345, tested locally against the patched SDK and confirmed CI turns fully green once that merges (verified the exact 2 failing tests pass, plus re-ran the full related test suite).

One more thing found while tracing this: src/cmcp_verify/verify.py's verify_trace_claim() also calls verify_agent_manifest_binding() ( the optional Agent Manifest binding cross-check) but doesn't pass enforcement_mode. It's safely wrapped in try/except ConfigError so nothing crashes, and no current test exercises a manifest with enforcement_mode declared through that path, so this PR's CI stays green but once agentrust-io/agent-manifest#345 ships, any manifest that declares enforcement_mode (which spec says is REQUIRED) will report agent_manifest.binding: unverified there, because there's currently no "claimed enforcement mode" recorded in AgentIdentityInfo/TRACE claims to check against. Happy to file a follow-up issue for that, or take a stab at it didn't want to fold it into this PR since it needs a claim-schema change (recording enforcement_mode at claim-creation time), which felt like separate scope.

@imran-siddique

Copy link
Copy Markdown
Member

One required release fix before approval: please change �gent-manifest>=0.11.1 to �gent-manifest>=0.11.2 in pyproject.toml. This PR passes �nforcement_mode= to VerificationContext, but 0.11.1 has no such field; leaving the old floor permits a metadata-valid install that fails on the new verification path. 0.11.2 is now published and contains agentrust-io/agent-manifest#345. Once that one-line floor update lands, I’ll re-review the refreshed green head and merge.

@imran-siddique

Copy link
Copy Markdown
Member

Correction to the formatting in my previous comment: change the dependency requirement from agent-manifest>=0.11.1 to agent-manifest>=0.11.2 in pyproject.toml. Version 0.11.2 is now published. This floor is required because VerificationContext(enforcement_mode=...) is not supported by 0.11.1.

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

Verified the enforcement-mode binding against agent-manifest 0.11.2. Local evidence: 1,492 passed, 8 skipped; Ruff clean; mypy clean across 65 source files. Dependency floor now matches the required SDK API and behavior.

@imran-siddique
imran-siddique merged commit de1d446 into agentrust-io:main Aug 27, 2026
12 of 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.

Agent Manifest binding does not cross-check cMCP enforcement_mode required by §6.2

3 participants