Skip to content

feat(integrations): add WIMSE CTA MCP Guard (TRACE Level 0 record producer) - #429

Closed
drk-ram wants to merge 1 commit into
agentrust-io:mainfrom
drk-ram:feat/wimse-cta-mcp-guard
Closed

drk-ram wants to merge 1 commit into
agentrust-io:mainfrom
drk-ram:feat/wimse-cta-mcp-guard

Conversation

@drk-ram

@drk-ram drk-ram commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

What this adds

integrations/wimse-cta-mcp-guard/: a TRACE Level 0 record producer that gates an MCP tool call on session taint before dispatch, following the Context Taint Attestation (CTA) rules in draft-durga-wimse-ctx-isolation-00. Modeled on pic-standard-mcp-guard. Both cited drafts are individual Internet-Drafts with no formal IETF standing, and the README says so.

  • Session taint is sticky (TRUSTED_ONLY to UNTRUSTED_INGESTED); a caller-supplied TRUSTED_ONLY claim cannot lower it.
  • Tool mutability comes from the pinned declaration in the policy bytes, never from runtime readOnlyHint. Unknown tools are STATE_MUTATING.
  • A STATE_MUTATING call in an UNTRUSTED_INGESTED session is refused with CTA_TAINTED_CONTROL_PLANE before tool entry unless an Ed25519 StepUpReceipt (kid = sha256: + SHA-256 of the raw public key) bound to (session_id, request_id, tool_name, args_digest) verifies.
  • On allow, a detached cta-trace-bridge-v1 envelope is signed and verified before dispatch (bridge_signed -> bridge_verified -> tool_entered). The post-dispatch observation must name the same call. The record is built with agentrust_trace_adapters.build_record, signed with agentrust_trace.sign_record, and self-verified by cta_trace_verify.
  • Strict parsing: duplicate keys, non-finite numbers, boolean and float timestamps, private JWK members, and non-canonical base64url are refused.

Also in this PR: the conformance workflow (floating and hash-locked fixed jobs, same shape as pic-standard-mcp-guard), requirements/wimse-cta-mcp-guard-fixed.{in,txt}, and the regenerated README index row and marketplace/catalog.json.

tier: community.

Verified tier request

Requesting review and the Verified tier reproduction check (CONTRIBUTING.md, "Review process"). Exact reproduction, from the repository root of a fresh clone with Python 3.11:

python3 -m venv .venv
.venv/bin/python -m pip install --require-hashes -r requirements/wimse-cta-mcp-guard-fixed.txt
.venv/bin/python -m pip check
.venv/bin/python -m pip install --no-deps -e integrations/wimse-cta-mcp-guard
.venv/bin/python -m pip check
.venv/bin/python -m pytest integrations/wimse-cta-mcp-guard/tests -q \
  --cov=cta_trace_guard --cov=cta_trace_verify --cov-branch --cov-fail-under=100
.venv/bin/python integrations/wimse-cta-mcp-guard/examples/emit_record.py --out trust-record.json
.venv/bin/trace-tests verify --record trust-record.json --level 0

Expected: both pip check runs clean; 338 passed and Required test coverage of 100% reached; emit_record.py prints a blocked: line (code=CTA_TAINTED_CONTROL_PLANE ... tool_entered=False tool_calls=0 marker_intact=True), an allowed: line ending bridge_signed > bridge_verified > tool_entered > tool_returned > observation_verified > record_signed > record_verified, and wrote trust-record.json (status=record-emitted, taint=UNTRUSTED_INGESTED, basis=step-up-receipt); trace-tests reports Result: PASS (15 checks, 4 skipped). The lock pins agentrust-trace 0.11.0, agentrust-trace-adapters 0.2.0, agentrust-trace-tests 0.6.2.

What I ran

Windows, Python 3.11.9.

Check Result
Hash-locked install in a fresh venv, pip check before and after the editable install clean
pytest integrations/wimse-cta-mcp-guard/tests -q --cov=cta_trace_guard --cov=cta_trace_verify --cov-branch --cov-fail-under=100 (in that venv) 338 passed, 100% line and branch
python integrations/wimse-cta-mcp-guard/examples/emit_record.py --out trust-record.json exit 0, output as above
trace-tests verify --record trust-record.json --level 0 PASS (15 checks, 4 skipped)
ruff check integrations/wimse-cta-mcp-guard and the CI form with --target-version py39 --select E4,E7,E9,F all checks passed
scripts/validate_integrations.py 52 integration(s), 0 failure(s)
scripts/validate_compatibility.py 0 failure(s)
scripts/generate_marketplace_catalog.py --check, scripts/generate_integration_index.py --check current
tests/test_validate_integrations.py, test_composite_action_paths.py, test_workflow_oidc_permissions.py, test_integration_schema.py, test_validate_compatibility.py, test_test_evidence.py, test_generate_marketplace_catalog.py, test_generate_agt_marketplace_catalog.py 75 passed

I also broke seven invariants one at a time in a scratch copy (gate bypass, taint downgrade by claim, receipt replay, receipt argument binding, receipt-hash presence rule, boolean timestamps, unknown-tool default) and the suite failed each time.

Not run locally: Python 3.12 and 3.13 (the new workflow covers them), the GitHub Actions workflows themselves, actionlint, and the lychee link check. The lock was compiled with the command in its header through a package mirror that also emitted md5 hashes; I removed those, and the sha256 sets match pic-standard-mcp-guard-fixed.txt for every package version the two locks share.

What it does not claim

The README section "What it does NOT claim" is the full list. The main points: runtime.platform is software-only and this is Level 0 with deterministic TEST keys, no hardware attestation; the envelope is this integration's own detached JSON profile, not the draft's COSE_Sign1 or header wire format, and agentrust_trace.intent_bridge.verify_bridge refuses it; draft rule 3 (CONTEXT_MERKLE_BINDING), the MIXED_TAINT and QUARANTINED levels, and a context-reset boundary are not implemented; taint is reported to the guard, not observed by it; the receipt proves a signature by the pinned key, not who approved; state is process-local.

The draft names the refusal ERR_TAINTED_CONTROL_PLANE; this adapter's code is CTA_TAINTED_CONTROL_PLANE, and the README says so.

…roducer

Gates an MCP tool call on session taint before dispatch, following the Context Taint Attestation rules in draft-durga-wimse-ctx-isolation-00. Taint is sticky and a caller claim cannot lower it. Tool mutability comes from the pinned policy declaration, never from runtime annotations; unknown tools are STATE_MUTATING. A STATE_MUTATING call in an UNTRUSTED_INGESTED session is refused with CTA_TAINTED_CONTROL_PLANE before tool entry unless a policy-engine Ed25519 StepUpReceipt bound to (session_id, request_id, tool_name, args_digest) verifies.

On allow, a detached cta-trace-bridge-v1 envelope is signed and verified before dispatch. After dispatch the observation must name the same call. The Level 0 Trust Record is built with agentrust_trace_adapters.build_record, signed with agentrust_trace.sign_record, and self-verified by cta_trace_verify, which imports only agentrust_trace, rfc8785, cryptography, and the standard library. Parsing is strict: duplicate keys, non-finite numbers, boolean timestamps, private JWK members, and non-canonical base64url are refused.

Tests: 338 passed, 100% line and branch coverage of both modules. trace-tests verify --level 0 passes on the emitted record. Adds a conformance workflow with a hash-locked fixed job, the generated Marketplace catalog entry, and the README index row. tier: community.

Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
@drk-ram
drk-ram requested review from a team, carloshvp and imran-siddique as code owners November 20, 2026 07:27
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🔴 Contributor Check: HIGH

Check Result
Profile HIGH
Credential LOW
Overall HIGH

Automated check by AgenTrust Contributor Check.

@github-actions github-actions Bot added the needs-review:HIGH Contributor check flagged HIGH risk label Nov 20, 2026
@drk-ram

drk-ram commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Closing to keep the draft-durga-wimse-ctx-isolation reference adapter in its standalone corpus repository while the IETF draft is still an individual submission.

@drk-ram drk-ram closed this Nov 20, 2026
@drk-ram
drk-ram deleted the feat/wimse-cta-mcp-guard branch November 20, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review:HIGH Contributor check flagged HIGH risk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant