From 54daa739497ef9d429f0a91e90f546938adbbc42 Mon Sep 17 00:00:00 2001 From: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com> Date: Fri, 20 Nov 2026 01:26:22 -0600 Subject: [PATCH] feat(integrations): add WIMSE CTA MCP guard, a TRACE Level 0 record producer 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> --- .../wimse-cta-mcp-guard-conformance.yml | 123 +++ README.md | 1 + integrations/wimse-cta-mcp-guard/README.md | 259 ++++++ .../wimse-cta-mcp-guard/cta_trace_guard.py | 663 ++++++++++++++ .../wimse-cta-mcp-guard/cta_trace_verify.py | 647 ++++++++++++++ .../examples/emit_record.py | 233 +++++ .../wimse-cta-mcp-guard/integration.yaml | 41 + .../wimse-cta-mcp-guard/pyproject.toml | 33 + .../wimse-cta-mcp-guard/tests/conftest.py | 233 +++++ .../tests/test_cta_contract.py | 75 ++ .../tests/test_cta_import_independence.py | 22 + .../tests/test_cta_trace_guard.py | 830 ++++++++++++++++++ .../tests/test_cta_trace_verify.py | 573 ++++++++++++ marketplace/catalog.json | 27 +- requirements/wimse-cta-mcp-guard-fixed.in | 18 + requirements/wimse-cta-mcp-guard-fixed.txt | 674 ++++++++++++++ 16 files changed, 4451 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/wimse-cta-mcp-guard-conformance.yml create mode 100644 integrations/wimse-cta-mcp-guard/README.md create mode 100644 integrations/wimse-cta-mcp-guard/cta_trace_guard.py create mode 100644 integrations/wimse-cta-mcp-guard/cta_trace_verify.py create mode 100644 integrations/wimse-cta-mcp-guard/examples/emit_record.py create mode 100644 integrations/wimse-cta-mcp-guard/integration.yaml create mode 100644 integrations/wimse-cta-mcp-guard/pyproject.toml create mode 100644 integrations/wimse-cta-mcp-guard/tests/conftest.py create mode 100644 integrations/wimse-cta-mcp-guard/tests/test_cta_contract.py create mode 100644 integrations/wimse-cta-mcp-guard/tests/test_cta_import_independence.py create mode 100644 integrations/wimse-cta-mcp-guard/tests/test_cta_trace_guard.py create mode 100644 integrations/wimse-cta-mcp-guard/tests/test_cta_trace_verify.py create mode 100644 requirements/wimse-cta-mcp-guard-fixed.in create mode 100644 requirements/wimse-cta-mcp-guard-fixed.txt diff --git a/.github/workflows/wimse-cta-mcp-guard-conformance.yml b/.github/workflows/wimse-cta-mcp-guard-conformance.yml new file mode 100644 index 00000000..e8ed70c7 --- /dev/null +++ b/.github/workflows/wimse-cta-mcp-guard-conformance.yml @@ -0,0 +1,123 @@ +# WIMSE CTA MCP Guard conformance workflow. +# +# Two jobs: +# floating installs the integration against its declared lower bounds, so it +# resolves the latest compatible releases, as drift detection. +# fixed installs the exact hash-locked package set that reproduces the +# tested_against result, then asserts the three load-bearing versions +# and installs the integration with --no-deps. +# Both run the integration tests with line and branch coverage required at 100% +# for the two modules, emit a Level 0 Trust Record from a CTA-gated call, and +# verify it with trace-tests. The emitted record is JSON. +# Lives at repo root because GitHub Actions only discovers workflows there. +name: wimse-cta-mcp-guard conformance +on: + push: + paths: + - "integrations/wimse-cta-mcp-guard/**" + - "requirements/wimse-cta-mcp-guard-fixed.*" + - ".github/workflows/wimse-cta-mcp-guard-conformance.yml" + pull_request: + paths: + - "integrations/wimse-cta-mcp-guard/**" + - "requirements/wimse-cta-mcp-guard-fixed.*" + - ".github/workflows/wimse-cta-mcp-guard-conformance.yml" + schedule: + - cron: "0 6 * * 1" # weekly: catch drift against the latest released packages + workflow_dispatch: + +permissions: + contents: read + +jobs: + floating: + name: floating (latest releases, drift detection) + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + python: ["3.11", "3.12", "3.13"] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + with: + python-version: ${{ matrix.python }} + - name: Install this integration (declared lower bounds) + run: pip install -e "integrations/wimse-cta-mcp-guard[test,cov]" + - name: Check dependency consistency + run: python -m pip check + - name: Integration tests + run: >- + pytest integrations/wimse-cta-mcp-guard/tests -q + --cov=cta_trace_guard --cov=cta_trace_verify --cov-branch --cov-fail-under=100 + - name: Emit a record from a CTA-gated call + run: python integrations/wimse-cta-mcp-guard/examples/emit_record.py --out trust-record.json + - name: TRACE conformance + run: trace-tests verify --record trust-record.json --level 0 + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: floating-${{ matrix.os }}-py${{ matrix.python }} + path: trust-record.json + + fixed: + name: fixed (tested_against versions) + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + python: ["3.11", "3.12", "3.13"] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + with: + python-version: ${{ matrix.python }} + - name: Install the package set that reproduces the tested_against result + run: pip install --require-hashes -r requirements/wimse-cta-mcp-guard-fixed.txt + - name: Pinned versions match the three anchors and integration.yaml + run: | + python - <<'PY' + import re, sys + from importlib.metadata import version + want = { + "agentrust-trace": "0.11.0", + "agentrust-trace-adapters": "0.2.0", + "agentrust-trace-tests": "0.6.2", + } + y = open("integrations/wimse-cta-mcp-guard/integration.yaml").read() + declared = dict(re.findall(r'^ (agentrust-trace|agentrust-trace-tests): "([^"]+)"', y, re.M)) + have = {k: version(k) for k in want} + print("want", want) + print("have", have) + print("integration.yaml", declared) + ok = ( + have == want + and declared.get("agentrust-trace") == want["agentrust-trace"] + and declared.get("agentrust-trace-tests") == want["agentrust-trace-tests"] + ) + sys.exit(0 if ok else 1) + PY + - name: Install this integration + # --no-deps: every runtime and test dependency came from the lock above. + run: pip install --no-deps -e integrations/wimse-cta-mcp-guard + - name: Check dependency consistency + run: python -m pip check + - name: Integration tests + run: >- + pytest integrations/wimse-cta-mcp-guard/tests -q + --cov=cta_trace_guard --cov=cta_trace_verify --cov-branch --cov-fail-under=100 + - name: Emit a record from a CTA-gated call + run: python integrations/wimse-cta-mcp-guard/examples/emit_record.py --out trust-record.json + - name: TRACE conformance + run: trace-tests verify --record trust-record.json --level 0 + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: fixed-${{ matrix.os }}-py${{ matrix.python }} + path: trust-record.json diff --git a/README.md b/README.md index 24f06c62..7befff99 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ TRACE only works as a standard if it is genuinely neutral. Integrations are list | [WCM Key Release to TRACE](integrations/wcm-trace/) | agentrust-io | wcm, trace | community | | [WCM Triton Repository Staging](integrations/wcm-triton/) | agentrust-io | wcm | verified | | [WCM Serving Guard for vLLM](integrations/wcm-vllm/) | agentrust-io | wcm | verified | +| [WIMSE CTA MCP Guard](integrations/wimse-cta-mcp-guard/) | Agentic Security IETF Corpus | trace | community | | [xChk registry](integrations/xchk-registry/) | xChk | trace | community | | [agentrust-codex](plugins/agentrust-codex/) | agentrust-io | agent-manifest, trace | community | | [scheduled-agents](scheduled-agents/) | agentrust-io | trace | community | diff --git a/integrations/wimse-cta-mcp-guard/README.md b/integrations/wimse-cta-mcp-guard/README.md new file mode 100644 index 00000000..674d2622 --- /dev/null +++ b/integrations/wimse-cta-mcp-guard/README.md @@ -0,0 +1,259 @@ +# WIMSE CTA MCP Guard integration with TRACE + +Gates an MCP tool call on the taint of the session context before it dispatches, using the +Context Taint Attestation (CTA) rules in +[draft-durga-wimse-ctx-isolation-00](https://datatracker.ietf.org/doc/draft-durga-wimse-ctx-isolation/), +and emits a signed TRACE Level 0 Trust Record linked through a detached bridge. + +Both drafts cited here are individual Internet-Drafts: not endorsed by the IETF and with no +formal standing. They are the text this adapter follows, not a standard it conforms to. The +verification rules for canonical JSON, key identifiers, and timestamps come from +[draft-durga-agenttrust-trace-verification-01](https://datatracker.ietf.org/doc/draft-durga-agenttrust-trace-verification/). + +## How it works + +`CtaGuard.run` handles one tool call: + +1. **Session taint.** A session starts `TRUSTED_ONLY`. `ingest_untrusted(session_id)`, a call + to a tool whose pinned declaration says `output_trust: untrusted`, or a caller-supplied + `claimed_taint` of `UNTRUSTED_INGESTED` moves it to `UNTRUSTED_INGESTED`. Nothing moves it + back, and a caller-supplied `TRUSTED_ONLY` claim is ignored. +2. **Effect class.** `READ_ONLY` or `STATE_MUTATING` comes from the pinned declaration in the + policy bytes. Runtime annotations such as `readOnlyHint` are accepted and never read. A tool + with no declaration is `STATE_MUTATING` with untrusted output. +3. **Gate.** A `STATE_MUTATING` call in an `UNTRUSTED_INGESTED` session is refused with + `CTA_TAINTED_CONTROL_PLANE` before the tool is entered, unless a `StepUpReceipt` verifies. + The receipt is Ed25519-signed by the pinned policy-engine key (`kid` is + `sha256:` plus the SHA-256 of the raw public key) and bound to + `(session_id, request_id, tool_name, args_digest)`. +4. **Bridge.** On allow, the guard signs a detached `cta-trace-bridge-v1` envelope and verifies + it, in that order, before the tool is entered: + +```json +{ + "profile": "cta-trace-bridge-v1", + "authorization": { + "cta_version": "1.0", + "authorization_id": "urn:sha256:", + "decision": "allow", + "decision_basis": "read-only | trusted-context | step-up-receipt", + "authorizer": "", + "authorizer_key_id": "sha256:", + "authorized_at": 1795158233, + "expires_at": 1795158533, + "session_id": "", "request_id": "", "tool_name": "", + "tool_effect_class": "STATE_MUTATING", + "taint_lattice_level": "UNTRUSTED_INGESTED", + "args_digest": "sha256:", + "declaration_digest": "sha256:", + "tool_call_digest": "sha256:", + "step_up_receipt_hash": "sha256:" + }, + "signature": "" +} +``` + +5. **Observation and record.** After dispatch a caller-supplied observer returns a verdict and a + document that names the exact call (`request_id`, `tool_name`, `args_digest`, + `tool_call_count: 1`). Only `established` yields a record: the transcript preimage is hashed + into `tool_transcript.hash`, the record is built with + `agentrust_trace_adapters.build_record`, signed with `agentrust_trace.sign_record`, and + self-verified by `cta_trace_verify` before it is returned. + +The policy bytes the guard enforces are the bytes recorded in `policy.bundle_hash`. Example +(`step_up_key_id` is the `kid` of the policy-engine key the gate trusts): + +```json +{ + "profile": "cta-gate-policy/v1", + "step_up_key_id": "sha256:", + "tools": { + "delete_demo_marker": {"effect_class": "STATE_MUTATING", "output_trust": "trusted"}, + "read_inbox": {"effect_class": "READ_ONLY", "output_trust": "untrusted"} + } +} +``` + +Relationship to the drafts: + +| Draft rule | Where | +|---|---| +| wimse-ctx-isolation-00 section 4 rule 1, `TAINT_LATTICE_MONOTONICITY` (two of the four levels) | `CtaGuard.ingest_untrusted`, `_effective_taint` | +| wimse-ctx-isolation-00 section 4 rule 2, `CONFUSED_DEPUTY_FAIL_CLOSED` | `CtaGuard._check_step_up` | +| trace-verification-01 section 3, JCS and duplicate keys | `canonical_bytes`, `loads_unique` | +| trace-verification-01 section 4, canonical base64url and private JWK members | `b64url_decode`, `public_key_from_jwk` | +| trace-verification-01 section 6 item 3, `kid` derivation | `key_id` | +| trace-verification-01 section 6 item 5 and section 7, 60-second skew and integer timestamps | `verify_step_up_receipt`, `require_timestamp` | + +## Run it + +From the repository root: + +```bash +pip install -e "integrations/wimse-cta-mcp-guard[test,cov]" +pytest integrations/wimse-cta-mcp-guard/tests -q \ + --cov=cta_trace_guard --cov=cta_trace_verify --cov-branch --cov-fail-under=100 +python integrations/wimse-cta-mcp-guard/examples/emit_record.py --out trust-record.json +trace-tests verify --record trust-record.json --level 0 +``` + +`emit_record.py` runs one harmless tool (`delete_demo_marker`, operating only inside a fresh +temporary sandbox, declared `STATE_MUTATING`) in a session that has ingested untrusted data. The +first call carries a forged `TRUSTED_ONLY` claim and no receipt: it is refused before the tool is +entered, the tool runs zero times, and the marker file is untouched. The second call carries a +policy-engine `StepUpReceipt` bound to that call: the bridge is signed and verified, the tool +runs, the observer confirms the file is gone and the tool ran once, and a Level 0 Trust Record is +signed. The example then verifies the record from the file it wrote. All keys are deterministic +Ed25519 TEST keys. + +## Reproduce from the fixed lock + +This is the exact procedure for evaluating this integration. Runtime and test dependencies are +installed from the committed hash-locked requirements, and the integration is then installed with +`--no-deps`. + +From the repository root of a fresh clone, with Python 3.11 (CI also runs the same lock on +Python 3.12 and 3.13): + +```bash +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 +``` + +On Windows, create the environment with `py -3.11 -m venv .venv` and use `.venv\Scripts\` in +place of `.venv/bin/`. + +Expected: + +- both `pip check` runs report no broken requirements; +- pytest reports `338 passed` and `Required test coverage of 100% reached`; +- `emit_record.py` prints, in order, + `blocked: status=blocked code=CTA_TAINTED_CONTROL_PLANE reason=no_step_up_receipt tool_entered=False tool_calls=0 marker_intact=True`, + an `allowed:` line whose events end `bridge_signed > bridge_verified > tool_entered > tool_returned > observation_verified > record_signed > record_verified`, + a `verified from the written file:` line, and + `wrote trust-record.json (status=record-emitted, taint=UNTRUSTED_INGESTED, basis=step-up-receipt)`; +- `trace-tests verify` reports `Result: PASS (15 checks, 4 skipped)`. + +The fixed lock pins `agentrust-trace` 0.11.0, `agentrust-trace-adapters` 0.2.0, and +`agentrust-trace-tests` 0.6.2. All three are released on PyPI. + +## Before vs. After verification summary + +| | Before dispatch (the gate) | After dispatch (observation and record) | +|---|---|---| +| Checked | Pinned effect class, tracked session taint, the caller's claim (it can only raise taint), and for a tainted `STATE_MUTATING` call a `StepUpReceipt`: profile, signature by the pinned key, `kid`, window, session, request, tool, arguments, one use | Observer verdict is `established`; the observation names this request, tool, and `args_digest` and reports `tool_call_count` 1; `authorized_at <= observed_at <= iat` | +| Produced | A detached `cta-trace-bridge-v1`, signed then verified; recorded order `bridge_signed -> bridge_verified -> tool_entered` | `tool_transcript.hash` over the JCS transcript preimage; a Level 0 Trust Record, signed then self-verified | +| On failure | `precondition-failed`, `blocked`, `authorization-failed`, or an `adapter-error` raised before dispatch (for example an invalid clock value): the tool is not entered and no record is signed | `dispatch-error`, `observation-failed`, or an `adapter-error` from record finalization: the verified bridge is returned, no record | +| Relying party | `verify_authorization_artifacts` (bridge, and receipt if cited) | `verify_adapter_artifacts` (bridge, receipt, record, policy bytes, transcript) | + +| Scenario in an `UNTRUSTED_INGESTED` session | Result | +|---|---| +| `STATE_MUTATING`, no receipt | `blocked`, `CTA_TAINTED_CONTROL_PLANE`, tool not entered | +| `STATE_MUTATING`, `claimed_taint: TRUSTED_ONLY`, no receipt | Same; `taint_claim_ignored` is true | +| `STATE_MUTATING`, `runtime_annotations: {readOnlyHint: true}`, no receipt | Same; the pinned declaration decides | +| `STATE_MUTATING`, receipt bound to another session, request, tool, or arguments; expired; replayed; signed by another key | `blocked`, `CTA_TAINTED_CONTROL_PLANE`, tool not entered | +| `STATE_MUTATING`, valid receipt | Allowed with `decision_basis: step-up-receipt`; the bridge carries `step_up_receipt_hash` | +| `READ_ONLY`, no receipt | Allowed with `decision_basis: read-only` | +| Tool with no declaration | Treated as `STATE_MUTATING`: blocked without a receipt | + +## What is verified + +Each item is exercised by `tests/` (run the command above). + +- **Sticky taint.** Untrusted ingestion, untrusted tool output (including from a tool that + raised), and a claimed `UNTRUSTED_INGESTED` all raise a session to `UNTRUSTED_INGESTED`; no + code path lowers it; a forged `TRUSTED_ONLY` claim is ignored and reported. +- **Mutability comes from the pinned declaration.** A `readOnlyHint` in `runtime_annotations` + changes nothing in either direction; an unknown tool is `STATE_MUTATING` with untrusted + output. +- **Fail closed before tool entry.** A tainted `STATE_MUTATING` call without a verifying receipt + returns `CTA_TAINTED_CONTROL_PLANE`; the tool function is not called and no bridge is signed. +- **StepUpReceipt.** Refused when missing, expired, not yet valid (more than 60 seconds ahead), + windowed at 60 seconds or less or more than one hour, signed by another key, carrying another + key's `kid`, bound to a different session, request, tool, or arguments, malformed, replayed, or + carrying boolean or float timestamps. A spent receipt id is remembered until it expires, so + eviction of the request-id tombstone does not re-enable it. +- **Request ids are single use,** including ids of blocked calls; concurrent duplicates dispatch + once. +- **Order.** Spies on `sign_envelope`, `verify_bridge`, and the tool show + `bridge_signed -> bridge_verified -> tool_entered`. A bridge that expires, or a clock that steps + back, between signing and verification stops the call before dispatch. A clock value that is + boolean, not an integer, negative, below 1,700,000,000 (the TRACE schema minimum for `iat`), or + above 2^53 - 1 stops the call before dispatch. +- **Observation.** Contradicted, not-established, malformed, mismatched (request, tool, + arguments, call count other than 1, boolean or early `observed_at`), or erroring observations + emit no record and keep the verified bridge. +- **Strict encoding.** `loads_unique` rejects duplicate keys, `NaN`, `Infinity`, overflowing + numbers, invalid UTF-8, and runaway nesting; timestamps reject `bool` and floats; base64url + must be unpadded and canonical (a second spelling of the same bytes is refused); JWKs with any + of `d p q dp dq qi oth`, unsupported members, or a wrong `kid` are refused; arguments with no + RFC 8785 form are refused. +- **Forged but correctly signed artifacts are refused** by the verifier: a bridge whose basis + contradicts its taint and effect class, a wrong `authorization_id`, declaration, tool call, or + receipt digest; a record with a wrong reference, subject, policy hash, measurement, + transcript hash, or call count; a record signed by a key other than the pinned one. +- **Record.** `validate_json` passes; the signature verifies against the pinned key, not only + the embedded one; `origin.source_event_id` and exactly one `authorized-intent` reference carry + the `authorization_id` and the bridge's JCS digest; the `subject` `did:key` decodes to + `cnf.jwk.x`; `policy.bundle_hash` is the SHA-256 of the exact policy bytes and + `runtime.measurement` recomputes from `software_measurement`. Changing one policy byte changes + both. +- **Import independence.** `cta_trace_verify` loads without `agentrust_trace_adapters` or + `cta_trace_guard`. +- **100% line and branch coverage** of `cta_trace_guard.py` and `cta_trace_verify.py`. +- `trace-tests verify --level 0` passes on the emitted record (Ed25519 signature check against + the record's own `cnf.jwk`, plus the other Level 0 checks). + +## What it does NOT claim + +See rules 2 and 5 in [CONTRIBUTING.md](../../CONTRIBUTING.md). + +- **No hardware evidence.** `runtime.platform` is `software-only`. The deterministic test keys do + not chain to a trusted issuer and must never be used in production. +- **TRACE Level 0 only.** No Level 1 or Level 2 claim, and no independent operator: the + observation is a separate code path in the same workflow, not a separate trusted operator. +- **Not the draft's wire format.** There is no COSE_Sign1 object, no `Agent-Ctx-Isolation` or + `Agent-Step-Up-Receipt` header, and no `_meta.ctxIsolation` member. `cta-trace-bridge-v1`, + `cta-step-up-receipt-v1`, and the transcript profile are this integration's own detached JSON + profiles, not registered with TRACE or the IETF. `agentrust_trace.intent_bridge.verify_bridge` + accepts only the PIC profile and refuses this bridge; use `cta_trace_verify`. +- **Part of the draft only.** Section 4 rule 3, `CONTEXT_MERKLE_BINDING`, is not implemented, so + there is no `data_plane_merkle_root`, `system_prompt_digest`, or `parent_trace_ref`. The + lattice has two of the four levels (`MIXED_TAINT` and `QUARANTINED` are absent), `PRIVILEGED_ACTUATE` + is not an effect class, and there is no context-reset boundary: taint never clears for a + session id. The draft names the refusal `ERR_TAINTED_CONTROL_PLANE`; this adapter's code is + `CTA_TAINTED_CONTROL_PLANE`. +- **Taint is reported to the guard, not observed by it.** The guard cannot see what entered the + model's context. A host that never calls `ingest_untrusted`, and whose declarations mark tool + output `trusted`, leaves the session `TRUSTED_ONLY`. +- **The approver is not established.** The receipt proves a signature by the pinned key over + that exact call. `approver` is a self-asserted string; nothing here shows a human or an + independent policy engine decided, and this package does not issue receipts. +- **The bridge signature authenticates the adapter's own decision.** No external authority signs + the `authorization_id`; it is a content hash computed by the adapter. +- **A gate decision does not prove the tool was dispatched; dispatch does not prove it + succeeded; a filesystem observation does not prove a general real-world outcome.** Each is + checked separately and only within this synthetic workflow. +- **State is process-local.** Session taint, request-id tombstones (bounded, so eventually + evictable), and spent receipt ids are not shared across workers or kept across restarts. +- **No released TRACE successor artifact, no cMCP, no Agent Manifest.** The observation is + carried in the adapter's signed transcript. +- **The example's `model`, `data_class`, and `build_provenance` are fixed TEST values**; in a + real deployment they come from the governed run. +- **No standards status.** The drafts are individual submissions, not IETF consensus documents. + `tier: community` means structure checks pass, nothing more. + +## Conformance CI + +[`.github/workflows/wimse-cta-mcp-guard-conformance.yml`](../../.github/workflows/wimse-cta-mcp-guard-conformance.yml), +scoped to this directory, runs two jobs on Python 3.11 to 3.13. `fixed` pins the versions in +`integration.yaml` plus `agentrust-trace-adapters` 0.2.0. `floating` installs the latest releases +as drift detection. Each runs the tests with 100% coverage required, emits a record, and runs +`trace-tests verify --level 0`. diff --git a/integrations/wimse-cta-mcp-guard/cta_trace_guard.py b/integrations/wimse-cta-mcp-guard/cta_trace_guard.py new file mode 100644 index 00000000..aeda304e --- /dev/null +++ b/integrations/wimse-cta-mcp-guard/cta_trace_guard.py @@ -0,0 +1,663 @@ +"""WIMSE Context Taint Attestation (CTA) MCP guard: signed TRACE Level 0 Trust Records. + +Producer side. `CtaGuard.run` gates one tool call before it dispatches, then records +what happened: + +1. Session taint is sticky. `ingest_untrusted` (and any tool whose pinned declaration + says its output is untrusted) moves a session from `TRUSTED_ONLY` to + `UNTRUSTED_INGESTED`; nothing moves it back, and a caller-supplied taint claim can + only raise it. +2. Tool effect class comes from the pinned declaration in the policy bundle. Runtime + annotations such as `readOnlyHint` are accepted and never read. A tool with no + declaration is `STATE_MUTATING` with untrusted output. +3. A `STATE_MUTATING` call in an `UNTRUSTED_INGESTED` session is refused with + `CTA_TAINTED_CONTROL_PLANE` before the tool is entered, unless a policy-engine + `StepUpReceipt` bound to `(session_id, request_id, tool_name, args_digest)` verifies. +4. On allow, a detached `cta-trace-bridge-v1` bridge is signed and verified before + dispatch. After dispatch a caller-supplied observer returns a verdict; only + `established`, with a document that names this exact call, yields a Trust Record, + built with `agentrust_trace_adapters.build_record`, signed with + `agentrust_trace.sign_record`, and self-verified by `cta_trace_verify`. + +State is process-local. The guard does not persist anything; the caller writes the +returned artifacts. Imports `agentrust_trace` and `agentrust_trace_adapters`. +""" + +from __future__ import annotations + +import base64 +import json +import threading +import time +from collections import OrderedDict +from collections.abc import Callable, Mapping +from dataclasses import dataclass +from typing import Any + +from agentrust_trace import key_to_jwk, sign_record +from agentrust_trace_adapters import build_record +from agentrust_trace_adapters.evidence import PolicyEvidence, SourceSystem +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey +from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat +from cta_trace_verify import ( + BRIDGE_PROFILE, + BRIDGE_REFERENCE_REL, + CTA_VERSION, + DECLARATION_PROFILE, + EFFECT_CLASSES, + OUTPUT_TRUST_VALUES, + POLICY_PROFILE, + READ_ONLY, + SAFE_INT_MAX, + STATE_MUTATING, + TAINT_LEVELS, + TRUSTED_ONLY, + UNTRUSTED_INGESTED, + CtaVerifyError, + authorization_id_for, + build_transcript, + canonical_bytes, + digest_jcs, + expected_basis, + key_id, + loads_unique, + public_key_from_jwk, + require_digest, + require_identifier, + require_timestamp, + signing_preimage, + verify_adapter_artifacts, + verify_bridge, + verify_observation, + verify_step_up_receipt, +) + +_B58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" +_DEFAULT_MAX_TRANSCRIPT_BYTES = 262144 +_MIN_PLAUSIBLE_TIMESTAMP = 1_700_000_000 # the TRACE v0.2 schema minimum for iat +_OBSERVATION_VERDICTS = ("established", "contradicted", "not-established") + +Clock = Callable[[], int] +ObserveFn = Callable[[Any], "Observation"] + + +class CtaGuardError(RuntimeError): + """A configuration, policy, or internal fail-closed condition.""" + + +class _Stop(Exception): + """Internal: end a run with a no-record outcome.""" + + def __init__(self, status: str, code: str, reason: str, detail: str | None = None) -> None: + super().__init__(reason) + self.status = status + self.code = code + self.reason = reason + self.detail = detail + + +@dataclass(frozen=True) +class ToolDeclaration: + """A pinned tool declaration. `effect_class` is what the gate enforces.""" + + tool: str + effect_class: str + output_trust: str + + def to_dict(self) -> dict: + return { + "profile": DECLARATION_PROFILE, + "tool": self.tool, + "effect_class": self.effect_class, + "output_trust": self.output_trust, + } + + +@dataclass(frozen=True) +class GatePolicy: + step_up_key_id: str + tools: Mapping[str, ToolDeclaration] + + +def _exact_fields(obj: Any, fields: tuple, name: str) -> None: + if not isinstance(obj, dict) or set(obj) != set(fields): + raise CtaVerifyError(f"{name} must have exactly the fields {sorted(fields)}") + + +def load_policy(policy_bundle: bytes) -> GatePolicy: + """Parse the exact policy bytes the guard enforces and records. + + The bundle is a strict JSON object (duplicate keys and non-finite numbers refused): + `{"profile": "cta-gate-policy/v1", "step_up_key_id": "sha256:", "tools": + {: {"effect_class": "READ_ONLY"|"STATE_MUTATING", "output_trust": + "trusted"|"untrusted"}}}`. Raises `CtaGuardError` on anything else. + """ + if not isinstance(policy_bundle, bytes) or not policy_bundle: + raise CtaGuardError("policy_bundle must be non-empty bytes") + try: + obj = loads_unique(policy_bundle) + _exact_fields(obj, ("profile", "step_up_key_id", "tools"), "policy bundle") + if obj["profile"] != POLICY_PROFILE: + raise CtaVerifyError("unknown policy profile") + require_digest(obj["step_up_key_id"], "step_up_key_id") + if not isinstance(obj["tools"], dict): + raise CtaVerifyError("tools must be an object") + tools: dict[str, ToolDeclaration] = {} + for name, entry in obj["tools"].items(): + require_identifier(name, "tool name") + _exact_fields(entry, ("effect_class", "output_trust"), f"tool entry {name}") + if entry["effect_class"] not in EFFECT_CLASSES: + raise CtaVerifyError("tool effect_class is not a known effect class") + if entry["output_trust"] not in OUTPUT_TRUST_VALUES: + raise CtaVerifyError("tool output_trust is not a known value") + tools[name] = ToolDeclaration(name, entry["effect_class"], entry["output_trust"]) + except CtaVerifyError as exc: + raise CtaGuardError(f"invalid policy bundle: {exc}") from exc + return GatePolicy(step_up_key_id=obj["step_up_key_id"], tools=tools) + + +@dataclass(frozen=True) +class Observation: + """A caller-supplied post-dispatch observation. + + `document` is `{"observation": {...}, "observer": str, "observed_at": int}` and its + inner object must name the call (`request_id`, `tool_name`, `args_digest`) and carry + `tool_call_count == 1`. `response_projection` is bound into the transcript instead + of the raw tool return value. + """ + + verdict: str + document: Mapping[str, Any] + response_projection: Any + + +@dataclass(frozen=True) +class AuthorizationArtifacts: + """The verified pre-dispatch authorization; retained even when no record is emitted.""" + + bridge: dict + declaration: dict + tool_call: dict + authorizer_jwk: dict + step_up_receipt: dict | None = None + policy_engine_jwk: dict | None = None + + +@dataclass(frozen=True) +class RecordArtifacts: + authorization: AuthorizationArtifacts + transcript: dict + record: dict + + +@dataclass(frozen=True) +class CtaOutcome: + """The result of one `CtaGuard.run`. + + `status` is one of `precondition-failed`, `blocked`, `authorization-failed`, + `dispatch-error`, `observation-failed`, `adapter-error`, `record-emitted`. `events` + is the guard's own ordered log. `result` is the raw tool return value: it is not + signed and not guaranteed immutable. + """ + + status: str + code: str | None + reason: str | None + taint: str | None + effect_class: str | None + tool_entered: bool + events: tuple + result: Any = None + detail: str | None = None + taint_claim_ignored: bool = False + authorization: AuthorizationArtifacts | None = None + record_artifacts: RecordArtifacts | None = None + + +@dataclass(frozen=True) +class CtaConfig: + """Explicit inputs; no value is invented. + + `policy_engine_jwk` is the public key whose signatures on a StepUpReceipt the gate + accepts; its `kid` must equal the `step_up_key_id` inside `policy_bundle`, so the + recorded policy bytes commit to which approver key was trusted. The bridge, record, + and policy-engine keys must be pairwise distinct. + """ + + authorizer: str + bridge_key: Ed25519PrivateKey + record_key: Ed25519PrivateKey + policy_engine_jwk: Mapping[str, Any] + policy_bundle: bytes + model_provider: str + model_id: str + data_class: str + workload_digest: str + resolver: str + bridge_validity_seconds: int = 300 + max_transcript_bytes: int = _DEFAULT_MAX_TRANSCRIPT_BYTES + tombstone_capacity: int = 4096 + + +def _positive_int(value: Any, name: str) -> int: + if not isinstance(value, int) or isinstance(value, bool) or value <= 0: + raise CtaGuardError(f"{name} must be a positive integer") + return value + + +def _nonempty(value: Any, name: str) -> str: + if not isinstance(value, str) or not value.strip(): + raise CtaGuardError(f"{name} must be a non-empty string") + return value + + +def _snapshot(value: Any) -> Any: + """A detached, RFC 8785-canonical copy of a JSON value.""" + return json.loads(canonical_bytes(value)) + + +def _is_identifier(value: Any) -> bool: + try: + require_identifier(value, "value") + except CtaVerifyError: + return False + return True + + +def _raw_public(key: Ed25519PrivateKey) -> bytes: + return key.public_key().public_bytes(Encoding.Raw, PublicFormat.Raw) + + +def _base58btc(data: bytes) -> str: + n = int.from_bytes(data, "big") + out = "" + while n: + n, r = divmod(n, 58) + out = _B58[r] + out + return "1" * (len(data) - len(data.lstrip(b"\0"))) + out + + +def did_key(key: Ed25519PrivateKey) -> str: + """did:key for an Ed25519 key: multicodec 0xed01 + raw key, base58btc, 'z'.""" + return "did:key:z" + _base58btc(b"\xed\x01" + _raw_public(key)) + + +def sign_envelope(profile: str, field: str, body: Mapping[str, Any], key: Ed25519PrivateKey) -> dict: + """`{"profile", field: body, "signature"}` signed over `signing_preimage`.""" + signature = base64.urlsafe_b64encode(key.sign(signing_preimage(profile, field, dict(body)))) + return {"profile": profile, field: _snapshot(dict(body)), "signature": signature.rstrip(b"=").decode("ascii")} + + +class _RequestStore: + """Request ids are single-use: active ones and a bounded set of recent ones are refused. + + Tombstones are bounded, so eviction eventually allows an id to be reused; durable + uniqueness across workers or restarts needs a shared persistent store. + """ + + def __init__(self, capacity: int) -> None: + self._lock = threading.Lock() + self._active: set[str] = set() + self._tombstones: OrderedDict[str, None] = OrderedDict() + self._capacity = capacity + + def reserve(self, request_id: str) -> bool: + with self._lock: + if request_id in self._active or request_id in self._tombstones: + return False + self._active.add(request_id) + return True + + def finish(self, request_id: str) -> None: + with self._lock: + self._active.discard(request_id) + self._tombstones[request_id] = None + while len(self._tombstones) > self._capacity: + self._tombstones.popitem(last=False) + + +class _ReceiptLedger: + """Verified receipt ids are spent until they expire, independent of request-id eviction.""" + + def __init__(self) -> None: + self._lock = threading.Lock() + self._spent: dict[str, int] = {} + + def spend(self, receipt_id: str, exp: int, now: int) -> bool: + with self._lock: + for old in [r for r, e in self._spent.items() if e <= now]: + del self._spent[old] + if receipt_id in self._spent: + return False + self._spent[receipt_id] = exp + return True + + +class _RunState: + def __init__(self) -> None: + self.events: list[str] = [] + self.taint: str | None = None + self.effect_class: str | None = None + self.tool_entered = False + self.claim_ignored = False + self.result: Any = None + self.authorization: AuthorizationArtifacts | None = None + + def outcome( + self, status: str, code: str | None, reason: str | None, detail: str | None = None, + record_artifacts: RecordArtifacts | None = None, + ) -> CtaOutcome: + return CtaOutcome( + status=status, code=code, reason=reason, taint=self.taint, effect_class=self.effect_class, + tool_entered=self.tool_entered, events=tuple(self.events), result=self.result, + detail=detail, taint_claim_ignored=self.claim_ignored, + authorization=self.authorization, record_artifacts=record_artifacts, + ) + + +class CtaGuard: + def __init__(self, config: CtaConfig, *, clock: Clock | None = None) -> None: + self._policy = load_policy(config.policy_bundle) + try: + if not isinstance(config.bridge_key, Ed25519PrivateKey) or not isinstance(config.record_key, Ed25519PrivateKey): + raise CtaGuardError("bridge_key and record_key must be Ed25519PrivateKey") + _positive_int(config.bridge_validity_seconds, "bridge_validity_seconds") + _positive_int(config.max_transcript_bytes, "max_transcript_bytes") + _positive_int(config.tombstone_capacity, "tombstone_capacity") + for name in ("model_provider", "model_id", "data_class"): + _nonempty(getattr(config, name), name) + require_identifier(config.authorizer, "authorizer") + require_identifier(config.resolver, "resolver") + require_digest(config.workload_digest, "workload_digest") + _, policy_raw = public_key_from_jwk(config.policy_engine_jwk) + except CtaVerifyError as exc: + raise CtaGuardError(f"invalid configuration: {exc}") from exc + if key_id(policy_raw) != self._policy.step_up_key_id: + raise CtaGuardError("policy_engine_jwk is not the step_up_key_id pinned in the policy bundle") + raws = {_raw_public(config.bridge_key), _raw_public(config.record_key), policy_raw} + if len(raws) != 3: + raise CtaGuardError("bridge, record, and policy-engine keys must be pairwise distinct") + + self._cfg = config + self._policy_bundle = config.policy_bundle + self._authorizer_jwk = {**key_to_jwk(config.bridge_key), "kid": key_id(_raw_public(config.bridge_key))} + self._record_jwk = key_to_jwk(config.record_key) + self._policy_jwk = {**config.policy_engine_jwk} + self._subject = did_key(config.record_key) + self._clock: Clock = clock or (lambda: int(time.time())) + self._lock = threading.Lock() + self._sessions: dict[str, str] = {} + self._requests = _RequestStore(config.tombstone_capacity) + self._receipts = _ReceiptLedger() + + @property + def authorizer_jwk(self) -> dict: + """The public bridge-verification key, with its `kid`.""" + return dict(self._authorizer_jwk) + + @property + def record_jwk(self) -> dict: + """The public record-verification key.""" + return dict(self._record_jwk) + + def ingest_untrusted(self, session_id: str) -> str: + """Record that the session ingested untrusted data. Sticky; returns the new level.""" + if not _is_identifier(session_id): + raise CtaGuardError("session_id must be 1-512 printable ASCII characters without whitespace") + return self._mark_untrusted(session_id) + + def taint_level(self, session_id: str) -> str: + """The session's tracked level; a session never seen is `TRUSTED_ONLY`.""" + with self._lock: + return self._sessions.get(session_id, TRUSTED_ONLY) + + def declaration_for(self, tool_name: str) -> ToolDeclaration: + """The pinned declaration; a tool without one is `STATE_MUTATING`, untrusted output.""" + return self._policy.tools.get(tool_name) or ToolDeclaration(tool_name, STATE_MUTATING, "untrusted") + + def _mark_untrusted(self, session_id: str) -> str: + with self._lock: + self._sessions[session_id] = UNTRUSTED_INGESTED + return UNTRUSTED_INGESTED + + def _effective_taint(self, session_id: str, claimed: str | None) -> tuple[str, bool]: + with self._lock: + level = self._sessions.get(session_id, TRUSTED_ONLY) + if claimed == UNTRUSTED_INGESTED: + level = UNTRUSTED_INGESTED + self._sessions[session_id] = level + return level, claimed == TRUSTED_ONLY and level == UNTRUSTED_INGESTED + + def _now(self) -> int: + now = require_timestamp(self._clock(), "clock value") + if now < _MIN_PLAUSIBLE_TIMESTAMP: + raise CtaGuardError("clock value precedes the TRACE schema minimum for iat") + return now + + def run( + self, + *, + session_id: str, + request_id: str, + tool_name: str, + tool_fn: Callable[..., Any], + arguments: Mapping[str, Any], + observe: ObserveFn, + step_up_receipt: Any = None, + claimed_taint: str | None = None, + runtime_annotations: Mapping[str, Any] | None = None, + ) -> CtaOutcome: + """Gate, dispatch, observe, and record one tool call; never raises for a bad call. + + `claimed_taint` models a caller-supplied taint claim: it can raise the session to + `UNTRUSTED_INGESTED` and can never lower it. `runtime_annotations` (for example a + server's `readOnlyHint`) is accepted so a host can pass tool metadata through; it + is never read. `step_up_receipt` is read only when the gate requires one. + """ + st = _RunState() + reason = self._precondition_failure( + session_id, request_id, tool_name, tool_fn, arguments, observe, claimed_taint, + ) + if reason is not None: + return st.outcome("precondition-failed", "CTA_BAD_REQUEST", reason) + if not self._requests.reserve(request_id): + return st.outcome("precondition-failed", "CTA_REQUEST_ID_REUSED", "request_id_reused") + st.events.append("request_reserved") + try: + return self._run_reserved( + st, session_id, request_id, tool_name, tool_fn, _snapshot(dict(arguments)), + observe, step_up_receipt, claimed_taint, + ) + except _Stop as stop: + return st.outcome(stop.status, stop.code, stop.reason, stop.detail) + except Exception: # noqa: BLE001 - fail closed; never emit a record on error + return st.outcome("adapter-error", "CTA_ADAPTER_ERROR", "adapter_error") + finally: + self._requests.finish(request_id) + + @staticmethod + def _precondition_failure( + session_id: Any, request_id: Any, tool_name: Any, tool_fn: Any, arguments: Any, + observe: Any, claimed_taint: Any, + ) -> str | None: + for name, value in (("session_id", session_id), ("request_id", request_id), ("tool_name", tool_name)): + if not _is_identifier(value): + return "bad_" + name + if not isinstance(arguments, Mapping): + return "bad_arguments" + try: + _snapshot(dict(arguments)) + except CtaVerifyError: + return "bad_arguments" + if not callable(tool_fn) or not callable(observe): + return "bad_callable" + if claimed_taint is not None and claimed_taint not in TAINT_LEVELS: + return "bad_taint_claim" + return None + + def _run_reserved( + self, st: _RunState, session_id: str, request_id: str, tool_name: str, + tool_fn: Callable[..., Any], args: dict, observe: ObserveFn, receipt: Any, + claimed_taint: str | None, + ) -> CtaOutcome: + cfg = self._cfg + declaration = self.declaration_for(tool_name) + st.effect_class = declaration.effect_class + st.taint, st.claim_ignored = self._effective_taint(session_id, claimed_taint) + st.events.append("taint_evaluated") + args_digest = digest_jcs(args) + + receipt_info = None + if declaration.effect_class != READ_ONLY and st.taint != TRUSTED_ONLY: + receipt_info = self._check_step_up(st, receipt, session_id, request_id, tool_name, args_digest) + + call = {"name": tool_name, "arguments": args} + decl_dict = declaration.to_dict() + authorized_at = self._now() + expires_at = authorized_at + cfg.bridge_validity_seconds + if expires_at > SAFE_INT_MAX: + raise CtaGuardError("bridge expiry out of range") + authorization: dict[str, Any] = { + "cta_version": CTA_VERSION, + "decision": "allow", + "decision_basis": expected_basis(declaration.effect_class, st.taint), + "session_id": session_id, + "request_id": request_id, + "tool_name": tool_name, + "tool_effect_class": declaration.effect_class, + "taint_lattice_level": st.taint, + "args_digest": args_digest, + "declaration_digest": digest_jcs(decl_dict), + "tool_call_digest": digest_jcs(call), + } + if receipt_info is not None: + authorization["step_up_receipt_hash"] = receipt_info["digest"] + authorization["authorization_id"] = authorization_id_for(authorization) + authorization.update( + authorizer=cfg.authorizer, authorizer_key_id=self._authorizer_jwk["kid"], + authorized_at=authorized_at, expires_at=expires_at, + ) + bridge = sign_envelope(BRIDGE_PROFILE, "authorization", authorization, cfg.bridge_key) + st.events.append("bridge_signed") + try: + verify_bridge( + bridge, authorizer_jwk=self._authorizer_jwk, declaration=decl_dict, tool_call=call, + now=self._now(), + ) + except CtaVerifyError as exc: + raise _Stop("authorization-failed", "CTA_AUTHORIZATION_FAILED", "bridge_verification_failed", str(exc)) from exc + st.events.append("bridge_verified") + st.authorization = AuthorizationArtifacts( + bridge=_snapshot(bridge), declaration=decl_dict, tool_call=_snapshot(call), + authorizer_jwk=dict(self._authorizer_jwk), + step_up_receipt=_snapshot(receipt_info["envelope"]) if receipt_info else None, + policy_engine_jwk=dict(self._policy_jwk) if receipt_info else None, + ) + + st.events.append("tool_entered") + st.tool_entered = True + try: + st.result = tool_fn(**_snapshot(args)) + except Exception as exc: + if declaration.output_trust == "untrusted": + self._mark_untrusted(session_id) + st.events.append("tool_raised") + raise _Stop("dispatch-error", "CTA_DISPATCH_ERROR", "tool_raised") from exc + if declaration.output_trust == "untrusted": + self._mark_untrusted(session_id) + st.events.append("tool_returned") + + observation = self._observe(st, observe, authorization) + try: + artifacts = self._finalize(st, authorization, bridge, decl_dict, call, receipt_info, observation) + except Exception as exc: + raise _Stop("adapter-error", "CTA_ADAPTER_ERROR", "finalization_failed") from exc + return st.outcome("record-emitted", None, None, record_artifacts=artifacts) + + def _check_step_up( + self, st: _RunState, receipt: Any, session_id: str, request_id: str, tool_name: str, + args_digest: str, + ) -> dict: + if receipt is None: + raise _Stop("blocked", "CTA_TAINTED_CONTROL_PLANE", "no_step_up_receipt") + now = self._now() + try: + info = verify_step_up_receipt( + receipt, policy_jwk=self._policy_jwk, session_id=session_id, request_id=request_id, + tool_name=tool_name, args_digest=args_digest, now=now, + ) + except CtaVerifyError as exc: + raise _Stop("blocked", "CTA_TAINTED_CONTROL_PLANE", "step_up_receipt_invalid", str(exc)) from exc + body = info["receipt"] + if not self._receipts.spend(body["receipt_id"], body["exp"], now): + raise _Stop("blocked", "CTA_TAINTED_CONTROL_PLANE", "step_up_receipt_replayed") + st.events.append("step_up_verified") + return info + + def _observe(self, st: _RunState, observe: ObserveFn, authorization: Mapping[str, Any]) -> Observation: + try: + observation = observe(st.result) + except Exception as exc: + raise _Stop("observation-failed", "CTA_OBSERVATION_FAILED", "observer_error") from exc + if ( + not isinstance(observation, Observation) + or observation.verdict not in _OBSERVATION_VERDICTS + or not isinstance(observation.document, Mapping) + ): + raise _Stop("observation-failed", "CTA_OBSERVATION_FAILED", "observation_invalid") + if observation.verdict != "established": + raise _Stop("observation-failed", "CTA_OBSERVATION_FAILED", "observation_" + observation.verdict) + try: + verify_observation(observation.document, authorization=authorization) + except CtaVerifyError as exc: + raise _Stop("observation-failed", "CTA_OBSERVATION_FAILED", "observation_binding_mismatch", str(exc)) from exc + st.events.append("observation_verified") + return observation + + def _finalize( + self, st: _RunState, authorization: Mapping[str, Any], bridge: dict, decl_dict: dict, + call: dict, receipt_info: dict | None, observation: Observation, + ) -> RecordArtifacts: + cfg = self._cfg + record_iat = self._now() + if record_iat < authorization["authorized_at"]: + raise CtaGuardError("record iat precedes authorization") + transcript = build_transcript( + bridge=bridge, + step_up_receipt_digest=receipt_info["digest"] if receipt_info else None, + tool_call=call, + tool_response=_snapshot(observation.response_projection), + observation=_snapshot(dict(observation.document)), + ) + transcript_bytes = canonical_bytes(transcript) + if len(transcript_bytes) > cfg.max_transcript_bytes: + raise CtaGuardError("transcript exceeds max_transcript_bytes") + + record = build_record( + source=SourceSystem(producer=cfg.authorizer, source_event_id=authorization["authorization_id"]), + subject=self._subject, + model_provider=cfg.model_provider, model_id=cfg.model_id, + policy=PolicyEvidence(bundle=self._policy_bundle, enforcement_mode="enforce"), + data_class=cfg.data_class, jwk=self._record_jwk, + transcript_bytes=transcript_bytes, tool_call_count=1, + workload_digest=cfg.workload_digest, iat=record_iat, + ) + record["references"] = [{ + "rel": BRIDGE_REFERENCE_REL, "id": authorization["authorization_id"], + "resolver": cfg.resolver, "digest": digest_jcs(bridge), + }] + signed = sign_record(record, cfg.record_key) + st.events.append("record_signed") + verify_adapter_artifacts( + record=signed, bridge=bridge, declaration=decl_dict, tool_call=call, + authorizer_jwk=self._authorizer_jwk, record_jwk=self._record_jwk, + verification_time=record_iat, + receipt=receipt_info["envelope"] if receipt_info else None, + policy_jwk=self._policy_jwk if receipt_info else None, + policy_bundle=self._policy_bundle, transcript=transcript, + ) + st.events.append("record_verified") + return RecordArtifacts( + authorization=st.authorization, transcript=_snapshot(transcript), record=_snapshot(signed), + ) + diff --git a/integrations/wimse-cta-mcp-guard/cta_trace_verify.py b/integrations/wimse-cta-mcp-guard/cta_trace_verify.py new file mode 100644 index 00000000..18c79d92 --- /dev/null +++ b/integrations/wimse-cta-mcp-guard/cta_trace_verify.py @@ -0,0 +1,647 @@ +"""Relying-party verification for the WIMSE CTA MCP guard TRACE adapter. + +This module imports only `agentrust_trace`, `rfc8785`, `cryptography`, and the +standard library; it does not import `agentrust_trace_adapters` or `cta_trace_guard` +(a test enforces that). The producer side, which tracks taint, gates the tool call, +signs the bridge, and builds the Trust Record, lives in `cta_trace_guard`. + +Everything signed here is Ed25519 over the RFC 8785 (JCS) bytes of +`{"profile": , "": }`, carried as unpadded canonical +base64url. A key identifier is `sha256:` plus the lowercase hex SHA-256 of the raw +32-byte public key. + +Public entry points: `verify_step_up_receipt`, `verify_bridge`, `verify_observation`, +`verify_authorization_artifacts` (the bridge-only outcome, where no Trust Record was +emitted), and `verify_adapter_artifacts` (the bridge, receipt, transcript, and record). +Each raises `CtaVerifyError` on the first failed check; messages carry no input values. +""" + +from __future__ import annotations + +import base64 +import copy +import hashlib +import json +import math +import re +from collections.abc import Mapping +from typing import Any + +import rfc8785 +from agentrust_trace import verify_record +from agentrust_trace.validate import validate_json +from cryptography.exceptions import InvalidSignature +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey + +CTA_VERSION = "1.0" +BRIDGE_PROFILE = "cta-trace-bridge-v1" +RECEIPT_PROFILE = "cta-step-up-receipt-v1" +TRANSCRIPT_PROFILE = "cta-trace-transcript/v1" +DECLARATION_PROFILE = "cta-tool-declaration/v1" +POLICY_PROFILE = "cta-gate-policy/v1" +BRIDGE_REFERENCE_REL = "authorized-intent" + +TRUSTED_ONLY = "TRUSTED_ONLY" +UNTRUSTED_INGESTED = "UNTRUSTED_INGESTED" +TAINT_LEVELS = (TRUSTED_ONLY, UNTRUSTED_INGESTED) + +READ_ONLY = "READ_ONLY" +STATE_MUTATING = "STATE_MUTATING" +EFFECT_CLASSES = (READ_ONLY, STATE_MUTATING) + +OUTPUT_TRUST_VALUES = ("trusted", "untrusted") + +BASIS_READ_ONLY = "read-only" +BASIS_TRUSTED_CONTEXT = "trusted-context" +BASIS_STEP_UP = "step-up-receipt" + +SAFE_INT_MAX = 2**53 - 1 +MAX_CLOCK_SKEW_SECONDS = 60 +MAX_RECEIPT_WINDOW_SECONDS = 3600 +PRIVATE_JWK_MEMBERS = ("d", "p", "q", "dp", "dq", "qi", "oth") + +RECEIPT_FIELDS = ( + "receipt_id", "session_id", "request_id", "tool_name", "args_digest", + "approver", "kid", "iat", "exp", +) +AUTHORIZATION_REQUIRED = ( + "cta_version", "authorization_id", "decision", "decision_basis", "authorizer", + "authorizer_key_id", "authorized_at", "expires_at", "session_id", "request_id", + "tool_name", "tool_effect_class", "taint_lattice_level", "args_digest", + "declaration_digest", "tool_call_digest", +) +AUTHORIZATION_OPTIONAL = ("step_up_receipt_hash",) +_AUTHORIZATION_ID_EXCLUDED = ( + "authorization_id", "authorizer", "authorizer_key_id", "authorized_at", "expires_at", +) +OBSERVATION_FIELDS = ("observation", "observer", "observed_at") +OBSERVATION_BINDINGS = ("request_id", "tool_name", "args_digest", "tool_call_count") +TRANSCRIPT_FIELDS = ( + "profile", "authorization_bridge_digest", "step_up_receipt_digest", "tool_call", + "tool_response", "observation", +) + +_B58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" +_B64URL = re.compile(r"[A-Za-z0-9_-]*") +_IDENTIFIER = re.compile(r"[\x21-\x7e]{1,512}") +_DIGEST = re.compile(r"sha256:[0-9a-f]{64}") +_AUTHORIZATION_ID = re.compile(r"urn:sha256:[0-9a-f]{64}") +_PUBLIC_JWK_MEMBERS = frozenset({"kty", "crv", "x", "kid"}) + + +class CtaVerifyError(Exception): + """A relying-party verification check failed (no input values in the message).""" + + +def _require(cond: bool, message: str) -> None: + if not cond: + raise CtaVerifyError(message) + + +def loads_unique(data: Any) -> Any: + """Parse JSON from bytes or str, rejecting duplicate keys and non-finite numbers. + + Non-finite means the `NaN`, `Infinity`, and `-Infinity` constants and any number + literal that overflows to infinity (`1e999`). Invalid UTF-8, malformed JSON, and + nesting that exhausts the parser all raise `CtaVerifyError`. + """ + if isinstance(data, (bytes, bytearray)): + try: + text = bytes(data).decode("utf-8") + except UnicodeDecodeError as exc: + raise CtaVerifyError("JSON input is not valid UTF-8") from exc + elif isinstance(data, str): + text = data + else: + raise CtaVerifyError("JSON input must be bytes or str") + + def _no_duplicates(pairs: list[tuple[str, Any]]) -> dict: + out: dict[str, Any] = {} + for key, value in pairs: + if key in out: + raise CtaVerifyError("duplicate key in JSON object") + out[key] = value + return out + + def _reject_constant(token: str) -> Any: + raise CtaVerifyError("non-finite JSON constant") + + def _finite_float(token: str) -> float: + value = float(token) + if not math.isfinite(value): + raise CtaVerifyError("non-finite JSON number") + return value + + try: + return json.loads( + text, + object_pairs_hook=_no_duplicates, + parse_constant=_reject_constant, + parse_float=_finite_float, + ) + except RecursionError as exc: + raise CtaVerifyError("JSON nesting is too deep") from exc + except ValueError as exc: + raise CtaVerifyError("malformed JSON") from exc + + +def canonical_bytes(value: Any) -> bytes: + """RFC 8785 bytes for `value`, or `CtaVerifyError` when it has no canonical form.""" + try: + return rfc8785.dumps(value) + except (rfc8785.CanonicalizationError, TypeError, ValueError, RecursionError) as exc: + raise CtaVerifyError("value has no RFC 8785 canonical form") from exc + + +def sha256_prefixed(data: bytes) -> str: + """SHA-256 of `data` in TRACE's `sha256:` form.""" + return "sha256:" + hashlib.sha256(data).hexdigest() + + +def digest_jcs(value: Any) -> str: + """`sha256:` of the RFC 8785 canonical bytes of `value`.""" + return sha256_prefixed(canonical_bytes(value)) + + +def require_timestamp(value: Any, name: str) -> int: + """A non-negative integer within the JCS safe range; `bool` is not an integer here.""" + _require( + isinstance(value, int) and not isinstance(value, bool) and 0 <= value <= SAFE_INT_MAX, + f"{name} must be a non-negative integer Unix timestamp in the JCS safe range", + ) + return value + + +def require_identifier(value: Any, name: str) -> str: + """1-512 printable ASCII characters, no whitespace.""" + _require( + isinstance(value, str) and _IDENTIFIER.fullmatch(value) is not None, + f"{name} must be 1-512 printable ASCII characters without whitespace", + ) + return value + + +def require_digest(value: Any, name: str) -> str: + _require( + isinstance(value, str) and _DIGEST.fullmatch(value) is not None, + f"{name} must be sha256: followed by 64 lowercase hex characters", + ) + return value + + +def b64url_decode(value: Any, *, field: str, length: int | None = None) -> bytes: + """Decode canonical unpadded base64url; each byte string has one accepted spelling. + + Rejects non-strings, any character outside `A-Z a-z 0-9 - _` (so no padding, no + whitespace, no `+` or `/`), lengths no byte string can have, and a final character + whose unused low bits are non-zero. + """ + _require(isinstance(value, str), f"{field} must be a base64url string") + _require(_B64URL.fullmatch(value) is not None, f"{field} is not unpadded base64url") + _require(len(value) % 4 != 1, f"{field} has an impossible base64url length") + decoded = base64.urlsafe_b64decode(value + "=" * (-len(value) % 4)) + canonical = base64.urlsafe_b64encode(decoded).rstrip(b"=").decode("ascii") + _require(canonical == value, f"{field} is not canonical base64url") + if length is not None: + _require(len(decoded) == length, f"{field} must decode to {length} bytes") + return decoded + + +def key_id(raw_public_key: bytes) -> str: + """`sha256:` plus the lowercase hex SHA-256 of the raw public key bytes.""" + return sha256_prefixed(raw_public_key) + + +def public_key_from_jwk(jwk: Any) -> tuple[Ed25519PublicKey, bytes]: + """The Ed25519 public key and raw bytes from a public OKP JWK. + + Refuses private members (`d p q dp dq qi oth`), members other than + `kty crv x kid`, a non-canonical `x`, and a `kid` that is not `key_id(raw)`. + """ + _require(isinstance(jwk, Mapping), "JWK must be an object") + _require(not any(member in jwk for member in PRIVATE_JWK_MEMBERS), "JWK carries private key members") + _require(set(jwk) <= _PUBLIC_JWK_MEMBERS, "JWK carries unsupported members") + _require( + jwk.get("kty") == "OKP" and jwk.get("crv") == "Ed25519", + "JWK is not an OKP Ed25519 public key", + ) + raw = b64url_decode(jwk.get("x"), field="JWK x", length=32) + if "kid" in jwk: + _require(jwk["kid"] == key_id(raw), "JWK kid is not the SHA-256 of the raw public key") + return Ed25519PublicKey.from_public_bytes(raw), raw + + +def signing_preimage(profile: str, field: str, body: Any) -> bytes: + """The bytes a CTA envelope signature covers.""" + return canonical_bytes({"profile": profile, field: body}) + + +def _verify_signature(public_key: Ed25519PublicKey, signature: Any, preimage: bytes, what: str) -> None: + raw = b64url_decode(signature, field=f"{what} signature", length=64) + try: + public_key.verify(raw, preimage) + except InvalidSignature as exc: + raise CtaVerifyError(f"{what} signature is invalid") from exc + + +def _as_object(value: Any, what: str) -> dict: + """A detached JSON object with an RFC 8785 form, from bytes, str, or a mapping. + + A mapping keeps its Python types: a `float` or `bool` where an integer is required + stays one and is refused by the field checks, exactly as the same value in JSON text + is. Canonicalizing first would turn `1.0` into `1` and hide it. + """ + if isinstance(value, (bytes, bytearray, str)): + parsed = loads_unique(value) + canonical_bytes(parsed) + elif isinstance(value, Mapping): + canonical_bytes(dict(value)) + parsed = copy.deepcopy(dict(value)) + else: + raise CtaVerifyError(f"{what} must be a JSON object") + _require(isinstance(parsed, dict), f"{what} must be a JSON object") + return parsed + + +def _check_keys(obj: Any, required: tuple, name: str, optional: tuple = ()) -> None: + _require(isinstance(obj, dict), f"{name} must be an object") + _require(set(required) <= set(obj), f"{name} is missing required fields") + _require(set(obj) <= set(required) | set(optional), f"{name} has unknown fields") + + +def authorization_id_for(authorization: Mapping[str, Any]) -> str: + """The content identifier of a gate decision. + + The hash of the canonical authorization without the identifier, the authorizer + identity, and the validity window, so it names the decision (session, request, + tool, arguments, taint, basis, declaration) and not who signed it or when. + """ + preimage = {k: v for k, v in authorization.items() if k not in _AUTHORIZATION_ID_EXCLUDED} + return "urn:sha256:" + hashlib.sha256(canonical_bytes(preimage)).hexdigest() + + +def expected_basis(effect_class: str, taint: str) -> str: + """The only `decision_basis` a bridge may carry for this effect class and taint.""" + if effect_class == READ_ONLY: + return BASIS_READ_ONLY + return BASIS_TRUSTED_CONTEXT if taint == TRUSTED_ONLY else BASIS_STEP_UP + + +def verify_step_up_receipt( + receipt: Any, + *, + policy_jwk: Mapping[str, Any], + session_id: str, + request_id: str, + tool_name: str, + args_digest: str, + now: int, +) -> dict: + """Verify a policy-engine StepUpReceipt for exactly one call, as of `now`. + + The receipt is `{"profile", "receipt", "signature"}`; the Ed25519 signature is by + the pinned policy-engine key, whose `kid` the receipt must carry. It must be bound to + this `(session_id, request_id, tool_name, args_digest)`, have a validity window + longer than the 60-second skew allowance and no longer than one hour, have started + no later than `now` plus the skew, and not have expired. Returns the parsed + `envelope`, `receipt` body, and `digest` (JCS digest of the whole envelope). + """ + require_timestamp(now, "now") + envelope = _as_object(receipt, "step-up receipt") + _check_keys(envelope, ("profile", "receipt", "signature"), "step-up receipt") + _require(envelope["profile"] == RECEIPT_PROFILE, "unknown step-up receipt profile") + body = envelope["receipt"] + _check_keys(body, RECEIPT_FIELDS, "step-up receipt body") + public_key, raw = public_key_from_jwk(policy_jwk) + _verify_signature( + public_key, envelope["signature"], signing_preimage(RECEIPT_PROFILE, "receipt", body), + "step-up receipt", + ) + _require(body["kid"] == key_id(raw), "step-up receipt kid does not identify the trusted policy-engine key") + require_identifier(body["receipt_id"], "receipt_id") + require_identifier(body["approver"], "approver") + require_digest(body["args_digest"], "receipt args_digest") + iat = require_timestamp(body["iat"], "receipt iat") + exp = require_timestamp(body["exp"], "receipt exp") + _require(exp > iat + MAX_CLOCK_SKEW_SECONDS, "receipt validity window must exceed the 60-second skew allowance") + _require(exp - iat <= MAX_RECEIPT_WINDOW_SECONDS, "receipt validity window exceeds one hour") + _require(iat <= now + MAX_CLOCK_SKEW_SECONDS, "receipt is not yet valid") + _require(now < exp, "receipt has expired") + _require(body["session_id"] == session_id, "receipt is bound to a different session") + _require(body["request_id"] == request_id, "receipt is bound to a different request") + _require(body["tool_name"] == tool_name, "receipt is bound to a different tool") + _require(body["args_digest"] == args_digest, "receipt is bound to different arguments") + return {"envelope": envelope, "receipt": body, "digest": digest_jcs(envelope)} + + +def _verify_bridge_object( + bridge: Any, + *, + authorizer_jwk: Mapping[str, Any], + declaration: Any, + tool_call: Any, + now: int | None, +) -> tuple[dict, dict]: + obj = _as_object(bridge, "bridge") + _check_keys(obj, ("profile", "authorization", "signature"), "bridge") + _require(obj["profile"] == BRIDGE_PROFILE, "unknown bridge profile") + authorization = obj["authorization"] + _check_keys(authorization, AUTHORIZATION_REQUIRED, "authorization", AUTHORIZATION_OPTIONAL) + public_key, raw = public_key_from_jwk(authorizer_jwk) + _verify_signature( + public_key, obj["signature"], signing_preimage(BRIDGE_PROFILE, "authorization", authorization), + "bridge", + ) + + _require(authorization["cta_version"] == CTA_VERSION, "unsupported cta_version") + _require(authorization["decision"] == "allow", "the signed decision is not allow") + require_identifier(authorization["authorizer"], "authorizer") + _require(authorization["authorizer_key_id"] == key_id(raw), "authorizer_key_id does not identify the trusted key") + authorized_at = require_timestamp(authorization["authorized_at"], "authorized_at") + expires_at = require_timestamp(authorization["expires_at"], "expires_at") + _require(expires_at > authorized_at, "expires_at must be after authorized_at") + instant = authorized_at if now is None else require_timestamp(now, "now") + _require(instant >= authorized_at, "authorization is not yet valid") + _require(instant < expires_at, "authorization has expired") + + for name in ("session_id", "request_id", "tool_name"): + require_identifier(authorization[name], name) + effect_class = authorization["tool_effect_class"] + taint = authorization["taint_lattice_level"] + _require(effect_class in EFFECT_CLASSES, "tool_effect_class is not a known effect class") + _require(taint in TAINT_LEVELS, "taint_lattice_level is not a known level") + for name in ("args_digest", "declaration_digest", "tool_call_digest"): + require_digest(authorization[name], name) + + basis = authorization["decision_basis"] + _require(basis == expected_basis(effect_class, taint), "decision_basis is inconsistent with effect class and taint") + has_receipt = "step_up_receipt_hash" in authorization + _require(has_receipt == (basis == BASIS_STEP_UP), "step_up_receipt_hash must be present exactly for a step-up basis") + if has_receipt: + require_digest(authorization["step_up_receipt_hash"], "step_up_receipt_hash") + + authorization_id = authorization["authorization_id"] + _require( + isinstance(authorization_id, str) and _AUTHORIZATION_ID.fullmatch(authorization_id) is not None, + "authorization_id is malformed", + ) + _require(authorization_id == authorization_id_for(authorization), "authorization_id does not match the decision") + + decl = _as_object(declaration, "declaration") + _check_keys(decl, ("profile", "tool", "effect_class", "output_trust"), "declaration") + _require(decl["profile"] == DECLARATION_PROFILE, "unknown declaration profile") + _require(decl["tool"] == authorization["tool_name"], "declaration is for a different tool") + _require(decl["effect_class"] == effect_class, "declaration effect class differs from the authorization") + _require(decl["output_trust"] in OUTPUT_TRUST_VALUES, "declaration output_trust is not a known value") + _require(digest_jcs(decl) == authorization["declaration_digest"], "declaration_digest does not match the declaration") + + call = _as_object(tool_call, "tool_call") + _check_keys(call, ("name", "arguments"), "tool_call") + _require(call["name"] == authorization["tool_name"], "tool_call names a different tool") + _require(isinstance(call["arguments"], dict), "tool_call arguments must be an object") + _require(digest_jcs(call) == authorization["tool_call_digest"], "tool_call_digest does not match the tool call") + _require(digest_jcs(call["arguments"]) == authorization["args_digest"], "args_digest does not match the arguments") + return obj, authorization + + +def verify_bridge( + bridge: Any, + *, + authorizer_jwk: Mapping[str, Any], + declaration: Any, + tool_call: Any, + now: int | None = None, +) -> dict: + """Verify the detached `cta-trace-bridge-v1` envelope and return its authorization. + + Checks the strict structure, the signature by the pinned authorizer key, that + `authorizer_key_id` is that key's `kid`, that `authorization_id` is the hash of the + decision, the validity window at `now` (the authorization's own `authorized_at` when + `now` is None), the declaration and tool-call digests, and that the decision basis + is the only one its effect class and taint allow. + """ + return _verify_bridge_object( + bridge, authorizer_jwk=authorizer_jwk, declaration=declaration, tool_call=tool_call, now=now, + )[1] + + +def verify_observation(document: Any, *, authorization: Mapping[str, Any]) -> dict: + """Verify the post-dispatch observation document against the verified authorization. + + The document is `{"observation", "observer", "observed_at"}`. The inner + `observation` must name the exact call it observed (`request_id`, `tool_name`, + `args_digest`) and report `tool_call_count == 1`; further domain facts are allowed. + `observed_at` must not precede `authorized_at`. + """ + obj = _as_object(document, "observation document") + _check_keys(obj, OBSERVATION_FIELDS, "observation document") + require_identifier(obj["observer"], "observer") + observed_at = require_timestamp(obj["observed_at"], "observed_at") + _require(observed_at >= authorization["authorized_at"], "observed_at precedes the authorization") + inner = obj["observation"] + _require(isinstance(inner, dict), "observation must be an object") + _require(set(OBSERVATION_BINDINGS) <= set(inner), "observation does not name the observed call") + _require(inner["request_id"] == authorization["request_id"], "observation is for a different request") + _require(inner["tool_name"] == authorization["tool_name"], "observation is for a different tool") + _require(inner["args_digest"] == authorization["args_digest"], "observation is for different arguments") + count = inner["tool_call_count"] + _require( + isinstance(count, int) and not isinstance(count, bool) and count == 1, + "observation tool_call_count is not exactly 1", + ) + return obj + + +def build_transcript( + *, + bridge: Mapping[str, Any], + step_up_receipt_digest: str | None, + tool_call: Mapping[str, Any], + tool_response: Any, + observation: Mapping[str, Any], +) -> dict: + """The transcript preimage hashed into `tool_transcript.hash` (JCS-canonical).""" + return { + "profile": TRANSCRIPT_PROFILE, + "authorization_bridge_digest": digest_jcs(dict(bridge)), + "step_up_receipt_digest": step_up_receipt_digest, + "tool_call": dict(tool_call), + "tool_response": tool_response, + "observation": dict(observation), + } + + +def did_key_public_bytes(did: Any) -> bytes: + """The raw Ed25519 public key inside a base58btc `did:key` (multicodec 0xed01).""" + prefix = "did:key:z" + _require( + isinstance(did, str) and did.startswith(prefix) and len(did) <= 128, + "subject is not a base58btc did:key", + ) + n = 0 + for ch in did[len(prefix):]: + index = _B58.find(ch) + _require(index >= 0, "invalid base58btc character in did:key") + n = n * 58 + index + body = n.to_bytes((n.bit_length() + 7) // 8, "big") + _require(body[:2] == b"\xed\x01", "did:key multicodec is not Ed25519 (0xed01)") + _require(len(body) - 2 == 32, "did:key does not hold a 32-byte Ed25519 key") + return body[2:] + + +def _verify_authorization( + *, + bridge: Any, + declaration: Any, + tool_call: Any, + authorizer_jwk: Mapping[str, Any], + receipt: Any, + policy_jwk: Mapping[str, Any] | None, + now: int | None, +) -> tuple[dict, dict, dict]: + bridge_obj, authorization = _verify_bridge_object( + bridge, authorizer_jwk=authorizer_jwk, declaration=declaration, tool_call=tool_call, now=now, + ) + checked = { + "bridge_signature": True, + "authorization_id_bound_to_decision": True, + "declaration_bound": True, + "tool_call_bound": True, + } + if authorization["decision_basis"] == BASIS_STEP_UP: + _require( + receipt is not None and policy_jwk is not None, + "a step-up basis needs the receipt and the policy-engine key", + ) + verified = verify_step_up_receipt( + receipt, policy_jwk=policy_jwk, session_id=authorization["session_id"], + request_id=authorization["request_id"], tool_name=authorization["tool_name"], + args_digest=authorization["args_digest"], now=authorization["authorized_at"], + ) + _require( + verified["digest"] == authorization["step_up_receipt_hash"], + "step_up_receipt_hash does not match the receipt", + ) + checked["step_up_receipt_bound"] = True + else: + _require(receipt is None, "a receipt was supplied but the bridge cites none") + return checked, bridge_obj, authorization + + +def verify_authorization_artifacts( + *, + bridge: Any, + declaration: Any, + tool_call: Any, + authorizer_jwk: Mapping[str, Any], + receipt: Any = None, + policy_jwk: Mapping[str, Any] | None = None, + now: int | None = None, +) -> dict: + """Verify the detached bridge, and the step-up receipt it cites, without a record. + + This is the public verifier for the bridge-only outcome (the gate allowed and signed + a bridge, but no Trust Record was emitted). With a step-up basis the receipt and the + pinned `policy_jwk` are required: the receipt must verify as of the authorization + instant and its JCS digest must equal `step_up_receipt_hash`. A receipt supplied for + a bridge that cites none is refused. + """ + return _verify_authorization( + bridge=bridge, declaration=declaration, tool_call=tool_call, + authorizer_jwk=authorizer_jwk, receipt=receipt, policy_jwk=policy_jwk, now=now, + )[0] + + +def verify_adapter_artifacts( + *, + record: Mapping[str, Any], + bridge: Any, + declaration: Any, + tool_call: Any, + authorizer_jwk: Mapping[str, Any], + record_jwk: Mapping[str, Any], + verification_time: int, + receipt: Any = None, + policy_jwk: Mapping[str, Any] | None = None, + policy_bundle: bytes | None = None, + transcript: Any = None, + max_record_age_seconds: int | None = None, +) -> dict: + """Verify the bridge, receipt, and Trust Record with only agentrust_trace + rfc8785. + + Runs the bridge-only checks, then: the record validates against the TRACE schema; + its signature verifies against the pinned `record_jwk` (not merely its own embedded + key) and `cnf.jwk` is that key; `origin.source_event_id` and exactly one + `authorized-intent` reference carry the `authorization_id` and the bridge's JCS + digest; `subject` is the `did:key` of `cnf.jwk.x`; the record states + `software-only`, `third-party-control-plane`, `enforce`, and appraisal `none`. When + `policy_bundle` is supplied, `policy.bundle_hash` and `runtime.measurement` must + recompute from those exact bytes. When `transcript` is supplied, its bindings, the + observation, and the signed `tool_transcript.hash` must hold. + """ + try: + require_timestamp(verification_time, "verification_time") + checked, bridge_obj, authorization = _verify_authorization( + bridge=bridge, declaration=declaration, tool_call=tool_call, + authorizer_jwk=authorizer_jwk, receipt=receipt, policy_jwk=policy_jwk, now=None, + ) + authorization_id = authorization["authorization_id"] + + validate_json(dict(record)) + _, record_raw = public_key_from_jwk(record_jwk) + pinned = {"kty": "OKP", "crv": "Ed25519", "x": record_jwk["x"]} + _require(record["cnf"]["jwk"] == pinned, "record cnf.jwk is not the pinned record key") + verify_record( + dict(record), pinned, now=verification_time, max_age_seconds=max_record_age_seconds, + ) + checked["record_signature"] = True + + _require(record["origin"]["kind"] == "third-party-control-plane", "origin.kind is not third-party-control-plane") + _require(record["origin"]["source_event_id"] == authorization_id, "origin.source_event_id is not the authorization_id") + _require(record["runtime"]["platform"] == "software-only", "runtime.platform is not software-only") + _require(record["appraisal"]["status"] == "none", "appraisal.status is not none") + _require(record["policy"]["enforcement_mode"] == "enforce", "policy.enforcement_mode is not enforce") + matching = [r for r in (record.get("references") or []) if r.get("id") == authorization_id] + _require(len(matching) == 1, "expected exactly one reference citing the bridge") + _require(matching[0].get("rel") == BRIDGE_REFERENCE_REL, "bridge reference rel is not authorized-intent") + _require(matching[0].get("digest") == digest_jcs(bridge_obj), "bridge reference digest mismatch") + checked["reference_matches_supplied_bridge"] = True + + _require(did_key_public_bytes(record["subject"]) == record_raw, "subject did:key does not decode to cnf.jwk.x") + checked["subject_binds_cnf_jwk"] = True + + if policy_bundle is not None: + bundle_hash = sha256_prefixed(policy_bundle) + _require(record["policy"]["bundle_hash"] == bundle_hash, "policy.bundle_hash does not match the supplied policy bytes") + measurement = sha256_prefixed( + "\n".join([record["origin"]["producer"], record["subject"], bundle_hash]).encode("utf-8") + ) + _require(record["runtime"]["measurement"] == measurement, "runtime.measurement does not recompute from the supplied policy bytes") + checked["policy_bytes_bound"] = True + + if transcript is not None: + body = _as_object(transcript, "transcript") + _check_keys(body, TRANSCRIPT_FIELDS, "transcript") + _require(body["profile"] == TRANSCRIPT_PROFILE, "unknown transcript profile") + _require(body["authorization_bridge_digest"] == digest_jcs(bridge_obj), "transcript authorization_bridge_digest does not match the bridge") + _require( + digest_jcs(body["tool_call"]) == digest_jcs(_as_object(tool_call, "tool_call")), + "transcript tool_call does not match the executed call", + ) + _require( + body["step_up_receipt_digest"] == authorization.get("step_up_receipt_hash"), + "transcript step_up_receipt_digest does not match the bridge", + ) + observation = verify_observation(body["observation"], authorization=authorization) + _require(observation["observed_at"] <= record["iat"], "observation postdates the record") + _require( + record["tool_transcript"]["hash"] == sha256_prefixed(canonical_bytes(body)), + "tool_transcript.hash does not match the supplied transcript preimage", + ) + _require(record["tool_transcript"].get("call_count") == 1, "tool_transcript.call_count is not 1") + checked["transcript_bound_and_hashed"] = True + return checked + except CtaVerifyError: + raise + except Exception as exc: # normalize to the module's error, hide detail + raise CtaVerifyError("adapter artifact verification failed") from exc diff --git a/integrations/wimse-cta-mcp-guard/examples/emit_record.py b/integrations/wimse-cta-mcp-guard/examples/emit_record.py new file mode 100644 index 00000000..d436d2c8 --- /dev/null +++ b/integrations/wimse-cta-mcp-guard/examples/emit_record.py @@ -0,0 +1,233 @@ +"""Emit one signed TRACE Level 0 Trust Record from a CTA-gated MCP call. TEST ONLY. + +In a fresh temporary sandbox this runs one harmless tool (`delete_demo_marker`, +declared `STATE_MUTATING` in the pinned policy bytes) twice in a session that has +ingested untrusted data: + +1. Without a StepUpReceipt, and with a forged `TRUSTED_ONLY` taint claim. The gate + refuses with `CTA_TAINTED_CONTROL_PLANE` before the tool is entered; the marker file + is untouched and the tool ran zero times. +2. With a policy-engine StepUpReceipt bound to that exact call. The gate signs and + verifies a `cta-trace-bridge-v1` bridge, the tool runs, an observer confirms the + file is gone and the tool ran once, and a Level 0 Trust Record is signed. + +The record is verified by `cta_trace_verify` (which uses only agentrust_trace, +rfc8785, and the standard library) from the artifacts and again from the JSON written +to disk, then written. Run `trace-tests verify --record --level 0` separately +as the external Level 0 check. + +All keys are deterministic Ed25519 TEST keys derived from fixed labels; they +authenticate nothing outside this example and must never be used in production. The +record's model, data_class, and workload_digest are fixed TEST values, labeled as such. +""" + +from __future__ import annotations + +import argparse +import hashlib +import json +import shutil +import sys +import tempfile +import time +from pathlib import Path +from typing import Any + +from agentrust_trace import key_to_jwk +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey +from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat +from cta_trace_guard import CtaConfig, CtaGuard, Observation, sign_envelope +from cta_trace_verify import ( + BASIS_STEP_UP, + RECEIPT_PROFILE, + UNTRUSTED_INGESTED, + digest_jcs, + key_id, + verify_adapter_artifacts, +) + +TOOL = "delete_demo_marker" +MARKER = "marker.txt" + +HARNESS = "urn:wimse-cta:integration:cta-trace-example-harness" +ARTIFACT_STORE = "urn:wimse-cta:integration:cta-trace-example-artifact-store" +APPROVER = "urn:wimse-cta:integration:cta-trace-example-policy-engine" +OBSERVER = "cta-trace-example-observer" + +MODEL_PROVIDER = "wimse-cta-test" +MODEL_ID = "deterministic-tool-calling-model-v1" +DATA_CLASS = "public" + +SESSION_ID = "cta-trace-example-session-1" +BLOCKED_REQUEST_ID = "cta-trace-example-request-001" +APPROVED_REQUEST_ID = "cta-trace-example-request-002" +RECEIPT_ID = "cta-trace-example-receipt-001" + + +def _test_key(label: str) -> Ed25519PrivateKey: + seed = hashlib.sha256(f"cta-trace-example/test-only/{label}".encode()).digest() + return Ed25519PrivateKey.from_private_bytes(seed) + + +BRIDGE_KEY = _test_key("bridge-key") +RECORD_KEY = _test_key("trace-record-key") +POLICY_ENGINE_KEY = _test_key("policy-engine-key") + + +def _raw_public(key: Ed25519PrivateKey) -> bytes: + return key.public_key().public_bytes(Encoding.Raw, PublicFormat.Raw) + + +def _policy_bytes() -> bytes: + policy = { + "profile": "cta-gate-policy/v1", + "step_up_key_id": key_id(_raw_public(POLICY_ENGINE_KEY)), + "tools": {TOOL: {"effect_class": "STATE_MUTATING", "output_trust": "trusted"}}, + } + return (json.dumps(policy, indent=2) + "\n").encode("utf-8") + + +def _fail(message: str) -> int: + print(f"example failed: {message}", file=sys.stderr) + return 1 + + +def main() -> int: + parser = argparse.ArgumentParser(description="Emit a TEST TRACE Level 0 Trust Record from a CTA gate.") + parser.add_argument("--out", type=Path, default=Path("trust-record.json"), help="output record path (JSON)") + args = parser.parse_args() + + if len({_raw_public(BRIDGE_KEY), _raw_public(RECORD_KEY), _raw_public(POLICY_ENGINE_KEY)}) != 3: + raise RuntimeError("TEST signing keys must be pairwise distinct") + + policy_bytes = _policy_bytes() + config = CtaConfig( + authorizer=HARNESS, + bridge_key=BRIDGE_KEY, + record_key=RECORD_KEY, + policy_engine_jwk=key_to_jwk(POLICY_ENGINE_KEY), + policy_bundle=policy_bytes, + model_provider=MODEL_PROVIDER, + model_id=MODEL_ID, + data_class=DATA_CLASS, + workload_digest="sha256:" + hashlib.sha256(Path(__file__).read_bytes()).hexdigest(), + resolver=ARTIFACT_STORE, + ) + guard = CtaGuard(config) # default real-time clock + + sandbox = Path(tempfile.mkdtemp(prefix="cta-trace-example-")) + try: + (sandbox / MARKER).write_text("cta-trace-example marker\n", encoding="utf-8") + state = {"count": 0} + tool_args = {"path": MARKER} + + def delete_demo_marker(path: str) -> dict[str, Any]: + state["count"] += 1 + target = (sandbox / path).resolve() + if target.parent != sandbox.resolve(): + raise ValueError("path escapes the example sandbox") + target.unlink() + return {"deleted": True} + + def observe_for(request_id: str): + existed_before = (sandbox / MARKER).exists() + + def observe(result: Any) -> Observation: + document = { + "observation": { + "request_id": request_id, + "tool_name": TOOL, + "args_digest": digest_jcs(tool_args), + "tool_call_count": state["count"], + "marker_existed_before": existed_before, + "marker_exists_after": (sandbox / MARKER).exists(), + }, + "observer": OBSERVER, + "observed_at": int(time.time()), + } + established = ( + state["count"] == 1 + and existed_before + and not (sandbox / MARKER).exists() + and result == {"deleted": True} + ) + return Observation( + verdict="established" if established else "contradicted", + document=document, + response_projection=result, + ) + + return observe + + # The host reports that the model ingested untrusted data (for example, an email body). + if guard.ingest_untrusted(SESSION_ID) != UNTRUSTED_INGESTED: + return _fail("session was not marked UNTRUSTED_INGESTED") + + blocked = guard.run( + session_id=SESSION_ID, request_id=BLOCKED_REQUEST_ID, tool_name=TOOL, + tool_fn=delete_demo_marker, arguments=tool_args, observe=observe_for(BLOCKED_REQUEST_ID), + claimed_taint="TRUSTED_ONLY", + ) + marker_intact = (sandbox / MARKER).exists() + print( + f"blocked: status={blocked.status} code={blocked.code} reason={blocked.reason} " + f"tool_entered={blocked.tool_entered} tool_calls={state['count']} marker_intact={marker_intact}" + ) + if ( + blocked.status != "blocked" or blocked.code != "CTA_TAINTED_CONTROL_PLANE" + or blocked.tool_entered or state["count"] != 0 or not marker_intact + or not blocked.taint_claim_ignored + ): + return _fail("the tainted mutation was not refused before tool entry") + + now = int(time.time()) + receipt_body = { + "receipt_id": RECEIPT_ID, + "session_id": SESSION_ID, + "request_id": APPROVED_REQUEST_ID, + "tool_name": TOOL, + "args_digest": digest_jcs(tool_args), + "approver": APPROVER, + "kid": key_id(_raw_public(POLICY_ENGINE_KEY)), + "iat": now, + "exp": now + 300, + } + receipt = sign_envelope(RECEIPT_PROFILE, "receipt", receipt_body, POLICY_ENGINE_KEY) + + allowed = guard.run( + session_id=SESSION_ID, request_id=APPROVED_REQUEST_ID, tool_name=TOOL, + tool_fn=delete_demo_marker, arguments=tool_args, observe=observe_for(APPROVED_REQUEST_ID), + step_up_receipt=receipt, + ) + if allowed.status != "record-emitted" or allowed.record_artifacts is None: + return _fail(f"no record emitted: status={allowed.status} code={allowed.code} reason={allowed.reason}") + print(f"allowed: status={allowed.status} events={' > '.join(allowed.events)}") + + artifacts = allowed.record_artifacts + authz = artifacts.authorization + if authz.bridge["authorization"]["decision_basis"] != BASIS_STEP_UP: + return _fail("the allowed call did not rest on a step-up receipt") + + args.out.parent.mkdir(parents=True, exist_ok=True) + args.out.write_text(json.dumps(artifacts.record, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") + written = json.loads(args.out.read_text(encoding="utf-8")) + checked = verify_adapter_artifacts( + record=written, bridge=authz.bridge, declaration=authz.declaration, + tool_call=authz.tool_call, authorizer_jwk=authz.authorizer_jwk, + record_jwk=guard.record_jwk, verification_time=int(time.time()), + receipt=authz.step_up_receipt, policy_jwk=authz.policy_engine_jwk, + policy_bundle=policy_bytes, transcript=artifacts.transcript, + ) + print(f"verified from the written file: {', '.join(sorted(checked))}") + print( + f"wrote {args.out} (status={allowed.status}, taint={allowed.taint}, " + f"basis={authz.bridge['authorization']['decision_basis']})" + ) + print(f"next: trace-tests verify --record {args.out} --level 0") + return 0 + finally: + shutil.rmtree(sandbox, ignore_errors=True) + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/integrations/wimse-cta-mcp-guard/integration.yaml b/integrations/wimse-cta-mcp-guard/integration.yaml new file mode 100644 index 00000000..7017f14d --- /dev/null +++ b/integrations/wimse-cta-mcp-guard/integration.yaml @@ -0,0 +1,41 @@ +name: WIMSE CTA MCP Guard +vendor: Agentic Security IETF Corpus +integrates_with: + - trace +description: >- + Uses a WIMSE Context Taint Attestation (CTA) pre-execution MCP tool gate and + post-dispatch observation to emit a signed TRACE Level 0 Trust Record. +maintainer: + github: drk-ram +repository: https://github.com/agentrust-io/integrations +homepage: https://datatracker.ietf.org/doc/draft-durga-wimse-ctx-isolation/ +license: Apache-2.0 +tier: community +marketplace: + display_name: WIMSE CTA MCP Guard + category: Security & policy + mark: CTA + keywords: [wimse, cta, mcp, taint, provenance, trace] + +# The adapter is a record producer. Before dispatch it tracks session taint, +# classifies the tool from a pinned declaration, and refuses a state-mutating +# call in an UNTRUSTED_INGESTED session unless a policy-engine StepUpReceipt +# bound to that exact call verifies. On allow it signs and verifies a detached +# cta-trace-bridge-v1 envelope before the tool is entered. After dispatch a +# caller-supplied observation must name the same call and establish it before +# the adapter signs a Level 0 Trust Record that references the bridge. +# +# The record's model, runtime, data_class, and build_provenance describe the +# governed run, not the CTA draft. examples/emit_record.py uses fixed TEST values +# and labels them accordingly. Level 0 is software-only signing, with no hardware +# attestation. +trace_roles: + - record-producer +trace_conformance_level: 0 +tested_against: + agentrust-trace: "0.11.0" + agentrust-trace-tests: "0.6.2" + + # The schema accepts agentrust-io package keys only. The tests and example also + # run against agentrust-trace-adapters 0.2.0, cryptography, and rfc8785, which + # are declared in pyproject.toml. diff --git a/integrations/wimse-cta-mcp-guard/pyproject.toml b/integrations/wimse-cta-mcp-guard/pyproject.toml new file mode 100644 index 00000000..1767322e --- /dev/null +++ b/integrations/wimse-cta-mcp-guard/pyproject.toml @@ -0,0 +1,33 @@ +[build-system] +requires = ["setuptools>=77"] +build-backend = "setuptools.build_meta" + +[project] +name = "wimse-cta-mcp-guard" +version = "0.1.0" +description = "WIMSE Context Taint Attestation MCP gate and verified observations as signed TRACE Level 0 Trust Records" +requires-python = ">=3.11" +license = "Apache-2.0" +dependencies = [ + "agentrust-trace>=0.11.0", + "agentrust-trace-adapters>=0.2.0", + "cryptography>=42.0.0", + "rfc8785>=0.1.2", +] + +[project.optional-dependencies] +test = [ + "pytest", + "agentrust-trace-tests>=0.6.2", + "packaging>=24", +] +cov = [ + "pytest-cov", +] + +[tool.setuptools] +py-modules = ["cta_trace_guard", "cta_trace_verify"] + +[tool.pytest.ini_options] +pythonpath = ["."] +testpaths = ["tests"] diff --git a/integrations/wimse-cta-mcp-guard/tests/conftest.py b/integrations/wimse-cta-mcp-guard/tests/conftest.py new file mode 100644 index 00000000..c6741c83 --- /dev/null +++ b/integrations/wimse-cta-mcp-guard/tests/conftest.py @@ -0,0 +1,233 @@ +"""Shared fixtures for the WIMSE CTA MCP guard tests. TEST keys only.""" + +from __future__ import annotations + +import copy +import dataclasses +import hashlib +import json +import time +from typing import Any + +import cta_trace_guard as g +import cta_trace_verify as v +import pytest +from agentrust_trace import key_to_jwk, sign_record +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey +from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat + +NOW = 1_800_000_000 + +TOOL = "delete_demo_marker" +READ_TOOL = "read_inbox" +CONFIG_TOOL = "read_config" +UNPINNED_TOOL = "unpinned_tool" +ARGS = {"path": "marker.txt"} + +HARNESS = "urn:wimse-cta:integration:cta-trace-test-harness" +ARTIFACT_STORE = "urn:wimse-cta:integration:cta-trace-test-artifact-store" +APPROVER = "urn:wimse-cta:integration:cta-trace-test-policy-engine" +OBSERVER = "cta-trace-test-observer" + + +def _test_key(label: str) -> Ed25519PrivateKey: + return Ed25519PrivateKey.from_private_bytes(hashlib.sha256(f"cta-trace-test/{label}".encode()).digest()) + + +BRIDGE_KEY = _test_key("bridge-key") +RECORD_KEY = _test_key("trace-record-key") +POLICY_KEY = _test_key("policy-engine-key") +OTHER_KEY = _test_key("some-other-key") + + +def raw_public(key: Ed25519PrivateKey) -> bytes: + return key.public_key().public_bytes(Encoding.Raw, PublicFormat.Raw) + + +POLICY_KID = v.key_id(raw_public(POLICY_KEY)) +POLICY = { + "profile": "cta-gate-policy/v1", + "step_up_key_id": POLICY_KID, + "tools": { + TOOL: {"effect_class": "STATE_MUTATING", "output_trust": "trusted"}, + READ_TOOL: {"effect_class": "READ_ONLY", "output_trust": "untrusted"}, + CONFIG_TOOL: {"effect_class": "READ_ONLY", "output_trust": "trusted"}, + }, +} +POLICY_BYTES = (json.dumps(POLICY, indent=2) + "\n").encode("utf-8") + + +def policy_bytes(**changes: Any) -> bytes: + return (json.dumps({**POLICY, **changes}, indent=2) + "\n").encode("utf-8") + + +class Clock: + def __init__(self, t: Any = NOW) -> None: + self.t = t + + def __call__(self) -> Any: + return self.t + + +def seq_clock(values): + """Return each value once, then the last value forever.""" + it = iter(values) + last = {"v": values[-1]} + + def _clock(): + try: + last["v"] = next(it) + except StopIteration: + pass + return last["v"] + + return _clock + + +def public_policy_jwk() -> dict[str, Any]: + return key_to_jwk(POLICY_KEY) + + +def make_config(**changes: Any) -> g.CtaConfig: + config = g.CtaConfig( + authorizer=HARNESS, + bridge_key=BRIDGE_KEY, + record_key=RECORD_KEY, + policy_engine_jwk=public_policy_jwk(), + policy_bundle=POLICY_BYTES, + model_provider="wimse-cta-test", + model_id="deterministic-tool-calling-model-v1", + data_class="public", + workload_digest="sha256:" + hashlib.sha256(b"cta-trace-test").hexdigest(), + resolver=ARTIFACT_STORE, + ) + return dataclasses.replace(config, **changes) + + +def make_observe( + request_id: str, *, tool_name: str = TOOL, args: Any = None, count: Any = 1, + observed_at: Any = NOW, verdict: str = "established", mutate: Any = None, +): + """An observer that returns a document naming the exact call. `mutate` edits it.""" + call_args = ARGS if args is None else args + + def observe(result: Any) -> g.Observation: + document = { + "observation": { + "request_id": request_id, "tool_name": tool_name, + "args_digest": v.digest_jcs(call_args), "tool_call_count": count, + }, + "observer": OBSERVER, + "observed_at": int(time.time()) if observed_at == "now" else observed_at, + } + if mutate is not None: + mutate(document) + return g.Observation(verdict=verdict, document=document, response_projection=result) + + return observe + + +@dataclasses.dataclass +class Run: + harness: Any + outcome: g.CtaOutcome + + @property + def guard(self) -> g.CtaGuard: + return self.harness.guard + + +class Harness: + """A guard with a fixed clock, a counting tool, and receipt/observer builders.""" + + def __init__(self, clock: Any = None, **config_changes: Any) -> None: + self.clock = Clock() if clock is None else clock + self.guard = g.CtaGuard(make_config(**config_changes), clock=self.clock) + self.calls: list[dict] = [] + + def tool(self, **kwargs: Any) -> dict: + self.calls.append(kwargs) + return {"ok": True} + + def receipt( + self, *, session: str = "s1", request: str = "r1", tool_name: str = TOOL, args: Any = None, + iat: Any = NOW, exp: Any = NOW + 300, key: Ed25519PrivateKey = POLICY_KEY, + mutate: Any = None, **overrides: Any, + ) -> dict: + body = { + "receipt_id": f"receipt-{request}", "session_id": session, "request_id": request, + "tool_name": tool_name, "args_digest": v.digest_jcs(ARGS if args is None else args), + "approver": APPROVER, "kid": POLICY_KID, "iat": iat, "exp": exp, + } + body.update(overrides) + if mutate is not None: + mutate(body) + return g.sign_envelope(v.RECEIPT_PROFILE, "receipt", body, key) + + def run( + self, *, session: str = "s1", request: str = "r1", tool_name: str = TOOL, args: Any = None, + receipt: Any = None, observe: Any = None, fn: Any = None, **kwargs: Any, + ) -> g.CtaOutcome: + call_args = dict(ARGS) if args is None else args + return self.guard.run( + session_id=session, request_id=request, tool_name=tool_name, + tool_fn=fn or self.tool, arguments=call_args, + observe=observe or make_observe(request, tool_name=tool_name, args=call_args), + step_up_receipt=receipt, **kwargs, + ) + + +@pytest.fixture +def harness() -> Harness: + return Harness() + + +@pytest.fixture +def trusted_run() -> Run: + """A STATE_MUTATING call in a TRUSTED_ONLY session that emitted a record.""" + h = Harness() + outcome = h.run() + assert outcome.status == "record-emitted", (outcome.status, outcome.reason, outcome.detail) + return Run(h, outcome) + + +@pytest.fixture +def stepup_run() -> Run: + """A STATE_MUTATING call in a tainted session, allowed by a StepUpReceipt, with a record.""" + h = Harness() + h.guard.ingest_untrusted("s1") + outcome = h.run(receipt=h.receipt()) + assert outcome.status == "record-emitted", (outcome.status, outcome.reason, outcome.detail) + return Run(h, outcome) + + +def verify_all(run: Run, **overrides: Any) -> dict: + artifacts = run.outcome.record_artifacts + authz = artifacts.authorization + kwargs: dict[str, Any] = { + "record": artifacts.record, "bridge": authz.bridge, "declaration": authz.declaration, + "tool_call": authz.tool_call, "authorizer_jwk": authz.authorizer_jwk, + "record_jwk": run.guard.record_jwk, "verification_time": NOW, "receipt": authz.step_up_receipt, + "policy_jwk": authz.policy_engine_jwk, "policy_bundle": POLICY_BYTES, + "transcript": artifacts.transcript, + } + kwargs.update(overrides) + return v.verify_adapter_artifacts(**kwargs) + + +def forge_bridge(bridge: dict, edit: Any = None, *, reid: bool = True, key: Ed25519PrivateKey = BRIDGE_KEY) -> dict: + """Re-sign a bridge with edited authorization content, so only the semantic check can fail.""" + authorization = copy.deepcopy(bridge["authorization"]) + if edit is not None: + edit(authorization) + if reid: + authorization["authorization_id"] = v.authorization_id_for(authorization) + return g.sign_envelope(v.BRIDGE_PROFILE, "authorization", authorization, key) + + +def resign_record(record: dict, mutate: Any, key: Ed25519PrivateKey = RECORD_KEY) -> dict: + """A validly signed copy of `record` with `mutate` applied, so only semantic checks can fail.""" + edited = copy.deepcopy(record) + edited.pop("signature") + mutate(edited) + return sign_record(edited, key) diff --git a/integrations/wimse-cta-mcp-guard/tests/test_cta_contract.py b/integrations/wimse-cta-mcp-guard/tests/test_cta_contract.py new file mode 100644 index 00000000..63efbe4d --- /dev/null +++ b/integrations/wimse-cta-mcp-guard/tests/test_cta_contract.py @@ -0,0 +1,75 @@ +"""Contract checks: released-package floors, the external TRACE Level 0 CLI, and the README skeleton.""" + +from __future__ import annotations + +import json +import os +import pathlib +import subprocess +import sys +import tomllib +from importlib.metadata import version + +import cta_trace_guard as g +import pytest +from conftest import ARGS, TOOL, make_config, make_observe +from packaging.requirements import Requirement +from packaging.utils import canonicalize_name + +INTEGRATION_DIR = pathlib.Path(__file__).resolve().parent.parent + + +def test_declared_dependency_floors_are_satisfied_by_the_installed_releases(): + data = tomllib.loads((INTEGRATION_DIR / "pyproject.toml").read_text(encoding="utf-8")) + specs = list(data["project"]["dependencies"]) + for extra in data["project"]["optional-dependencies"].values(): + specs.extend(extra) + requirements = {canonicalize_name(Requirement(spec).name): Requirement(spec) for spec in specs} + assert {"agentrust-trace", "agentrust-trace-adapters", "agentrust-trace-tests", "rfc8785", "cryptography"} <= requirements.keys() + for package in ("agentrust-trace", "agentrust-trace-adapters", "agentrust-trace-tests", "cryptography", "rfc8785"): + requirement = requirements[package] + assert requirement.specifier, f"{package} has no declared version floor" + installed = version(requirement.name) + assert requirement.specifier.contains(installed, prereleases=True), f"{package} {installed} vs {requirement.specifier}" + + +def test_manifest_declares_a_level_0_record_producer(): + text = (INTEGRATION_DIR / "integration.yaml").read_text(encoding="utf-8") + lines = [line.rstrip() for line in text.splitlines()] + assert "integrates_with:" in lines and " - trace" in lines + assert "trace_roles:" in lines and " - record-producer" in lines + assert "trace_conformance_level: 0" in lines + assert "tier: community" in lines + assert ' agentrust-trace: "0.11.0"' in lines + assert ' agentrust-trace-tests: "0.6.2"' in lines + + +def test_trace_tests_level_0_passes_on_an_emitted_record(tmp_path): + guard = g.CtaGuard(make_config()) # real clock: trace-tests checks iat freshness + out = guard.run( + session_id="s", request_id="r", tool_name=TOOL, tool_fn=lambda **kw: {"ok": True}, + arguments=ARGS, observe=make_observe("r", observed_at="now"), + ) + assert out.status == "record-emitted" + record_path = tmp_path / "trust-record.json" + record_path.write_text(json.dumps(out.record_artifacts.record, ensure_ascii=False), encoding="utf-8") + exe = pathlib.Path(sys.executable).with_name("trace-tests.exe" if os.name == "nt" else "trace-tests") + proc = subprocess.run( + [str(exe), "verify", "--record", str(record_path), "--level", "0"], + capture_output=True, text=True, check=False, + ) + assert proc.returncode == 0, proc.stdout + proc.stderr + + +@pytest.mark.parametrize( + "heading", + [ + "## Run it", + "## Before vs. After verification summary", + "## What is verified", + "## What it does NOT claim", + ], +) +def test_readme_has_the_required_sections(heading): + readme = (INTEGRATION_DIR / "README.md").read_text(encoding="utf-8") + assert heading in readme.splitlines() diff --git a/integrations/wimse-cta-mcp-guard/tests/test_cta_import_independence.py b/integrations/wimse-cta-mcp-guard/tests/test_cta_import_independence.py new file mode 100644 index 00000000..96207326 --- /dev/null +++ b/integrations/wimse-cta-mcp-guard/tests/test_cta_import_independence.py @@ -0,0 +1,22 @@ +"""cta_trace_verify must verify with only agentrust_trace + rfc8785 + cryptography + stdlib.""" + +from __future__ import annotations + +import pathlib +import subprocess +import sys + +MODULE_DIR = str(pathlib.Path(__file__).resolve().parent.parent) + + +def test_cta_trace_verify_does_not_load_producer_modules(): + code = ( + "import sys;" + f"sys.path.insert(0, {MODULE_DIR!r});" + "import cta_trace_verify;" + "banned=[m for m in ('cta_trace_guard','agentrust_trace_adapters') if m in sys.modules];" + "print(','.join(banned));" + "sys.exit(1 if banned else 0)" + ) + result = subprocess.run([sys.executable, "-I", "-c", code], capture_output=True, text=True, check=False) + assert result.returncode == 0, f"producer modules leaked: {result.stdout}\n{result.stderr}" diff --git a/integrations/wimse-cta-mcp-guard/tests/test_cta_trace_guard.py b/integrations/wimse-cta-mcp-guard/tests/test_cta_trace_guard.py new file mode 100644 index 00000000..84407e52 --- /dev/null +++ b/integrations/wimse-cta-mcp-guard/tests/test_cta_trace_guard.py @@ -0,0 +1,830 @@ +"""Taint gating, StepUpReceipt enforcement, dispatch ordering, observation, and record emission.""" + +from __future__ import annotations + +import json +import re +import threading +import time + +import cta_trace_guard as g +import cta_trace_verify as v +import pytest +from agentrust_trace import key_to_jwk, verify_record +from agentrust_trace.validate import validate_json +from agentrust_trace_adapters import software_measurement +from conftest import ( + ARGS, + ARTIFACT_STORE, + BRIDGE_KEY, + CONFIG_TOOL, + HARNESS, + NOW, + OTHER_KEY, + POLICY, + POLICY_BYTES, + POLICY_KEY, + READ_TOOL, + RECORD_KEY, + TOOL, + UNPINNED_TOOL, + Clock, + Harness, + Run, + make_config, + make_observe, + policy_bytes, + raw_public, + seq_clock, + verify_all, +) + +TRUSTED = v.TRUSTED_ONLY +TAINTED = v.UNTRUSTED_INGESTED + + +# --- Session taint ---------------------------------------------------------- + +def test_fresh_session_is_trusted_only(harness): + assert harness.guard.taint_level("never-seen") == TRUSTED + + +def test_untrusted_ingestion_is_sticky(harness): + guard = harness.guard + assert guard.ingest_untrusted("s1") == TAINTED + assert guard.ingest_untrusted("s1") == TAINTED + assert guard.taint_level("s1") == TAINTED + assert guard.taint_level("s2") == TRUSTED + clean = harness.run(tool_name=CONFIG_TOOL, args={}, request="clean") + assert clean.status == "record-emitted" + assert clean.taint == TAINTED + assert guard.taint_level("s1") == TAINTED + + +@pytest.mark.parametrize("bad", ["", "has space", None, "x" * 513]) +def test_ingest_untrusted_rejects_bad_session_id(harness, bad): + with pytest.raises(g.CtaGuardError): + harness.guard.ingest_untrusted(bad) + + +def test_forged_trusted_claim_cannot_downgrade_taint(harness): + harness.guard.ingest_untrusted("s1") + out = harness.run(claimed_taint="TRUSTED_ONLY") + assert (out.status, out.code) == ("blocked", "CTA_TAINTED_CONTROL_PLANE") + assert out.taint == TAINTED + assert out.taint_claim_ignored is True + assert harness.calls == [] + assert harness.guard.taint_level("s1") == TAINTED + + +def test_claimed_untrusted_raises_taint_and_it_stays(harness): + first = harness.run(claimed_taint="UNTRUSTED_INGESTED") + assert (first.status, first.reason) == ("blocked", "no_step_up_receipt") + assert harness.guard.taint_level("s1") == TAINTED + second = harness.run(request="r2") + assert (second.status, second.reason) == ("blocked", "no_step_up_receipt") + assert harness.calls == [] + + +def test_trusted_claim_in_clean_session_is_not_reported_as_ignored(harness): + out = harness.run(claimed_taint="TRUSTED_ONLY") + assert out.status == "record-emitted" + assert out.taint_claim_ignored is False + + +@pytest.mark.parametrize("claim", ["", "MIXED_TAINT", "trusted_only", True, 1]) +def test_unknown_taint_claim_is_a_precondition_failure(harness, claim): + out = harness.run(claimed_taint=claim) + assert (out.status, out.code, out.reason) == ("precondition-failed", "CTA_BAD_REQUEST", "bad_taint_claim") + assert harness.calls == [] + + +# --- Tool effect class ------------------------------------------------------ + +def test_untrusted_read_only_hint_is_ignored(harness): + harness.guard.ingest_untrusted("s1") + out = harness.run(runtime_annotations={"readOnlyHint": True, "destructiveHint": False}) + assert out.effect_class == v.STATE_MUTATING + assert (out.status, out.code) == ("blocked", "CTA_TAINTED_CONTROL_PLANE") + assert harness.calls == [] + + +def test_pinned_declaration_beats_a_destructive_runtime_hint(harness): + harness.guard.ingest_untrusted("s1") + out = harness.run(tool_name=CONFIG_TOOL, args={}, runtime_annotations={"readOnlyHint": False}) + assert out.effect_class == v.READ_ONLY + assert out.status == "record-emitted" + + +def test_unknown_tool_defaults_to_state_mutating_with_untrusted_output(harness): + declaration = harness.guard.declaration_for(UNPINNED_TOOL) + assert (declaration.effect_class, declaration.output_trust) == (v.STATE_MUTATING, "untrusted") + harness.guard.ingest_untrusted("s1") + out = harness.run(tool_name=UNPINNED_TOOL, runtime_annotations={"readOnlyHint": True}) + assert (out.status, out.effect_class) == ("blocked", v.STATE_MUTATING) + assert harness.calls == [] + + +def test_unknown_tool_in_a_trusted_session_runs_and_then_taints_it(harness): + first = harness.run(tool_name=UNPINNED_TOOL, request="r1") + assert (first.status, first.effect_class) == ("record-emitted", v.STATE_MUTATING) + assert harness.guard.taint_level("s1") == TAINTED + assert harness.run(tool_name=UNPINNED_TOOL, request="r2").status == "blocked" + assert len(harness.calls) == 1 + + +def test_read_only_tool_needs_no_receipt_under_taint(harness): + harness.guard.ingest_untrusted("s1") + out = harness.run(tool_name=CONFIG_TOOL, args={}) + authorization = out.record_artifacts.authorization.bridge["authorization"] + assert out.status == "record-emitted" + assert authorization["decision_basis"] == v.BASIS_READ_ONLY + assert "step_up_receipt_hash" not in authorization + + +def test_untrusted_tool_output_taints_the_session_after_dispatch(harness): + read = harness.run(tool_name=READ_TOOL, args={}, request="r1") + assert (read.status, read.taint) == ("record-emitted", TRUSTED) + assert harness.guard.taint_level("s1") == TAINTED + assert harness.run(request="r2").status == "blocked" + + +def test_trusted_tool_output_does_not_taint_the_session(harness): + assert harness.run(tool_name=CONFIG_TOOL, args={}, request="r1").status == "record-emitted" + assert harness.guard.taint_level("s1") == TRUSTED + assert harness.run(request="r2").status == "record-emitted" + + +def test_failing_untrusted_output_tool_still_taints_the_session(harness): + def boom(**kwargs): + raise RuntimeError("tool failed") + + out = harness.run(tool_name=READ_TOOL, args={}, fn=boom) + assert out.status == "dispatch-error" + assert harness.guard.taint_level("s1") == TAINTED + + +# --- Gate decisions --------------------------------------------------------- + +def test_trusted_session_mutation_is_allowed_on_a_trusted_context_basis(trusted_run): + out = trusted_run.outcome + authorization = out.record_artifacts.authorization.bridge["authorization"] + assert authorization["decision_basis"] == v.BASIS_TRUSTED_CONTEXT + assert authorization["taint_lattice_level"] == TRUSTED + assert authorization["tool_effect_class"] == v.STATE_MUTATING + assert "step_up_receipt_hash" not in authorization + assert out.result == {"ok": True} + assert out.tool_entered and out.code is None and out.reason is None + assert trusted_run.harness.calls == [ARGS] + + +def test_tainted_mutation_without_receipt_is_blocked_before_tool_entry(harness, monkeypatch): + signed = [] + real_sign = g.sign_envelope + + def spy(*args, **kwargs): + signed.append(args[0]) + return real_sign(*args, **kwargs) + + monkeypatch.setattr(g, "sign_envelope", spy) + harness.guard.ingest_untrusted("s1") + out = harness.run() + assert (out.status, out.code, out.reason) == ("blocked", "CTA_TAINTED_CONTROL_PLANE", "no_step_up_receipt") + assert not out.tool_entered and harness.calls == [] + assert out.authorization is None and out.record_artifacts is None + assert out.events == ("request_reserved", "taint_evaluated") + assert signed == [] + + +def test_receipt_is_ignored_when_the_gate_does_not_need_one(harness): + out = harness.run(receipt="not even json") + assert out.status == "record-emitted" + assert "step_up_verified" not in out.events + + +# --- StepUpReceipt ---------------------------------------------------------- + +def test_step_up_receipt_allows_a_tainted_mutation(stepup_run): + out = stepup_run.outcome + artifacts = out.record_artifacts + authz = artifacts.authorization + authorization = authz.bridge["authorization"] + assert authorization["decision_basis"] == v.BASIS_STEP_UP + assert authorization["taint_lattice_level"] == TAINTED + receipt_digest = v.digest_jcs(authz.step_up_receipt) + assert authorization["step_up_receipt_hash"] == receipt_digest + assert artifacts.transcript["step_up_receipt_digest"] == receipt_digest + assert out.events.index("step_up_verified") < out.events.index("bridge_signed") + assert stepup_run.harness.calls == [ARGS] + assert verify_all(stepup_run)["step_up_receipt_bound"] is True + + +@pytest.mark.parametrize( + "overrides, fragment", + [ + ({"session": "other-session"}, "different session"), + ({"request": "other-request"}, "different request"), + ({"tool_name": "other_tool"}, "different tool"), + ({"args": {"path": "other.txt"}}, "different arguments"), + ({"iat": NOW - 1000, "exp": NOW - 1}, "expired"), + ({"iat": NOW + 1000, "exp": NOW + 1300}, "not yet valid"), + ({"iat": NOW, "exp": NOW + 60}, "must exceed the 60-second skew"), + ({"iat": NOW, "exp": NOW + 3601}, "exceeds one hour"), + ({"kid": v.key_id(raw_public(OTHER_KEY))}, "does not identify the trusted"), + ({"key": OTHER_KEY}, "signature is invalid"), + ({"iat": True, "exp": True}, "receipt iat"), + ({"receipt_id": "has space"}, "receipt_id"), + ({"approver": ""}, "approver"), + ({"args_digest": "sha256:ABC"}, "receipt args_digest"), + ], +) +def test_invalid_receipt_blocks_a_tainted_mutation(harness, overrides, fragment): + harness.guard.ingest_untrusted("s1") + out = harness.run(receipt=harness.receipt(**overrides)) + assert (out.status, out.code, out.reason) == ("blocked", "CTA_TAINTED_CONTROL_PLANE", "step_up_receipt_invalid") + assert fragment in out.detail + assert not out.tool_entered and harness.calls == [] + assert out.authorization is None and out.record_artifacts is None + + +def _tamper_signature(receipt, how): + signature = receipt["signature"] + if how == "flip-first": + replacement = "B" if signature[0] == "A" else "A" + return {**receipt, "signature": replacement + signature[1:]} + if how == "pad": + return {**receipt, "signature": signature + "="} + if how == "alternate-spelling": + alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" + return {**receipt, "signature": signature[:-1] + alphabet[alphabet.index(signature[-1]) ^ 1]} + if how == "wrong-length": + return {**receipt, "signature": signature[:80]} + return {**receipt, "signature": 12345} + + +@pytest.mark.parametrize( + "how, fragment", + [ + ("flip-first", "signature is invalid"), + ("pad", "not unpadded base64url"), + ("alternate-spelling", "not canonical base64url"), + ("wrong-length", "decode to 64 bytes"), + ("not-a-string", "must be a base64url string"), + ], +) +def test_malformed_receipt_signature_is_refused(harness, how, fragment): + harness.guard.ingest_untrusted("s1") + out = harness.run(receipt=_tamper_signature(harness.receipt(), how)) + assert out.reason == "step_up_receipt_invalid" + assert fragment in out.detail + assert harness.calls == [] + + +def _damage(receipt, how): + if how == "missing-profile": + return {k: val for k, val in receipt.items() if k != "profile"} + if how == "extra-field": + return {**receipt, "note": "x"} + if how == "wrong-profile": + return {**receipt, "profile": "cta-step-up-receipt-v2"} + if how == "missing-body-field": + return {**receipt, "receipt": {k: val for k, val in receipt["receipt"].items() if k != "exp"}} + if how == "extra-body-field": + return {**receipt, "receipt": {**receipt["receipt"], "scope": "*"}} + return {**receipt, "receipt": "not-an-object"} + + +@pytest.mark.parametrize( + "how, fragment", + [ + ("missing-profile", "missing required fields"), + ("extra-field", "unknown fields"), + ("wrong-profile", "unknown step-up receipt profile"), + ("missing-body-field", "missing required fields"), + ("extra-body-field", "unknown fields"), + ("not-an-object", "must be an object"), + ], +) +def test_receipt_structure_is_exact(harness, how, fragment): + harness.guard.ingest_untrusted("s1") + out = harness.run(receipt=_damage(harness.receipt(), how)) + assert out.reason == "step_up_receipt_invalid" + assert fragment in out.detail + assert harness.calls == [] + + +@pytest.mark.parametrize( + "text, fragment", + [ + ('{"profile": "a", "profile": "b"}', "duplicate key"), + ('{"profile": NaN}', "non-finite"), + ('{"profile": 1e999}', "non-finite"), + ("{not json", "malformed JSON"), + ("[1, 2]", "must be a JSON object"), + (b"\xff\xfe", "not valid UTF-8"), + (12345, "must be a JSON object"), + ], +) +def test_receipt_json_is_parsed_strictly(harness, text, fragment): + harness.guard.ingest_untrusted("s1") + out = harness.run(receipt=text) + assert out.reason == "step_up_receipt_invalid" + assert fragment in out.detail + assert harness.calls == [] + + +def test_receipt_supplied_as_json_bytes_is_accepted(harness): + harness.guard.ingest_untrusted("s1") + out = harness.run(receipt=json.dumps(harness.receipt()).encode("utf-8")) + assert out.status == "record-emitted" + + +def test_float_spelled_timestamp_is_refused_even_though_its_jcs_form_verifies(harness): + harness.guard.ingest_untrusted("s1") + text = json.dumps(harness.receipt()).replace(f'"exp": {NOW + 300}', f'"exp": {NOW + 300}.0') + assert f"{NOW + 300}.0" in text + out = harness.run(receipt=text) + assert out.reason == "step_up_receipt_invalid" + assert "receipt exp" in out.detail + + +def test_float_timestamp_in_a_mapping_is_refused_like_the_same_text(harness): + harness.guard.ingest_untrusted("s1") + receipt = harness.receipt() + receipt["receipt"]["exp"] = float(receipt["receipt"]["exp"]) # same JCS bytes, so the signature holds + out = harness.run(receipt=receipt) + assert out.reason == "step_up_receipt_invalid" + assert "receipt exp" in out.detail + assert harness.calls == [] + + +def test_receipt_cannot_be_replayed_after_request_id_eviction(): + h = Harness(tombstone_capacity=1) + h.guard.ingest_untrusted("s1") + receipt = h.receipt(request="r1") + assert h.run(request="r1", receipt=receipt).status == "record-emitted" + assert h.run(request="r2", tool_name=CONFIG_TOOL, args={}).status == "record-emitted" + replay = h.run(request="r1", receipt=receipt) # r1's tombstone is gone; the receipt is not + assert (replay.status, replay.reason) == ("blocked", "step_up_receipt_replayed") + assert len(h.calls) == 2 + + +def test_receipt_ledger_forgets_a_receipt_only_after_it_expires(): + ledger = g._ReceiptLedger() + assert ledger.spend("a", 100, 0) + assert not ledger.spend("a", 100, 99) + assert ledger.spend("a", 200, 100) + + +# --- Request ids ------------------------------------------------------------ + +def test_duplicate_request_id_is_refused(harness): + assert harness.run(request="dup").status == "record-emitted" + again = harness.run(request="dup") + assert (again.status, again.code, again.reason) == ( + "precondition-failed", "CTA_REQUEST_ID_REUSED", "request_id_reused", + ) + assert len(harness.calls) == 1 + + +def test_blocked_request_id_is_still_spent(harness): + harness.guard.ingest_untrusted("s1") + assert harness.run(request="r1").status == "blocked" + retry = harness.run(request="r1", receipt=harness.receipt(request="r1")) + assert retry.code == "CTA_REQUEST_ID_REUSED" + assert harness.calls == [] + + +def test_concurrent_duplicate_request_ids_dispatch_once(): + h = Harness() + outcomes = [] + barrier = threading.Barrier(8) + + def worker(): + barrier.wait() + outcomes.append(h.run(request="same")) + + threads = [threading.Thread(target=worker) for _ in range(8)] + for t in threads: + t.start() + for t in threads: + t.join() + assert len(h.calls) == 1 + assert sorted(o.status for o in outcomes) == ["precondition-failed"] * 7 + ["record-emitted"] + + +def test_request_store_evicts_the_oldest_tombstone(): + store = g._RequestStore(2) + for rid in ("a", "b", "c"): + assert store.reserve(rid) + store.finish(rid) + assert store.reserve("a") # evicted + assert not store.reserve("c") + + +@pytest.mark.parametrize( + "field, value, reason", + [ + ("session", "", "bad_session_id"), + ("session", "has space", "bad_session_id"), + ("session", None, "bad_session_id"), + ("request", "x" * 513, "bad_request_id"), + ("request", "caf\u00e9", "bad_request_id"), + ("tool_name", 5, "bad_tool_name"), + ], +) +def test_bad_identifiers_fail_the_precondition(harness, field, value, reason): + out = harness.run(**{field: value}) + assert (out.status, out.code, out.reason) == ("precondition-failed", "CTA_BAD_REQUEST", reason) + assert harness.calls == [] and out.events == () + + +@pytest.mark.parametrize("arguments", [["not", "a", "mapping"], {"x": {1, 2}}, {"x": float("nan")}, {"x": 2**60}, {1: "k"}]) +def test_arguments_without_a_canonical_form_fail_the_precondition(harness, arguments): + out = harness.run(args=arguments) + assert (out.status, out.reason) == ("precondition-failed", "bad_arguments") + assert harness.calls == [] + + +def test_non_callable_tool_or_observer_fails_the_precondition(harness): + for tool_fn, observe in (("nope", make_observe("r")), (harness.tool, None)): + out = harness.guard.run( + session_id="s", request_id="r", tool_name=TOOL, tool_fn=tool_fn, arguments=ARGS, observe=observe, + ) + assert (out.status, out.reason) == ("precondition-failed", "bad_callable") + + +def test_arguments_are_snapshotted_before_dispatch(harness): + nested = {"opts": {"a": 1}} + + def mutating_tool(**kwargs): + kwargs["opts"]["a"] = 2 + return {"ok": True} + + out = harness.run(args=nested, fn=mutating_tool) + assert out.status == "record-emitted" + assert nested == {"opts": {"a": 1}} + assert out.record_artifacts.transcript["tool_call"]["arguments"] == {"opts": {"a": 1}} + + +# --- Bridge order and validity --------------------------------------------- + +def test_bridge_is_signed_and_verified_before_the_tool_is_entered(harness, monkeypatch): + order = [] + real_sign, real_verify = g.sign_envelope, g.verify_bridge + + def sign(profile, *args, **kwargs): + if profile == v.BRIDGE_PROFILE: + order.append("bridge_signed") + return real_sign(profile, *args, **kwargs) + + def verify(*args, **kwargs): + order.append("bridge_verified") + return real_verify(*args, **kwargs) + + def tool(**kwargs): + order.append("tool_entered") + return {"ok": True} + + monkeypatch.setattr(g, "sign_envelope", sign) + monkeypatch.setattr(g, "verify_bridge", verify) + out = harness.run(fn=tool) + assert order == ["bridge_signed", "bridge_verified", "tool_entered"] + assert out.events.index("bridge_signed") < out.events.index("bridge_verified") < out.events.index("tool_entered") + + +def test_complete_event_order_for_a_record(trusted_run): + assert trusted_run.outcome.events == ( + "request_reserved", "taint_evaluated", "bridge_signed", "bridge_verified", "tool_entered", + "tool_returned", "observation_verified", "record_signed", "record_verified", + ) + + +def test_bridge_that_expires_before_dispatch_blocks_the_tool(): + h = Harness(clock=seq_clock([NOW, NOW + 301])) + out = h.run() + assert (out.status, out.code, out.reason) == ( + "authorization-failed", "CTA_AUTHORIZATION_FAILED", "bridge_verification_failed", + ) + assert "expired" in out.detail + assert h.calls == [] and not out.tool_entered and out.authorization is None + + +def test_clock_stepping_back_before_dispatch_blocks_the_tool(): + h = Harness(clock=seq_clock([NOW, NOW - 1])) + out = h.run() + assert out.status == "authorization-failed" + assert "not yet valid" in out.detail + assert h.calls == [] + + +@pytest.mark.parametrize("bad", [True, False, -1, 0, 1, 1_699_999_999, 1.5, str(NOW), None, 2**53]) +def test_invalid_clock_value_fails_closed_before_dispatch(bad): + h = Harness(clock=Clock(bad)) + out = h.run() + assert (out.status, out.code, out.reason) == ("adapter-error", "CTA_ADAPTER_ERROR", "adapter_error") + assert h.calls == [] and not out.tool_entered + + +def test_bridge_expiry_overflow_fails_closed_before_dispatch(): + h = Harness(clock=Clock(v.SAFE_INT_MAX - 10)) + out = h.run() + assert out.status == "adapter-error" + assert h.calls == [] + + +def test_raising_clock_fails_closed_before_dispatch(): + def clock(): + raise RuntimeError("clock unavailable") + + h = Harness(clock=clock) + out = h.run() + assert out.status == "adapter-error" + assert h.calls == [] + + +# --- Dispatch and observation ---------------------------------------------- + +def test_tool_exception_yields_no_record_but_keeps_a_verifiable_bridge(harness): + def boom(**kwargs): + raise RuntimeError("tool failed") + + out = harness.run(fn=boom) + assert (out.status, out.code, out.reason) == ("dispatch-error", "CTA_DISPATCH_ERROR", "tool_raised") + assert out.tool_entered and out.record_artifacts is None + assert out.events[-2:] == ("tool_entered", "tool_raised") + authz = out.authorization + checked = v.verify_authorization_artifacts( + bridge=authz.bridge, declaration=authz.declaration, tool_call=authz.tool_call, + authorizer_jwk=authz.authorizer_jwk, + ) + assert checked["bridge_signature"] is True + + +@pytest.mark.parametrize( + "verdict, reason", + [("contradicted", "observation_contradicted"), ("not-established", "observation_not-established")], +) +def test_unestablished_observation_emits_no_record(harness, verdict, reason): + out = harness.run(observe=make_observe("r1", verdict=verdict)) + assert (out.status, out.code, out.reason) == ("observation-failed", "CTA_OBSERVATION_FAILED", reason) + assert out.tool_entered and out.authorization is not None and out.record_artifacts is None + authz = out.authorization + assert v.verify_authorization_artifacts( + bridge=authz.bridge, declaration=authz.declaration, tool_call=authz.tool_call, + authorizer_jwk=authz.authorizer_jwk, + )["bridge_signature"] is True + + +@pytest.mark.parametrize( + "mutate, fragment", + [ + (lambda d: d["observation"].update(request_id="other"), "different request"), + (lambda d: d["observation"].update(tool_name="other"), "different tool"), + (lambda d: d["observation"].update(args_digest=v.digest_jcs({"path": "x"})), "different arguments"), + (lambda d: d["observation"].update(tool_call_count=2), "tool_call_count"), + (lambda d: d["observation"].update(tool_call_count=True), "tool_call_count"), + (lambda d: d["observation"].update(tool_call_count=1.0), "tool_call_count"), + (lambda d: d["observation"].pop("args_digest"), "does not name the observed call"), + (lambda d: d.update(observed_at=True), "observed_at"), + (lambda d: d.update(observed_at=NOW - 1), "precedes the authorization"), + (lambda d: d.update(observer=""), "observer"), + (lambda d: d.update(extra=1), "unknown fields"), + (lambda d: d.pop("observer"), "missing required fields"), + (lambda d: d.update(observation="not-an-object"), "must be an object"), + (lambda d: d["observation"].update(note=float("inf")), "RFC 8785"), + ], +) +def test_observation_that_does_not_match_the_call_emits_no_record(harness, mutate, fragment): + out = harness.run(observe=make_observe("r1", mutate=mutate)) + assert (out.status, out.reason) == ("observation-failed", "observation_binding_mismatch") + assert fragment in out.detail + assert out.tool_entered and out.record_artifacts is None and out.authorization is not None + + +def test_observer_exception_emits_no_record(harness): + def observe(result): + raise RuntimeError("observer unavailable") + + out = harness.run(observe=observe) + assert (out.status, out.reason) == ("observation-failed", "observer_error") + assert out.record_artifacts is None + + +@pytest.mark.parametrize( + "returned", + [None, "established", g.Observation("maybe", {}, None), g.Observation("established", ["x"], None)], +) +def test_malformed_observation_emits_no_record(harness, returned): + out = harness.run(observe=lambda result: returned) + assert (out.status, out.reason) == ("observation-failed", "observation_invalid") + + +def test_oversized_transcript_fails_finalization_and_keeps_the_authorization(): + h = Harness(max_transcript_bytes=64) + out = h.run() + assert (out.status, out.reason) == ("adapter-error", "finalization_failed") + assert out.tool_entered and out.authorization is not None and out.record_artifacts is None + + +def test_record_issued_before_the_authorization_is_refused(): + h = Harness(clock=seq_clock([NOW, NOW, NOW - 1])) + out = h.run() + assert (out.status, out.reason) == ("adapter-error", "finalization_failed") + assert out.record_artifacts is None + + +def test_observation_dated_after_the_record_is_refused(): + h = Harness() + out = h.run(observe=make_observe("r1", observed_at=NOW + 10)) + assert (out.status, out.reason) == ("adapter-error", "finalization_failed") + + +def test_response_projection_without_a_canonical_form_fails_finalization(harness): + def observe(result): + document = make_observe("r1")(result).document + return g.Observation("established", document, object()) + + out = harness.run(observe=observe) + assert (out.status, out.reason) == ("adapter-error", "finalization_failed") + + +# --- The emitted record ----------------------------------------------------- + +def test_record_is_schema_valid_signed_and_bound_to_the_bridge(trusted_run): + artifacts = trusted_run.outcome.record_artifacts + record = artifacts.record + bridge = artifacts.authorization.bridge + authorization_id = bridge["authorization"]["authorization_id"] + + validate_json(record) + verify_record(record, trusted_run.guard.record_jwk, now=NOW, max_age_seconds=None) + assert record["origin"] == { + "kind": "third-party-control-plane", "producer": HARNESS, "source_event_id": authorization_id, + } + assert record["runtime"]["platform"] == "software-only" + assert record["appraisal"]["status"] == "none" + assert record["policy"]["enforcement_mode"] == "enforce" + assert record["references"] == [{ + "rel": "authorized-intent", "id": authorization_id, + "resolver": ARTIFACT_STORE, "digest": v.digest_jcs(bridge), + }] + assert record["subject"] == g.did_key(RECORD_KEY) + assert v.did_key_public_bytes(record["subject"]) == raw_public(RECORD_KEY) + assert record["cnf"]["jwk"] == key_to_jwk(RECORD_KEY) + assert record["tool_transcript"] == { + "hash": v.sha256_prefixed(v.canonical_bytes(artifacts.transcript)), "call_count": 1, + } + assert authorization_id.startswith("urn:sha256:") + + +def test_record_policy_hash_and_measurement_commit_to_the_exact_policy_bytes(trusted_run): + record = trusted_run.outcome.record_artifacts.record + assert record["policy"]["bundle_hash"] == v.sha256_prefixed(POLICY_BYTES) + assert record["runtime"]["measurement"] == software_measurement( + HARNESS, record["subject"], record["policy"]["bundle_hash"], + ) + + +def test_changing_one_policy_byte_changes_the_hash_and_the_measurement(trusted_run): + mutated_bytes = POLICY_BYTES.replace(b"read_config", b"read_confiG") + assert len(mutated_bytes) == len(POLICY_BYTES) and mutated_bytes != POLICY_BYTES + h = Harness(policy_bundle=mutated_bytes) + mutated = Run(h, h.run()) + original = trusted_run.outcome.record_artifacts.record + changed = mutated.outcome.record_artifacts.record + assert changed["policy"]["bundle_hash"] != original["policy"]["bundle_hash"] + assert changed["runtime"]["measurement"] != original["runtime"]["measurement"] + with pytest.raises(v.CtaVerifyError, match="bundle_hash"): + verify_all(mutated) # the verifier holds the original bytes + + +def test_all_artifact_checks_pass_for_a_trusted_run(trusted_run): + checked = verify_all(trusted_run) + assert set(checked) == { + "bridge_signature", "authorization_id_bound_to_decision", "declaration_bound", "tool_call_bound", + "record_signature", "reference_matches_supplied_bridge", "subject_binds_cnf_jwk", + "policy_bytes_bound", "transcript_bound_and_hashed", + } + assert all(checked.values()) + + +def test_default_real_time_clock_emits_a_record(): + guard = g.CtaGuard(make_config()) + out = guard.run( + session_id="s", request_id="r", tool_name=TOOL, tool_fn=lambda **kw: {"ok": True}, + arguments=ARGS, observe=make_observe("r", observed_at="now"), + ) + assert out.status == "record-emitted" + assert abs(out.record_artifacts.record["iat"] - time.time()) < 60 + + +def test_public_keys_are_returned_as_copies(harness): + jwk = harness.guard.authorizer_jwk + assert jwk["kid"] == v.key_id(raw_public(BRIDGE_KEY)) + jwk["x"] = "tampered" + assert harness.guard.authorizer_jwk["x"] != "tampered" + record_jwk = harness.guard.record_jwk + record_jwk.clear() + assert harness.guard.record_jwk == key_to_jwk(RECORD_KEY) + + +# --- Policy bundle ---------------------------------------------------------- + +@pytest.mark.parametrize( + "bundle, fragment", + [ + (b"", "non-empty bytes"), + ("{}", "non-empty bytes"), + (b"\xff\xfe", "not valid UTF-8"), + (b'{"profile": "a", "profile": "b"}', "duplicate key"), + (b'{"x": NaN}', "non-finite"), + (b"[]", "exactly the fields"), + (policy_bytes(profile="other/v9"), "unknown policy profile"), + (policy_bytes(step_up_key_id="sha256:xyz"), "step_up_key_id"), + (policy_bytes(tools=[]), "tools must be an object"), + (policy_bytes(extra=1), "exactly the fields"), + (policy_bytes(tools={"bad name": {"effect_class": "READ_ONLY", "output_trust": "trusted"}}), "tool name"), + (policy_bytes(tools={TOOL: {"effect_class": "PRIVILEGED_ACTUATE", "output_trust": "trusted"}}), "effect_class"), + (policy_bytes(tools={TOOL: {"effect_class": "READ_ONLY", "output_trust": "maybe"}}), "output_trust"), + (policy_bytes(tools={TOOL: {"effect_class": "READ_ONLY"}}), "exactly the fields"), + ], +) +def test_policy_bundle_is_parsed_strictly(bundle, fragment): + with pytest.raises(g.CtaGuardError, match=re.escape(fragment)): + g.load_policy(bundle) + + +def test_policy_bundle_with_no_tools_is_valid_and_every_tool_is_unknown(): + policy = g.load_policy(policy_bytes(tools={})) + assert policy.tools == {} + h = Harness(policy_bundle=policy_bytes(tools={})) + assert h.guard.declaration_for(TOOL).effect_class == v.STATE_MUTATING + + +def test_loaded_policy_matches_the_bundle(): + policy = g.load_policy(POLICY_BYTES) + assert policy.step_up_key_id == POLICY["step_up_key_id"] + assert policy.tools[READ_TOOL] == g.ToolDeclaration(READ_TOOL, v.READ_ONLY, "untrusted") + assert policy.tools[TOOL].to_dict() == { + "profile": "cta-tool-declaration/v1", "tool": TOOL, "effect_class": "STATE_MUTATING", + "output_trust": "trusted", + } + + +# --- Configuration ---------------------------------------------------------- + +def test_config_rejects_a_private_policy_engine_jwk(): + with pytest.raises(g.CtaGuardError, match="private"): + g.CtaGuard(make_config(policy_engine_jwk={**key_to_jwk(POLICY_KEY), "d": "AAAA"})) + + +def test_config_rejects_a_policy_engine_key_the_policy_does_not_pin(): + with pytest.raises(g.CtaGuardError, match="step_up_key_id"): + g.CtaGuard(make_config(policy_engine_jwk=key_to_jwk(OTHER_KEY))) + + +@pytest.mark.parametrize("field", ["bridge_key", "record_key"]) +def test_config_rejects_reusing_a_key_across_roles(field): + other = RECORD_KEY if field == "bridge_key" else BRIDGE_KEY + with pytest.raises(g.CtaGuardError, match="pairwise distinct"): + g.CtaGuard(make_config(**{field: other})) + + +@pytest.mark.parametrize("field", ["bridge_key", "record_key"]) +def test_config_rejects_non_ed25519_keys(field): + with pytest.raises(g.CtaGuardError, match="Ed25519PrivateKey"): + g.CtaGuard(make_config(**{field: "not a key"})) + + +@pytest.mark.parametrize( + "field, value", + [ + ("bridge_validity_seconds", 0), ("bridge_validity_seconds", True), + ("max_transcript_bytes", -1), ("tombstone_capacity", 1.5), + ], +) +def test_config_rejects_non_positive_integers(field, value): + with pytest.raises(g.CtaGuardError, match=field): + g.CtaGuard(make_config(**{field: value})) + + +@pytest.mark.parametrize( + "field, value", + [ + ("model_provider", " "), ("model_id", ""), ("data_class", None), + ("authorizer", "has space"), ("resolver", ""), ("workload_digest", "sha256:abc"), + ], +) +def test_config_rejects_blank_or_malformed_provenance_inputs(field, value): + with pytest.raises(g.CtaGuardError, match=field): + g.CtaGuard(make_config(**{field: value})) + + +def test_policy_key_is_pinned_by_the_policy_bytes_not_by_the_caller(): + other_policy = policy_bytes(step_up_key_id=v.key_id(raw_public(OTHER_KEY))) + h = Harness(policy_bundle=other_policy, policy_engine_jwk=key_to_jwk(OTHER_KEY)) + h.guard.ingest_untrusted("s1") + out = h.run(receipt=h.receipt()) # signed by POLICY_KEY, which this policy does not trust + assert out.reason == "step_up_receipt_invalid" + assert h.calls == [] diff --git a/integrations/wimse-cta-mcp-guard/tests/test_cta_trace_verify.py b/integrations/wimse-cta-mcp-guard/tests/test_cta_trace_verify.py new file mode 100644 index 00000000..059f0c65 --- /dev/null +++ b/integrations/wimse-cta-mcp-guard/tests/test_cta_trace_verify.py @@ -0,0 +1,573 @@ +"""Relying-party verification: strict parsing, key hygiene, and forged-but-signed artifacts.""" + +from __future__ import annotations + +import base64 +import copy +import hashlib +import json +import re + +import cta_trace_guard as g +import cta_trace_verify as v +import pytest +from agentrust_trace import key_to_jwk +from conftest import ( + NOW, + OTHER_KEY, + POLICY_KEY, + Harness, + forge_bridge, + raw_public, + resign_record, + verify_all, +) + +ZERO_DIGEST = "sha256:" + "0" * 64 +ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" +POLICY_JWK = key_to_jwk(POLICY_KEY) + + +def _alternate_spelling(value: str) -> str: + """Same bytes under a lenient decoder: flip a low bit of the last character.""" + return value[:-1] + ALPHABET[ALPHABET.index(value[-1]) ^ 1] + + +# --- Strict JSON ------------------------------------------------------------ + +@pytest.mark.parametrize( + "data, fragment", + [ + (b'{"a": 1, "a": 2}', "duplicate key"), + (b'{"a": {"b": 1, "b": 2}}', "duplicate key"), + (b'[{"a": 1, "a": 1}]', "duplicate key"), + (b'{"a": NaN}', "non-finite JSON constant"), + (b'{"a": Infinity}', "non-finite JSON constant"), + (b'{"a": -Infinity}', "non-finite JSON constant"), + (b'{"a": 1e999}', "non-finite JSON number"), + (b'{"a": -1e999}', "non-finite JSON number"), + (b"\xff", "not valid UTF-8"), + (b'{"a": ', "malformed JSON"), + (b"\xef\xbb\xbf{}", "malformed JSON"), + ("1" * 5000, "malformed JSON"), + (("[" * 100000).encode(), "too deep"), + (123, "bytes or str"), + (None, "bytes or str"), + ], +) +def test_loads_unique_refuses(data, fragment): + with pytest.raises(v.CtaVerifyError, match=re.escape(fragment)): + v.loads_unique(data) + + +def test_loads_unique_accepts_ordinary_json_as_bytes_or_str(): + text = '{"a": [1, 2.5, "x", null, true], "b": {"c": -3}}' + expected = {"a": [1, 2.5, "x", None, True], "b": {"c": -3}} + assert v.loads_unique(text) == expected + assert v.loads_unique(text.encode()) == expected + assert v.loads_unique(bytearray(text.encode())) == expected + + +@pytest.mark.parametrize( + "value", + [{"a": {1, 2}}, {"a": b"x"}, {"a": float("nan")}, {"a": float("inf")}, {"a": 2**53}, {"a": "\ud800"}, {1: 2}], +) +def test_canonical_bytes_refuses_values_without_a_jcs_form(value): + with pytest.raises(v.CtaVerifyError, match="RFC 8785"): + v.canonical_bytes(value) + + +def test_canonical_bytes_refuses_excessive_nesting(): + nested: list = [] + for _ in range(100000): + nested = [nested] + with pytest.raises(v.CtaVerifyError): + v.canonical_bytes(nested) + + +def test_digest_jcs_is_key_order_independent(): + assert v.digest_jcs({"a": 1, "b": 2}) == v.digest_jcs({"b": 2, "a": 1}) + assert v.digest_jcs({"a": 1}) != v.digest_jcs({"a": 2}) + + +# --- Scalars ---------------------------------------------------------------- + +@pytest.mark.parametrize("value", [True, False, 1.0, -1, v.SAFE_INT_MAX + 1, "1", None]) +def test_timestamps_must_be_non_negative_safe_integers_and_not_booleans(value): + with pytest.raises(v.CtaVerifyError, match="Unix timestamp"): + v.require_timestamp(value, "t") + + +def test_timestamp_bounds_are_inclusive(): + assert v.require_timestamp(0, "t") == 0 + assert v.require_timestamp(v.SAFE_INT_MAX, "t") == v.SAFE_INT_MAX + + +@pytest.mark.parametrize("value", ["", "a b", "a\nb", "a\n", "caf\u00e9", "x" * 513, 12345, None]) +def test_identifiers_are_printable_ascii_without_whitespace(value): + with pytest.raises(v.CtaVerifyError): + v.require_identifier(value, "id") + + +def test_identifier_accepts_urns_and_the_length_bound(): + assert v.require_identifier("urn:uuid:7f9c2b10-44a1-49e2-910b-88a12c34e901", "id") + assert v.require_identifier("x" * 512, "id") + + +@pytest.mark.parametrize("value", ["sha256:" + "A" * 64, "sha256:" + "a" * 63, "a" * 64, ZERO_DIGEST + "\n", None]) +def test_digests_are_lowercase_sha256_hex(value): + with pytest.raises(v.CtaVerifyError): + v.require_digest(value, "d") + + +def test_b64url_decode_has_one_spelling_per_byte_string(): + raw = bytes(range(32)) + encoded = base64.urlsafe_b64encode(raw).rstrip(b"=").decode() + assert v.b64url_decode(encoded, field="x") == raw + assert v.b64url_decode(encoded, field="x", length=32) == raw + assert v.b64url_decode("", field="x") == b"" + with pytest.raises(v.CtaVerifyError, match="not canonical"): + v.b64url_decode(_alternate_spelling(encoded), field="x") + + +@pytest.mark.parametrize( + "value, fragment", + [ + ("AA==", "unpadded"), + ("AA\n", "unpadded"), + (" AAAA", "unpadded"), + ("A+AA", "unpadded"), + ("A/AA", "unpadded"), + ("\u00e9AAA", "unpadded"), + ("A", "impossible"), + ("AAAAA", "impossible"), + ("AB", "not canonical"), + (123, "must be a base64url string"), + (None, "must be a base64url string"), + ], +) +def test_b64url_decode_refuses(value, fragment): + with pytest.raises(v.CtaVerifyError, match=re.escape(fragment)): + v.b64url_decode(value, field="x") + + +def test_b64url_decode_enforces_an_expected_length(): + with pytest.raises(v.CtaVerifyError, match="decode to 32 bytes"): + v.b64url_decode("AAAA", field="x", length=32) + + +# --- JWK hygiene ------------------------------------------------------------ + +def test_public_jwk_yields_the_key_and_its_raw_bytes(): + _, raw = v.public_key_from_jwk(POLICY_JWK) + assert raw == raw_public(POLICY_KEY) + v.public_key_from_jwk({**POLICY_JWK, "kid": v.key_id(raw)}) + + +@pytest.mark.parametrize("member", v.PRIVATE_JWK_MEMBERS) +def test_jwk_with_a_private_member_is_refused(member): + with pytest.raises(v.CtaVerifyError, match="private key members"): + v.public_key_from_jwk({**POLICY_JWK, member: "AAAA"}) + + +@pytest.mark.parametrize( + "jwk, fragment", + [ + ("not a mapping", "must be an object"), + ({**POLICY_JWK, "alg": "EdDSA"}, "unsupported members"), + ({**POLICY_JWK, "kty": "EC"}, "not an OKP Ed25519"), + ({**POLICY_JWK, "crv": "X25519"}, "not an OKP Ed25519"), + ({**POLICY_JWK, "x": _alternate_spelling(POLICY_JWK["x"])}, "not canonical"), + ({**POLICY_JWK, "x": POLICY_JWK["x"][:-1]}, "x"), + ({"kty": "OKP", "crv": "Ed25519"}, "must be a base64url string"), + ({**POLICY_JWK, "kid": ZERO_DIGEST}, "kid is not the SHA-256"), + ], +) +def test_malformed_public_jwk_is_refused(jwk, fragment): + with pytest.raises(v.CtaVerifyError, match=re.escape(fragment)): + v.public_key_from_jwk(jwk) + + +def test_key_id_is_sha256_of_the_raw_public_key(): + raw = raw_public(POLICY_KEY) + assert v.key_id(raw) == "sha256:" + hashlib.sha256(raw).hexdigest() + + +# --- did:key ---------------------------------------------------------------- + +@pytest.mark.parametrize( + "did, fragment", + [ + ("did:web:example.com", "not a base58btc did:key"), + ("did:key:z" + "1" * 200, "not a base58btc did:key"), + (5, "not a base58btc did:key"), + ("did:key:z0OIl", "invalid base58btc character"), + ("did:key:z" + g._base58btc(b"\xec\x01" + raw_public(POLICY_KEY)), "multicodec"), + ("did:key:z" + g._base58btc(b"\xed\x01" + b"\x07" * 31), "32-byte"), + ], +) +def test_did_key_decoding_is_strict(did, fragment): + with pytest.raises(v.CtaVerifyError, match=re.escape(fragment)): + v.did_key_public_bytes(did) + + +def test_did_key_round_trips(): + assert v.did_key_public_bytes(g.did_key(POLICY_KEY)) == raw_public(POLICY_KEY) + + +# --- Decision basis and identifier ------------------------------------------ + +def test_decision_basis_is_determined_by_effect_class_and_taint(): + assert v.expected_basis(v.READ_ONLY, v.TRUSTED_ONLY) == v.BASIS_READ_ONLY + assert v.expected_basis(v.READ_ONLY, v.UNTRUSTED_INGESTED) == v.BASIS_READ_ONLY + assert v.expected_basis(v.STATE_MUTATING, v.TRUSTED_ONLY) == v.BASIS_TRUSTED_CONTEXT + assert v.expected_basis(v.STATE_MUTATING, v.UNTRUSTED_INGESTED) == v.BASIS_STEP_UP + + +def test_authorization_id_names_the_decision_not_the_signer_or_the_window(trusted_run): + authorization = trusted_run.outcome.record_artifacts.authorization.bridge["authorization"] + assert v.authorization_id_for(authorization) == authorization["authorization_id"] + resigned = { + **authorization, "authorizer": "someone-else", "authorizer_key_id": ZERO_DIGEST, + "authorized_at": 1, "expires_at": 2, + } + assert v.authorization_id_for(resigned) == authorization["authorization_id"] + assert v.authorization_id_for({**authorization, "args_digest": ZERO_DIGEST}) != authorization["authorization_id"] + + +# --- Bridge ----------------------------------------------------------------- + +def _verify_bridge(run, bridge, **overrides): + authz = run.outcome.record_artifacts.authorization + kwargs = {"authorizer_jwk": authz.authorizer_jwk, "declaration": authz.declaration, "tool_call": authz.tool_call} + kwargs.update(overrides) + return v.verify_bridge(bridge, **kwargs) + + +def test_genuine_bridge_verifies_from_objects_bytes_and_text(trusted_run): + bridge = trusted_run.outcome.record_artifacts.authorization.bridge + assert _verify_bridge(trusted_run, bridge) == bridge["authorization"] + assert _verify_bridge(trusted_run, json.dumps(bridge)) == bridge["authorization"] + assert _verify_bridge(trusted_run, json.dumps(bridge).encode()) == bridge["authorization"] + + +def test_bridge_text_with_a_duplicate_member_is_refused(trusted_run): + bridge = trusted_run.outcome.record_artifacts.authorization.bridge + text = json.dumps(bridge)[:-1] + ', "signature": "AAAA"}' + with pytest.raises(v.CtaVerifyError, match="duplicate key"): + _verify_bridge(trusted_run, text) + + +@pytest.mark.parametrize("bad", [42, ["list"], None, "[1]"]) +def test_bridge_must_be_a_json_object(trusted_run, bad): + with pytest.raises(v.CtaVerifyError, match="must be a JSON object"): + _verify_bridge(trusted_run, bad) + + +@pytest.mark.parametrize( + "edit, fragment", + [ + (lambda a: a.update(decision="deny"), "not allow"), + (lambda a: a.update(cta_version="2.0"), "cta_version"), + (lambda a: a.update(authorizer=""), "authorizer"), + (lambda a: a.update(authorizer_key_id=ZERO_DIGEST), "authorizer_key_id"), + (lambda a: a.update(authorized_at=True), "authorized_at"), + (lambda a: a.update(expires_at=True), "expires_at"), + (lambda a: a.update(expires_at=a["authorized_at"]), "after authorized_at"), + (lambda a: a.update(session_id="has space"), "session_id"), + (lambda a: a.update(request_id=""), "request_id"), + (lambda a: a.update(tool_effect_class="PRIVILEGED_ACTUATE"), "known effect class"), + (lambda a: a.update(taint_lattice_level="MIXED_TAINT"), "known level"), + (lambda a: a.update(args_digest="sha256:short"), "args_digest"), + (lambda a: a.update(decision_basis="step-up-receipt"), "inconsistent"), + (lambda a: a.update(step_up_receipt_hash=ZERO_DIGEST), "exactly for a step-up basis"), + (lambda a: a.update(extra="x"), "unknown fields"), + (lambda a: a.pop("tool_name"), "missing required fields"), + (lambda a: a.update(args_digest=v.digest_jcs({"path": "evil"})), "args_digest does not match"), + ], +) +def test_forged_but_correctly_signed_bridge_is_refused(trusted_run, edit, fragment): + bridge = trusted_run.outcome.record_artifacts.authorization.bridge + with pytest.raises(v.CtaVerifyError, match=re.escape(fragment)): + _verify_bridge(trusted_run, forge_bridge(bridge, edit)) + + +def test_bridge_cannot_claim_a_trusted_context_for_a_tainted_session(trusted_run): + bridge = trusted_run.outcome.record_artifacts.authorization.bridge + forged = forge_bridge(bridge, lambda a: a.update(taint_lattice_level=v.UNTRUSTED_INGESTED)) + with pytest.raises(v.CtaVerifyError, match="inconsistent"): + _verify_bridge(trusted_run, forged) + + +@pytest.mark.parametrize("bad_id", ["urn:sha256:xyz", 5, "urn:sha256:" + "0" * 64]) +def test_authorization_id_must_be_the_hash_of_the_decision(trusted_run, bad_id): + bridge = trusted_run.outcome.record_artifacts.authorization.bridge + forged = forge_bridge(bridge, lambda a: a.update(authorization_id=bad_id), reid=False) + with pytest.raises(v.CtaVerifyError, match="authorization_id"): + _verify_bridge(trusted_run, forged) + + +def test_bridge_signed_by_another_key_is_refused(trusted_run): + bridge = trusted_run.outcome.record_artifacts.authorization.bridge + with pytest.raises(v.CtaVerifyError, match="bridge signature is invalid"): + _verify_bridge(trusted_run, forge_bridge(bridge, key=OTHER_KEY)) + + +def test_editing_a_signed_bridge_without_resigning_is_refused(trusted_run): + bridge = copy.deepcopy(trusted_run.outcome.record_artifacts.authorization.bridge) + bridge["authorization"]["tool_name"] = "other_tool" + with pytest.raises(v.CtaVerifyError, match="bridge signature is invalid"): + _verify_bridge(trusted_run, bridge) + + +@pytest.mark.parametrize( + "edit, fragment", + [ + (lambda b: b.update(profile="tag:agentrust-io.com,2026:pic-trace-bridge-v1"), "unknown bridge profile"), + (lambda b: b.update(extra=1), "unknown fields"), + (lambda b: b.pop("signature"), "missing required fields"), + (lambda b: b.update(authorization="not-an-object"), "must be an object"), + ], +) +def test_bridge_envelope_shape_is_exact(trusted_run, edit, fragment): + bridge = copy.deepcopy(trusted_run.outcome.record_artifacts.authorization.bridge) + edit(bridge) + with pytest.raises(v.CtaVerifyError, match=re.escape(fragment)): + _verify_bridge(trusted_run, bridge) + + +def test_bridge_validity_window_is_checked_at_the_supplied_instant(trusted_run): + bridge = trusted_run.outcome.record_artifacts.authorization.bridge + assert _verify_bridge(trusted_run, bridge, now=NOW + 299) + with pytest.raises(v.CtaVerifyError, match="expired"): + _verify_bridge(trusted_run, bridge, now=NOW + 300) + with pytest.raises(v.CtaVerifyError, match="not yet valid"): + _verify_bridge(trusted_run, bridge, now=NOW - 1) + with pytest.raises(v.CtaVerifyError, match="now must be"): + _verify_bridge(trusted_run, bridge, now=True) + + +def test_bridge_verification_uses_only_the_pinned_public_key(trusted_run): + bridge = trusted_run.outcome.record_artifacts.authorization.bridge + private = {**trusted_run.guard.authorizer_jwk, "d": "AAAA"} + with pytest.raises(v.CtaVerifyError, match="private key members"): + _verify_bridge(trusted_run, bridge, authorizer_jwk=private) + with pytest.raises(v.CtaVerifyError, match="signature is invalid"): + _verify_bridge(trusted_run, bridge, authorizer_jwk=key_to_jwk(OTHER_KEY)) + + +@pytest.mark.parametrize( + "edit, fragment", + [ + (lambda d: d.update(tool="other"), "different tool"), + (lambda d: d.update(effect_class="READ_ONLY"), "effect class differs"), + (lambda d: d.update(output_trust="untrusted"), "declaration_digest does not match"), + (lambda d: d.update(output_trust="maybe"), "output_trust is not a known value"), + (lambda d: d.update(profile="other"), "unknown declaration profile"), + (lambda d: d.update(extra=1), "unknown fields"), + ], +) +def test_declaration_must_be_the_one_the_bridge_was_signed_over(trusted_run, edit, fragment): + bridge = trusted_run.outcome.record_artifacts.authorization.bridge + declaration = copy.deepcopy(trusted_run.outcome.record_artifacts.authorization.declaration) + edit(declaration) + with pytest.raises(v.CtaVerifyError, match=re.escape(fragment)): + _verify_bridge(trusted_run, bridge, declaration=declaration) + + +@pytest.mark.parametrize( + "edit, fragment", + [ + (lambda c: c.update(name="other"), "names a different tool"), + (lambda c: c["arguments"].update(path="evil"), "tool_call_digest does not match"), + (lambda c: c.update(arguments=[1]), "arguments must be an object"), + (lambda c: c.update(extra=1), "unknown fields"), + ], +) +def test_tool_call_must_be_the_one_the_bridge_was_signed_over(trusted_run, edit, fragment): + bridge = trusted_run.outcome.record_artifacts.authorization.bridge + call = copy.deepcopy(trusted_run.outcome.record_artifacts.authorization.tool_call) + edit(call) + with pytest.raises(v.CtaVerifyError, match=re.escape(fragment)): + _verify_bridge(trusted_run, bridge, tool_call=call) + + +# --- Receipt ---------------------------------------------------------------- + +def test_receipt_verification_requires_a_valid_reference_time(stepup_run): + authz = stepup_run.outcome.record_artifacts.authorization + body = authz.step_up_receipt["receipt"] + kwargs = { + "policy_jwk": authz.policy_engine_jwk, "session_id": body["session_id"], + "request_id": body["request_id"], "tool_name": body["tool_name"], + "args_digest": body["args_digest"], + } + digest = v.verify_step_up_receipt(authz.step_up_receipt, now=NOW, **kwargs)["digest"] + assert digest == v.digest_jcs(authz.step_up_receipt) + with pytest.raises(v.CtaVerifyError, match="now must be"): + v.verify_step_up_receipt(authz.step_up_receipt, now=True, **kwargs) + with pytest.raises(v.CtaVerifyError, match="expired"): + v.verify_step_up_receipt(authz.step_up_receipt, now=NOW + 300, **kwargs) + + +def test_receipt_may_start_within_the_skew_allowance_but_not_beyond_it(): + h = Harness() + kwargs = { + "policy_jwk": POLICY_JWK, "session_id": "s1", "request_id": "r1", "tool_name": "delete_demo_marker", + "args_digest": v.digest_jcs({"path": "marker.txt"}), + } + early_ok = h.receipt(iat=NOW + 60, exp=NOW + 400) + assert v.verify_step_up_receipt(early_ok, now=NOW, **kwargs) + early_bad = h.receipt(iat=NOW + 61, exp=NOW + 400) + with pytest.raises(v.CtaVerifyError, match="not yet valid"): + v.verify_step_up_receipt(early_bad, now=NOW, **kwargs) + + +# --- Bridge-only artifacts -------------------------------------------------- + +def test_bridge_only_verification_of_a_step_up_basis_needs_the_receipt_and_the_key(stepup_run): + authz = stepup_run.outcome.record_artifacts.authorization + common = { + "bridge": authz.bridge, "declaration": authz.declaration, "tool_call": authz.tool_call, + "authorizer_jwk": authz.authorizer_jwk, + } + checked = v.verify_authorization_artifacts( + **common, receipt=authz.step_up_receipt, policy_jwk=authz.policy_engine_jwk, + ) + assert checked["step_up_receipt_bound"] is True + with pytest.raises(v.CtaVerifyError, match="needs the receipt"): + v.verify_authorization_artifacts(**common) + with pytest.raises(v.CtaVerifyError, match="needs the receipt"): + v.verify_authorization_artifacts(**common, receipt=authz.step_up_receipt) + with pytest.raises(v.CtaVerifyError, match="signature is invalid"): + v.verify_authorization_artifacts( + **common, receipt=authz.step_up_receipt, policy_jwk=key_to_jwk(OTHER_KEY), + ) + + +def test_cited_receipt_digest_must_match_the_supplied_receipt(stepup_run): + authz = stepup_run.outcome.record_artifacts.authorization + sibling = stepup_run.harness.receipt(receipt_id="a-different-valid-receipt") + with pytest.raises(v.CtaVerifyError, match="step_up_receipt_hash does not match"): + v.verify_authorization_artifacts( + bridge=authz.bridge, declaration=authz.declaration, tool_call=authz.tool_call, + authorizer_jwk=authz.authorizer_jwk, receipt=sibling, policy_jwk=authz.policy_engine_jwk, + ) + + +def test_receipt_supplied_for_a_bridge_that_cites_none_is_refused(trusted_run): + authz = trusted_run.outcome.record_artifacts.authorization + with pytest.raises(v.CtaVerifyError, match="cites none"): + v.verify_authorization_artifacts( + bridge=authz.bridge, declaration=authz.declaration, tool_call=authz.tool_call, + authorizer_jwk=authz.authorizer_jwk, receipt=trusted_run.harness.receipt(), + ) + + +# --- Record and transcript -------------------------------------------------- + +def test_artifact_checks_can_skip_the_optional_policy_and_transcript_inputs(trusted_run): + checked = verify_all(trusted_run, policy_bundle=None, transcript=None) + assert "policy_bytes_bound" not in checked and "transcript_bound_and_hashed" not in checked + assert checked["record_signature"] is True + + +def test_editing_a_signed_record_breaks_the_signature(trusted_run): + record = copy.deepcopy(trusted_run.outcome.record_artifacts.record) + record["data_class"] = "restricted" + with pytest.raises(v.CtaVerifyError, match="artifact verification failed"): + verify_all(trusted_run, record=record) + + +def test_record_that_violates_the_trace_schema_is_refused(trusted_run): + record = copy.deepcopy(trusted_run.outcome.record_artifacts.record) + del record["subject"] + with pytest.raises(v.CtaVerifyError, match="artifact verification failed"): + verify_all(trusted_run, record=record) + + +def test_a_non_mapping_record_is_refused_with_the_modules_error(trusted_run): + with pytest.raises(v.CtaVerifyError, match="artifact verification failed"): + verify_all(trusted_run, record=42) + + +def test_record_signed_by_another_key_is_refused_by_the_pinned_key(trusted_run): + other_signed = resign_record(trusted_run.outcome.record_artifacts.record, lambda r: None, key=OTHER_KEY) + with pytest.raises(v.CtaVerifyError, match="pinned record key"): + verify_all(trusted_run, record=other_signed) + + +def test_pinned_record_jwk_must_be_public(trusted_run): + with pytest.raises(v.CtaVerifyError, match="private key members"): + verify_all(trusted_run, record_jwk={**trusted_run.guard.record_jwk, "d": "AAAA"}) + + +def test_verification_time_must_be_an_integer(trusted_run): + with pytest.raises(v.CtaVerifyError, match="verification_time"): + verify_all(trusted_run, verification_time=True) + + +def test_record_age_limit_is_enforced_when_requested(trusted_run): + assert verify_all(trusted_run, verification_time=NOW + 100, max_record_age_seconds=1000) + with pytest.raises(v.CtaVerifyError, match="artifact verification failed"): + verify_all(trusted_run, verification_time=NOW + 1000, max_record_age_seconds=10) + + +@pytest.mark.parametrize( + "mutate, fragment", + [ + (lambda r: r["origin"].update(source_event_id=ZERO_DIGEST), "source_event_id"), + (lambda r: r["origin"].update(kind="log-import"), "origin.kind"), + (lambda r: r["references"][0].update(digest=ZERO_DIGEST), "digest mismatch"), + (lambda r: r["references"][0].update(rel="behavior-trace"), "rel is not authorized-intent"), + (lambda r: r.update(references=[]), "exactly one reference"), + (lambda r: r.pop("references"), "exactly one reference"), + (lambda r: r["references"].append(dict(r["references"][0])), "exactly one reference"), + (lambda r: r["policy"].update(enforcement_mode="advisory"), "enforcement_mode"), + (lambda r: r["policy"].update(bundle_hash=ZERO_DIGEST), "bundle_hash"), + (lambda r: r["runtime"].update(measurement=ZERO_DIGEST), "measurement"), + (lambda r: r.update(subject=g.did_key(OTHER_KEY)), "did:key does not decode"), + (lambda r: r["tool_transcript"].update(hash=ZERO_DIGEST), "tool_transcript.hash"), + (lambda r: r["tool_transcript"].update(call_count=2), "call_count"), + ], +) +def test_correctly_signed_record_with_wrong_content_is_refused(trusted_run, mutate, fragment): + record = resign_record(trusted_run.outcome.record_artifacts.record, mutate) + with pytest.raises(v.CtaVerifyError, match=re.escape(fragment)): + verify_all(trusted_run, record=record) + + +@pytest.mark.parametrize( + "mutate, fragment", + [ + (lambda t: t.update(profile="other"), "unknown transcript profile"), + (lambda t: t.update(authorization_bridge_digest=ZERO_DIGEST), "authorization_bridge_digest"), + (lambda t: t["tool_call"]["arguments"].update(path="evil"), "tool_call does not match"), + (lambda t: t.update(step_up_receipt_digest=ZERO_DIGEST), "step_up_receipt_digest"), + (lambda t: t["observation"]["observation"].update(request_id="other"), "different request"), + (lambda t: t["observation"].update(observed_at=NOW + 5), "postdates the record"), + (lambda t: t.update(tool_response={"ok": False}), "tool_transcript.hash"), + (lambda t: t.pop("tool_response"), "missing required fields"), + (lambda t: t.update(extra=1), "unknown fields"), + ], +) +def test_transcript_preimage_must_match_the_signed_hash_and_the_bridge(trusted_run, mutate, fragment): + transcript = copy.deepcopy(trusted_run.outcome.record_artifacts.transcript) + mutate(transcript) + with pytest.raises(v.CtaVerifyError, match=re.escape(fragment)): + verify_all(trusted_run, transcript=transcript) + + +def test_transcript_is_accepted_as_json_text(trusted_run): + transcript = trusted_run.outcome.record_artifacts.transcript + assert verify_all(trusted_run, transcript=json.dumps(transcript))["transcript_bound_and_hashed"] is True + + +def test_policy_bytes_that_differ_from_the_recorded_bundle_are_refused(trusted_run): + with pytest.raises(v.CtaVerifyError, match="bundle_hash"): + verify_all(trusted_run, policy_bundle=b'{"profile": "cta-gate-policy/v1"}\n') + + +def test_every_artifact_check_passes_for_a_step_up_run(stepup_run): + checked = verify_all(stepup_run) + assert checked["step_up_receipt_bound"] is True and all(checked.values()) diff --git a/marketplace/catalog.json b/marketplace/catalog.json index 5bb380b2..6a02d2c9 100644 --- a/marketplace/catalog.json +++ b/marketplace/catalog.json @@ -1,6 +1,6 @@ { "catalog_version": 1, - "count": 51, + "count": 52, "integrations": [ { "name": "Claude Code", @@ -1154,6 +1154,31 @@ "evidence" ] }, + { + "name": "WIMSE CTA MCP Guard", + "package_name": "WIMSE CTA MCP Guard", + "vendor": "Agentic Security IETF Corpus", + "description": "Uses a WIMSE Context Taint Attestation (CTA) pre-execution MCP tool gate and post-dispatch observation to emit a signed TRACE Level 0 Trust Record.", + "path": "integrations/wimse-cta-mcp-guard", + "url": "https://github.com/agentrust-io/integrations/tree/main/integrations/wimse-cta-mcp-guard", + "homepage": "https://datatracker.ietf.org/doc/draft-durga-wimse-ctx-isolation/", + "repository": "https://github.com/agentrust-io/integrations", + "tier": "community", + "stack": [ + "TRACE" + ], + "category": "Security & policy", + "mark": "CTA", + "featured": null, + "keywords": [ + "wimse", + "cta", + "mcp", + "taint", + "provenance", + "trace" + ] + }, { "name": "xChk registry", "package_name": "xChk registry", diff --git a/requirements/wimse-cta-mcp-guard-fixed.in b/requirements/wimse-cta-mcp-guard-fixed.in new file mode 100644 index 00000000..ba190a77 --- /dev/null +++ b/requirements/wimse-cta-mcp-guard-fixed.in @@ -0,0 +1,18 @@ +# Compile with: +# uv pip compile requirements/wimse-cta-mcp-guard-fixed.in --generate-hashes --universal \ +# --python-version 3.11 -o requirements/wimse-cta-mcp-guard-fixed.txt +# The fixed job in .github/workflows/wimse-cta-mcp-guard-conformance.yml +# installs this exact package set. The three pinned packages are the released +# versions exercised by the adapter, tests, and example. The two agentrust-io +# pins must equal tested_against in integrations/wimse-cta-mcp-guard/integration.yaml. +# rfc8785, pytest, and packaging are the integration's direct runtime and test +# dependencies, which the --no-deps editable install does not pull in. +# The floating job remains unpinned on purpose for drift detection. +agentrust-trace==0.11.0 +agentrust-trace-adapters==0.2.0 +agentrust-trace-tests==0.6.2 +cryptography>=42.0.0 +rfc8785 +pytest +pytest-cov +packaging>=24 diff --git a/requirements/wimse-cta-mcp-guard-fixed.txt b/requirements/wimse-cta-mcp-guard-fixed.txt new file mode 100644 index 00000000..656e0a48 --- /dev/null +++ b/requirements/wimse-cta-mcp-guard-fixed.txt @@ -0,0 +1,674 @@ +# This file was autogenerated by uv via the following command: +# uv pip compile requirements/wimse-cta-mcp-guard-fixed.in --generate-hashes --universal --python-version 3.11 -o requirements/wimse-cta-mcp-guard-fixed.txt +agentrust-trace==0.11.0 \ + --hash=sha256:7de621eaf795449e365d04967a82a551a18d75c99d248b4a0923f6d593bdb09e \ + --hash=sha256:8b76de58ec74fad57417093bf7977fe826ce6ade5859b4d5be8ce3938f9fcb35 + # via + # -r requirements/wimse-cta-mcp-guard-fixed.in + # agentrust-trace-adapters +agentrust-trace-adapters==0.2.0 \ + --hash=sha256:098f06e185b39692960cfb4c7c136dadba25073c05992dbc14457d07b681c4aa \ + --hash=sha256:541ef28e0c1c9bf781b1a90f93d8293bf9ec371b23bb4dbad47809b00a20bbb1 + # via -r requirements/wimse-cta-mcp-guard-fixed.in +agentrust-trace-tests==0.6.2 \ + --hash=sha256:6bb0a86f5514c266223818d0883ea9c7c1a449d87947a0b7bd57dcdf58dbfbea \ + --hash=sha256:bb2021031b0705645a75780ee443e6be16e8758d83ad4486d1cbf0e2f5b59fad + # via -r requirements/wimse-cta-mcp-guard-fixed.in +annotated-types==0.8.0 \ + --hash=sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7 \ + --hash=sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0 + # via pydantic +attrs==26.1.0 \ + --hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 \ + --hash=sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32 + # via + # jsonschema + # referencing +cffi==2.1.1 ; platform_python_implementation != 'PyPy' \ + --hash=sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e \ + --hash=sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66 \ + --hash=sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2 \ + --hash=sha256:154852545011f779917b11c78db2358d095da62a9a172b78ad0a583ee5adc0d0 \ + --hash=sha256:194cffa889098ced9976c3fc6340305e43f6303657d298da55366907c05c22d6 \ + --hash=sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971 \ + --hash=sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c \ + --hash=sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d \ + --hash=sha256:1dea0e4d7d4f11f619fe8c1d76caf49e24405b4b5743c0e3be16a500ecd930c9 \ + --hash=sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517 \ + --hash=sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735 \ + --hash=sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80 \ + --hash=sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f \ + --hash=sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1 \ + --hash=sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29 \ + --hash=sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8 \ + --hash=sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c \ + --hash=sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e \ + --hash=sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48 \ + --hash=sha256:3311ed60d36f83378794e1009ac6258bafbf81f7888b4caa7b35a521e3f95813 \ + --hash=sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac \ + --hash=sha256:34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632 \ + --hash=sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6 \ + --hash=sha256:398aff33cee2767e3e781d2554c54bd0dff386bb437581e0d8011fde1a942ec1 \ + --hash=sha256:3d22a20b1fb1632cc72c22f95f7b0d2961c3e1c235f245ba4c606c4771035659 \ + --hash=sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688 \ + --hash=sha256:42e2f76b9455f5a9a844f770bf3e200ed3da0e15f5df3db9c31fe80b04b3d004 \ + --hash=sha256:42f6930c31dc7f50732c9ae793c2786c7b6b044195967bbdde40bb9be81c4cc0 \ + --hash=sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062 \ + --hash=sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779 \ + --hash=sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94 \ + --hash=sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50 \ + --hash=sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab \ + --hash=sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac \ + --hash=sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6 \ + --hash=sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676 \ + --hash=sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1 \ + --hash=sha256:5a59cc1c4442bc3d5c703bf720b51138d0bfc173618807c9ee2490a7541dd3d9 \ + --hash=sha256:5bb4e7ea95dcd6a014a6fef62e62467d67d8e582326443f3d68e71d6320a9fcf \ + --hash=sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13 \ + --hash=sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e \ + --hash=sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e \ + --hash=sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973 \ + --hash=sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527 \ + --hash=sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72 \ + --hash=sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890 \ + --hash=sha256:6a8dddef476fab96d066d578fc88526767b836ab5ab21754e1d5bf3879c31c7c \ + --hash=sha256:6e192623c49c94421616a5778fba35cf0d5a8d000650c1967ef4448ee5cdd990 \ + --hash=sha256:7225e4514edb64eb6740324353e0da0711954fd8d7da4576755b1c6e09b697cd \ + --hash=sha256:75f80557d1389eddbd0de2681f6a390a0c5338c31ddaa821381c203fc3fd50d9 \ + --hash=sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94 \ + --hash=sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3 \ + --hash=sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80 \ + --hash=sha256:7ce713ace7c0e4520535b42b77eaa742c16dab813978064913e5a3cf82973b41 \ + --hash=sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5 \ + --hash=sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c \ + --hash=sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a \ + --hash=sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4 \ + --hash=sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e \ + --hash=sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6 \ + --hash=sha256:9f8d177621de5cb38ee3e731eda45d421db093ec0739f46a5594babda7987a98 \ + --hash=sha256:a2d7755bef5a12ed488f4ef1f1b69ee9191d7396083b755a5d2295f6edb4768b \ + --hash=sha256:a48d62ab9d6f4f98c983223a547af44be6ca3691074c31cecced6facd3ba2dc1 \ + --hash=sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03 \ + --hash=sha256:a6e721d4b0e45d5b65e87534470e67b18dcd092c83f68fba09f152b9cbc061af \ + --hash=sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231 \ + --hash=sha256:a931079504ecc49efed7744c476a5c343a92fabf66dec2db95edb1b2fdc770e2 \ + --hash=sha256:aa9511c62d14da7aacc9b4bf51f3f697a621e83b2d6919008243c3aad168eea3 \ + --hash=sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836 \ + --hash=sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5 \ + --hash=sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399 \ + --hash=sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96 \ + --hash=sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e \ + --hash=sha256:baed1e86cc735622097354b9d1281406caf42ff42a886d29faa8e8d1630333be \ + --hash=sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf \ + --hash=sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc \ + --hash=sha256:c7659f22557c5a0bc4855cd635f55edec690cc008a40768527762cb9fb263455 \ + --hash=sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0 \ + --hash=sha256:c8d2c9fd1f2d16f780d15127abb050d13d1a76c03a4bd87d7e4980e45e511e12 \ + --hash=sha256:ca82be1a1d406ecfe1d25dc16cb33488e5a16bf4438c9fb590484ea29d92478b \ + --hash=sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7 \ + --hash=sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692 \ + --hash=sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54 \ + --hash=sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3 \ + --hash=sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b \ + --hash=sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be \ + --hash=sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d \ + --hash=sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358 \ + --hash=sha256:df913725b79db7bcf03448f36b7bf8815363417d5b58deecf9305e3e30f0f21a \ + --hash=sha256:e0bcb7e0f677f543555d2adff3bf19c05f66cdb4796e5ff602442ab2fe3c4ef7 \ + --hash=sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc \ + --hash=sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960 \ + --hash=sha256:f16c709686a78c727bbbf059f92b0bf41c6fc60deec706d2dc19f529175a6125 \ + --hash=sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb \ + --hash=sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a \ + --hash=sha256:f5cfbc5fe74540d335175b656c725d74d90e3730c626d92575eea35029d9afaa \ + --hash=sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf \ + --hash=sha256:f8ec5e643a9a937f64e1999eb9f75d072263751912dc5cd06d3c85f8f44be7c3 \ + --hash=sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4 \ + --hash=sha256:fcd22650c908d7b7da162bbfaab594a1227a15d1643a98c68b122ac642fa2264 + # via cryptography +click==8.5.1 \ + --hash=sha256:8bb5376d2006950386f8c6427613334a2acadc5f559cb80e638d00b4df957e37 \ + --hash=sha256:9bbfada76703fd1d784b83eea012e3e8c6a001a876543ef104fa56aaaeb072b4 + # via agentrust-trace-tests +colorama==0.4.6 ; sys_platform == 'win32' \ + --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ + --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 + # via pytest +coverage==7.17.3 \ + --hash=sha256:0241e03dd65a1edf2e841eb19d8d72dca21ada5c869dcef6c9fde1b166d519a9 \ + --hash=sha256:0837b71a40749d9c4016cf8c51ba8c6153f7dd40cf4dfa287a2f28376fa50917 \ + --hash=sha256:0860a5f27ceccd53ee4070acc182588ed4f15b7401cdcca09d8c0cece9c2ad7d \ + --hash=sha256:095ad10d17a28c845f2e5f99e398db2f0c680401731ff63a3a1789f2e61ef1e0 \ + --hash=sha256:0bad8245a15bc7b15d26d25ece243bbf5d1b1229144f3db189014174429b63bb \ + --hash=sha256:11116ab42247d55980b51ab49b5c066de9b6baa56fe371fd555e54feae338619 \ + --hash=sha256:16ed46c0d461a3972e8474268c22bf5d88cdd1088435313edc7e220050c5ac97 \ + --hash=sha256:17a4bd9edd312744035e1298a6ac30dd7332a7f1ecdc63c9eb0685589b161eb1 \ + --hash=sha256:1b358585003cf99a13d1327e11582af19154d2cf3dea366fe0d10ce479a5c9f9 \ + --hash=sha256:1ba5c445d4c7718422753a393bcb0feb6d9834321cdb43dcb585725a392b3edd \ + --hash=sha256:1bbbc3e4de867a5e75684d98fc77c20e0687ca3abec69b4421b6f3fb96cd860f \ + --hash=sha256:1d26daefd513c4775a6d06846389da9a9e3498b6ddba24982359b75b703dd341 \ + --hash=sha256:1e7a015f952798d7d5120e8122c160fce7322b0b9d144b9be6af71552a3e68da \ + --hash=sha256:203aa5e42c88e9accfa18a0cc91950499efaa5b179a1da14bcbf5b995afdbcb6 \ + --hash=sha256:21745c08f2835b847a16887b748d3084dddeb0571ae2a0d62e33644413568b99 \ + --hash=sha256:222bc51858b0f64cb15d51380541712f8d5dc9bb5ce4fd9828bf466503d6debb \ + --hash=sha256:228f4bcecadcbb1ec3ed088b0595c5c08f3fca01406b72e8a02209a3af16aff9 \ + --hash=sha256:22a80bbdee3c22fb3319befaa112a2ed2d6e1417aa75c310f048235170ceca44 \ + --hash=sha256:24389d7d50f1fe98ac8d8ec1c946656a75b97d953b51a714484e174ed9f48eb1 \ + --hash=sha256:2765261bdcb5f6c01af41d97ec4fcfe18acd1114d8d2690536a36f86b67c179f \ + --hash=sha256:28b05f6b2622551805324196c32f3f20f4fa639bade8ac299ca83073253f6663 \ + --hash=sha256:28d082105e1ead78de56eb46edde029b5af88e22f8bde74fd092ca164bf15492 \ + --hash=sha256:2b9a39e25bf0e6fe072c6f3bceaa02f5303b9f975e83f590d118c4e92aacf6d8 \ + --hash=sha256:320a27997b421ea16eeff42cfd26d40584abd436fb7802ca766d6e8610bc9718 \ + --hash=sha256:349ab42e0b6b72892f187a60a0890b3a76710e93b7c31579e81648d46230a8ed \ + --hash=sha256:35137f71927b7da9292d391409104391b73c5e80d26b6a0d216d871964092351 \ + --hash=sha256:397e5342fd4f19ae930a5234643a63a8eaccc18a2f034a2f1765a5313123489d \ + --hash=sha256:39c063c038b710e0bca3afd4997ccee680674bece468fac13cb8aee9af530d31 \ + --hash=sha256:3a5691ef42b16e22976ec0352a76a0f7c3b4196fe3d39805dcc765e31ce54f22 \ + --hash=sha256:3f6d942e066ca009bd1f7ebf5450287a5e9bfc5a6e20a8d8c408a61b433c7f94 \ + --hash=sha256:42a1f511a334745a66b8f580c4d561e728243e35f3ada0ada35444c4b2fb9fa9 \ + --hash=sha256:4300ad360b21af19584c4cc82022979544d776ba2fb2df5418b2f3cae1eee6d2 \ + --hash=sha256:45268757a45946ab3fc9d2c30019aff2d3804ae660121d5b31f523366f604e67 \ + --hash=sha256:47cd7674a39bad6480e565e2a5b77f8089ebfbcd3aacc572abc6cebabe1f4cc9 \ + --hash=sha256:47e49fced11190fdc678182b0e7f8947db4fc1c1216094923a1d2bbedba3c84a \ + --hash=sha256:499acdc43bf1addf7fecc59a3123847bb96873c07001cfbeb709a71b181fa03d \ + --hash=sha256:49a4f12eff115fc2447d3438b2c08d7e5adb3abc811c050ee508f8189718cc5d \ + --hash=sha256:49fff24117050f1784447ae8181e75a78b01cfef4b6a8ccba676d466d1d68d9b \ + --hash=sha256:4b1300f07904db81508b87a72471e80d37fb6d48debf1168e12edccc81cd0225 \ + --hash=sha256:4d64248cb7c995aa66dac34c66286c80fb78b13c19bee1503720cc6e55e5de17 \ + --hash=sha256:4dc3c84002968363c37688e0b325d51a51816c53f3c0cbb925254317c675a789 \ + --hash=sha256:5559549a14f997b261c936ca463ed67e030511f914ffd1692ad08b3b16ed6034 \ + --hash=sha256:56b469b63d8270aa67bc919ab8457f4d83115459556a76d09238052a3ab094db \ + --hash=sha256:582c5d80b6de5b1909a4222ec1f5676bb2e03815c6be9ff43db2d8a71de5079c \ + --hash=sha256:59b4bd56882387b5a957048a77531669d53d641ce8148c23149d2550e9fd4e25 \ + --hash=sha256:59c15dcae783ed291da3af6be2e70762322637ac886b19671d12123521cf6ac3 \ + --hash=sha256:61138b3a51d91ee443b04962ec9990fa140208a7a082b1754135ebd1378a420f \ + --hash=sha256:620fb331a7d94e3749348cb4a5febcb2ef23ef17192349088e80f4da0cf42647 \ + --hash=sha256:6695d1bb2a9a2fbd7806d69d78cf30f35eb0f65045da0ec5b5045242fadd6a78 \ + --hash=sha256:683a204e9773f3127ef836640712270bc4893f10bd7e1ce8a21735dca4c14429 \ + --hash=sha256:6a8db4bf69a1982cf0fcf16fb11ff17bb2ed3ade5b0e803bb67ad2963a7b1bf3 \ + --hash=sha256:6d116e2d3b3f3506f634cc48f58dd01497f34a50263e65acfaf6ad7a162f3384 \ + --hash=sha256:6f8f925262bc0d6fea12d5dde6998aa57f162e05d5a7d50b95d400ab05bb4537 \ + --hash=sha256:733368982d2799ff04d768916fb755e54d4ce11af3573488ece451745c90d4a7 \ + --hash=sha256:76a3ddca94ef96b477b7edceac08b1abe0ff26e1ebe1d7000e35bdd17dcde5c4 \ + --hash=sha256:7c420ffa993c25cc74c263e9c1c869fbaea7d16dcb6448eef4fa6f1905560f5a \ + --hash=sha256:7f02996b09190bcdee3b2af38bf2279e4a1a65306afd3e6c229029dbe41e42ea \ + --hash=sha256:8009572d242674765b84ecceba126c2392b1824b32f41db1f3323d23d4cb598f \ + --hash=sha256:80e219a51ef7ccf78fcd584257e523ece0d390cb3d9d3896660eac05a19ac691 \ + --hash=sha256:83510c65a385563646297e8dd572e5def63dc300ca08ae15307d99a0225cdfb8 \ + --hash=sha256:84b5a474040b33f3d805c0b19fadf5a2e78fdd46e0bcb8b813631e5cac64195e \ + --hash=sha256:86563b5323fc13239d943b22a1bb9ec60f9ca17bd9a0be09c40a89836697aea2 \ + --hash=sha256:89f49fa6890f28247135934c4d92abb16828124b2cddb681e2496997c37364fd \ + --hash=sha256:8a054b755bc6665b339a923fed14a54446c43c942bf4edf08a59b1225b284c93 \ + --hash=sha256:8a0aef07b2eaeee9d82ca62241d5c6586aed5dd729300507d2d3f612588c2634 \ + --hash=sha256:8b713613ed67d5ed88968799e814888b62c6add21f5becad2cae1ec44260e9d0 \ + --hash=sha256:8b8188229ab3b3769a1c4aaa22357447555416deb440326c665a3bd25fd45ce0 \ + --hash=sha256:957ba72e11d26b6e6e1abdaa72e41020871f4108c8ff64ff571fc50c81fb57a3 \ + --hash=sha256:95da285cf77352d4a527e1fd16c1c5c3762e42d1d71cfa9ef2c72a5c796cce36 \ + --hash=sha256:9e331bc028b44496ad85d4a2656dbad0feb35baf4a66500042c4aaa878ea132c \ + --hash=sha256:9e888603ea67c63ba264f39f3459f4cf68adc78dcd9f8bfa65dde601265a40f1 \ + --hash=sha256:a13a946d8de807d8992e56a09502952d81bfbb4b80204ef77a6a2a38b4ce22be \ + --hash=sha256:a1dc44fba727d1cbd8daa88ced7dd867aebef5631b116210f2a2d4da08622d03 \ + --hash=sha256:a5fa43619c0a53a0424783cc08dbb26a2115e3a890ab566fef811b77d04d5501 \ + --hash=sha256:b355277f181890fdfc7f49af89f398f8735f031b2f9a5801082e678e9ae85972 \ + --hash=sha256:b65db089de3f219c850f21a2ca915f43f6fa1da5bfb55871c089d3be82c10369 \ + --hash=sha256:b6876123ce43459a4b39d5778108010b06164225c3a25c6a43cb85a97f80c549 \ + --hash=sha256:b6db3399e76a366353dd0c9a009fe74c3d1c892de35863331c4d06fbe0dd83b8 \ + --hash=sha256:b7028eabf24ad18646dbfc6b352cece01779914e69254ddcacdfb9f805d89f61 \ + --hash=sha256:b73148d024d086239fc04c03daaeb1934a6d295312dd0d6a04a937326c1207d4 \ + --hash=sha256:bb2b2f47ad4cc671491c725250ae2a5cadf43a3b0f9136e78f7ecf9506a9fd61 \ + --hash=sha256:bdf8fefb9f1acb3e92842fb42e29968d053e9545e4e9d9edb5c32a30fab8f899 \ + --hash=sha256:bf7a43782b20951fe9ddc6f6c28da51c65d3c0d5d5fc3c5a0e566986aa3ec0aa \ + --hash=sha256:c38a85dde92c4129641544aca998382f7448a87a17d202765a6adb8a87a33fc7 \ + --hash=sha256:c45c4e99a09c70e7d6fe101f59fe4556b89d99bfc80cd4e7f5e13ebb6c1e4854 \ + --hash=sha256:c4ae9befec714c867f42bbea99e1ec25eecdbe51c8faf1cc82164bd65bf4db0c \ + --hash=sha256:c53abadc7c4cf7870865fbaf7204e86efbacf93354e010e9188007fe2882a073 \ + --hash=sha256:c769e6a28bb645c915449ed8ddf6059765a72d8ef79590bfd6202022a4441cd3 \ + --hash=sha256:cc12f44ac4d5d6be301285c0a4f9c4ae52e673672e284b2a2744e20d24025573 \ + --hash=sha256:cfb1d2c52bb66e847669000658a5394d50aba835df8e31c2146034f978c8a4cf \ + --hash=sha256:d0e0fc055d4436f4b6de83f50cbd9da38af18fb36341b162b408ad7842068a33 \ + --hash=sha256:d3353cb2ad4254fa433cc53d1ee1fe80eebde529085b238393f3f6d5af821f70 \ + --hash=sha256:d5a3cd933fdffb958b4046d6f19d3138c7c8a28c439aac800badf61fab6d655e \ + --hash=sha256:dc116b251f7a4ae0266dba0ef31a742c6c517d3a99b4d50016548a17d407ac5f \ + --hash=sha256:dc6f3c1406fe7e8e2d59eed1f476c5429dcdd11cd3fbe1341acf8ddc4bb9b383 \ + --hash=sha256:dcd518608b7f869838436ff8d922977e186d1082b9ddad37305ad5282186fd41 \ + --hash=sha256:dcd6ea389b3da63f467b05c0f47db037a672592ab2035d4bfbb1f662eef4f4a3 \ + --hash=sha256:df0faa493ab92bbf33ff8bdab442c5b75089baa5ba752844871b5ce9d009a026 \ + --hash=sha256:e033255f24c1df6e046b6c4e9f91baacae08426beb5296bea8d46176b3a137d8 \ + --hash=sha256:e04385647f444d55b483a0e4dc519f46134846eddd80910a0d0953ea19e58358 \ + --hash=sha256:e142166a52ec7edc650b6d3a0b9b1f79dac0ab8843c249e8821ec97a71d1fd2a \ + --hash=sha256:e266c693c8bd6541f31cd71eda9b5aa3732adecbd04522880ea3d23d99b202eb \ + --hash=sha256:e3948b2e5c3af0133af3e117ee033e6cc656c43d7549d3296e4b3807908dec9f \ + --hash=sha256:e4d18e90c87621590a0b1cf2e4caa96f0aa511073f8a1caa3244e09e569564cc \ + --hash=sha256:e592f790fee57e2bedaa27cdc76988a082090d1aac560ca4bbea80a7a58436ec \ + --hash=sha256:e9396d4d90fb47a1e124a985ac6a3172dbd58334d1de5189f06b75ae96ff69ee \ + --hash=sha256:eb25b51a30d07db8493901e3040284f2e756ec2b6549ee392798b9ef4c0607b3 \ + --hash=sha256:f3347c72d0f4cb3803f4ccdd4331a49a90ef2daa683ce89e2480278400bd2eee \ + --hash=sha256:f7ff8b21efcbdf9c7a6c051dc158c9bb9e938b7af33e55ed264d2e529b836d17 \ + --hash=sha256:f8356475aba020621f8277f1a81c2dbdbda8286c7c6130f242c9816e044062a9 \ + --hash=sha256:f848ec842cb95fddae4b88830b249e8bade41697f16909688d2af80e8b51e7b6 \ + --hash=sha256:f8f6252bb4c457d686c18e42965087b30155ff72b0dbda6e79a43ee3682c0870 \ + --hash=sha256:fa8903475085973b5c916e8a958afd22101b9559880ffbeab5aeac4196768338 \ + --hash=sha256:fab6f713a1f2f0ab7fb7d55f3aea15d1f3fbd31ace61b585ecd87c8e34f898fb \ + --hash=sha256:faee34ea548318f6f9010928edab2f91b36a19b58376e69ab0e76d4f3a0bf9df \ + --hash=sha256:fb5945d7360fb258dee758258d93ea624a712fae494e7a0037a92505b3eb8b32 \ + --hash=sha256:ff0ca078fe63faffff1cff24c804afd4010e35d9c75bb593877b3d4321826c91 \ + --hash=sha256:ff273110e4e1505ef7a642523ba43f58eb6770ae9e8f869d72efea816cb4bc2c \ + --hash=sha256:ff5069e99039739c2fade5dd12cf8df7dc1b1217a0b915110605e0bbdddf1187 + # via pytest-cov +cryptography==50.0.2 \ + --hash=sha256:0ddc924c04591c2811ca024d62ecad4f7f6f08af8939c211438f48a16bd23602 \ + --hash=sha256:0ec5f09541743261e66e291b4a0cbf0fb2997aeaab6d9e9c740b9dba1b58d1c2 \ + --hash=sha256:0ecbc5652bdb6fc9eaf89a7d196e20941adfe812f43bc4ca05d9150496821047 \ + --hash=sha256:1981f1db4630889b9ef7803fadef12b056f428cb6b85c27ba57b774793b6093c \ + --hash=sha256:1ba34f04897fcdaa73f74145c25f3ec146fbd56593853e88adc2e811303c5f42 \ + --hash=sha256:241449bf940a5d27309bd317e6f9a2af6932113818bb2b8f5c59ddc7ef16da18 \ + --hash=sha256:25784ce8b9621c90c643efb9e1e2162ab3b0224cae446ad5e70e7fcb1ce18b51 \ + --hash=sha256:3dc4fd8058cea1644971207d530e1a03a184a805ffc8ebdddf0599d78a331b81 \ + --hash=sha256:4061c0079120205fb760c58acab6443e217307dcf05e3702cf970e0689972856 \ + --hash=sha256:4a20ce1e5cb4284a86692fdcba7cb8754185c6b2e5c56fcef3751cf451d3cdc2 \ + --hash=sha256:4e81d95e5bafc2d6e34e4bed780e53e4d5b9a2f928573428aa4d35fbec1eb0de \ + --hash=sha256:58a0c478eeca76fe5e07993c5a0703def34a6dc6a0cda4f5564639b33112ffe7 \ + --hash=sha256:58ddb5a8e3179d12f19e4ea34d2d32e9d63a4baa142c875c1eb59f41b7243acd \ + --hash=sha256:630ebfea3bf689d075f82316324ff7433dc447fe6bc1bfc76524b74b4a9567d2 \ + --hash=sha256:6f8700550aa1474a91e5dc07049c46f98b423b5b1ddd0483e0b51362eeeaf5be \ + --hash=sha256:78198641e5be9521beea5aa782bb551a58068d10e6eb04c9c680c1b69f2e7d45 \ + --hash=sha256:79def8d059362e7831389ed3be0ecdf58a89386e1271e35dd9f5af84e81bffd0 \ + --hash=sha256:7a8701d6b584d76e909e3d305b7d126b41439876a5aaf76cddc67fc230eafa2e \ + --hash=sha256:7afa5a6602a9f29af1f3a2965f831bae7c9d5d597b7cbb716d41ab3b7d89879c \ + --hash=sha256:7b46165bb56eb4704e2eaaf86f3c940d19154535d9b0ca7d6d590b04060e00d5 \ + --hash=sha256:7b75de3c8b3be1cdb1052747c929440c3eea46c1bc2cb8a6e3a48388e9b7b452 \ + --hash=sha256:7c6d0330c472d96f6a6afe24d80dfdf15176c33096f0a4397ae4c60f3dd3be48 \ + --hash=sha256:828d49b0ff5a0e3975865571c5d91dbbdd0d38d8289b249a163e9425413a5e05 \ + --hash=sha256:84f964e537f916e2cc85199e5a88742e964939b575ac8598b3f9d6cc416cdaf1 \ + --hash=sha256:85d0d9a31b9098e98534226d5686b47264b95e62ce459dc2e62fdfc809f9fe93 \ + --hash=sha256:87e9ce85beb6b328ba370cc6e6aea483c92617b4c95b1d33a49297eb662bfb04 \ + --hash=sha256:8c71ba2cd31fc93748c38e1b613200ff1c2665cbfd5341fe3a61cfde35a1430e \ + --hash=sha256:92e665960f25fcdc73725b9cec7a3824f279ba97a98653afe9ffac2e43668f67 \ + --hash=sha256:94e5e9f108ee10471288214d3d233fbfbb492840a8457eb85178d643ddeb32c7 \ + --hash=sha256:9c8402a82ea0dc4ceeab793db05f0fafa8ca139ca34fcde5df0f596103c74107 \ + --hash=sha256:9dab55f57c74c3cad24c323bacbbd04be4705ba6eb0d92e920b1fc4837ed5079 \ + --hash=sha256:a582ab2ae1d34f67112cadc86702774c9ea4374df6bca6afe672817203c99134 \ + --hash=sha256:a6557e5f38e065ca9fbdaf7cfc7435ecb1d113aa81a022d1b51921ee7432e227 \ + --hash=sha256:a9f7355e6fab51f6c369b86fb7571cffa05edee2c2121e0380a37fb9ac1cd5c1 \ + --hash=sha256:ab50ee449bf968271e820086f10a33d101dd060370abc10bcd22279be2656539 \ + --hash=sha256:ac9ed99d81760c62fe89d5f0815cdfa1ba9a35141cf30f1c2d044f04b4803d2e \ + --hash=sha256:b13478603dcd0a2479ff8e87e2c19a7d525734686fe3c49542472293a204212d \ + --hash=sha256:c423ab384a46c4dff7217b2ea5ba2e11cffdeab6441acd04cf65a369caf0366c \ + --hash=sha256:c5e67125c7dca78d199ec4e116aa93dbb83494808ecbb8211a2cb09b1bf41dbd \ + --hash=sha256:c71be1cbfa5cd9a41ee452acf1eccd82b2c05950358b106ec8ceb83411d1a020 \ + --hash=sha256:cbc8738fd8526d80f35cb3a40d41f41a2e7030bb3b18b09a6778ef63d291c2fd \ + --hash=sha256:ce47f66801c20ec6c6632453bb5960fe38939e9306970b48b3a5a26de7745d94 \ + --hash=sha256:d370b8d1dfcdf7130178137f6fbee6140774a1acc6cacefc4b42643ec11d0a3a \ + --hash=sha256:d38cdff612d06fa6a32840d5e1b1f7a27cee4a349aa9085d94a67789d6bfd408 \ + --hash=sha256:d8947001be83df1394050758ce0e745dd74fb134eef0a4b5124208dfc3a68c37 \ + --hash=sha256:deb9fde5c60e437ee4821bc9bc39ff31b42135c27e1dc61ef0a629389c1de62e \ + --hash=sha256:dfe9763530994147d9af1def057a5b9658b00e8f8fe8743d144d1e0911c2e454 \ + --hash=sha256:e105ab60406787da31fccc883fc0f733af1efd78f0136a4599692c4083a73d0c \ + --hash=sha256:e275096ea1e60cc595cda2836fd4a6c725d1125108b868be17f53684d164e2cc \ + --hash=sha256:edc3342adf8f697fc5f59c887a304356f147b397809440ed64e2fa6af2f50f37 \ + --hash=sha256:ee247f5c245c9a2fe7c8e2214e295918838e44e00a45a6718451e4004219e767 \ + --hash=sha256:eef4c2f3423810b3070ab391f85436d2f8bbfcb286ac15cbc73190b3563b1f1a \ + --hash=sha256:f21e8a22c8605750c7af886bab299a363721264061b4ac0a30efb73cfd58efc5 \ + --hash=sha256:f265528741e048bce55c3463ed721fb0aa45a5888d8add8cfeccb3035451bbdc \ + --hash=sha256:f2f9bd7f90c64fe89253f0a2c05e3c4856072660429ce8831b4235bf29403a67 \ + --hash=sha256:f785f6161f202ab04d8ca194158968798e480ca058943907972da5f12e2881e8 \ + --hash=sha256:f9f6143a8c75945eb960d9eb98905a441394abfa24afaae239d514ffb2586480 \ + --hash=sha256:fa8f5efb344d6908a1ce62f4a24e2e5780f825d6f53f5f50ec5ffacac72936cb \ + --hash=sha256:fdd28f912fccfec1846a94e2e1e8f9b0012f557f0c46fe4f3eb0d7a87afcf90b + # via + # -r requirements/wimse-cta-mcp-guard-fixed.in + # agentrust-trace + # agentrust-trace-adapters + # agentrust-trace-tests +iniconfig==2.3.1 \ + --hash=sha256:67f4b9c50da0dedf52af349e7749a80a9057a5031199791b906c3bb3ae878960 \ + --hash=sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7 + # via pytest +jsonschema==4.26.0 \ + --hash=sha256:0c26707e2efad8aa1bfc5b7ce170f3fccc2e4918ff85989ba9ffa9facb2be326 \ + --hash=sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce + # via + # agentrust-trace + # agentrust-trace-tests +jsonschema-specifications==2025.9.1 \ + --hash=sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe \ + --hash=sha256:b540987f239e745613c7a9176f3edb72b832a4ac465cf02712288397832b5e8d + # via jsonschema +packaging==26.3 \ + --hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \ + --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c + # via + # -r requirements/wimse-cta-mcp-guard-fixed.in + # pytest +pluggy==1.7.0 \ + --hash=sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec \ + --hash=sha256:d1eaa46ebb595891b860ab086b4d09c8588af65ebd4361b8e8f4bb8920b90ba8 + # via + # pytest + # pytest-cov +pycparser==3.12 ; implementation_name != 'PyPy' and platform_python_implementation != 'PyPy' \ + --hash=sha256:a076f3f489b39b43ed13563a1dafe42447445bec2e294154ec5c57fcdda4c85e \ + --hash=sha256:f03387877eab82ce01bbdfd0ba7252ee55a90b1c708d5129e2ce915475cf1db6 + # via cffi +pydantic==2.14.3 \ + --hash=sha256:1054f237f4d4733e5a30e1e2333bd33a2004ab9ab1510bd053a9a31bb48e232d \ + --hash=sha256:3f7b347782ab7e4cf4c798496ae3a82787d9f21ec12676a9c564355eeef8daa8 + # via agentrust-trace +pydantic-core==2.50.4 \ + --hash=sha256:0001d6920e3a5d92758cda460d6dc9f918a78ad6d5d092f1c8b5395e6b775356 \ + --hash=sha256:0574866e05f6adeecc520d87e87dd06210c0a51706341f6ef8421572f5a64444 \ + --hash=sha256:09450778e3ab58d3f565899fcfbf6c82926e31af29e28e799d1d50941316e0cb \ + --hash=sha256:0af56dbf8822ba9f4efcbbfdc15478f8b6fb08f1609860cb50aa2cc8476b3c34 \ + --hash=sha256:0b059a7968b1911be5a2d9a8234827ab0bef9d1e465d4b42da525894143550e8 \ + --hash=sha256:0ec20aca2b067369913716847f7dfe5f4dddf16a46965b7a70bbad5defaaba86 \ + --hash=sha256:0f87ae9db5ba8d8de40dcb93982cf8dd544e6552a80d3345af51941cc2146b80 \ + --hash=sha256:1239daaf063e62213ca1f34d96663900bd7510c42a786e843fd328af70e46445 \ + --hash=sha256:13b6dd62b5279f5b9d72f3bf918a35443ee8bd549241d9dc52d79a2c3b6d7016 \ + --hash=sha256:15bece43a02ad543c621c8305e67dedb5f27d378c5ba741e5a2c36523f8ef37f \ + --hash=sha256:16902a147b3da4840612164a5e67947104d63e978f7a57c395877a5e26690b9c \ + --hash=sha256:1afefe44ec042fbabfb4483ea258c04cf75ff4ff328d754f09b321fdaa232aca \ + --hash=sha256:1de7be9a66fc8536770481ab64a05aae5067c725f2b29a09543af00e6a417b97 \ + --hash=sha256:1e20cbde2b6deb33a51d08cd168454dd9044ec7d4474056f4d98d63f51578783 \ + --hash=sha256:2039e323acee9abfec1fb5f661776e8965fe5928f3b7f8431900a774cba5c317 \ + --hash=sha256:219114f8dcdcbe4720d82ef016b1287ce5a0a67d7c69ca61524eb72e82aac344 \ + --hash=sha256:22e874666bdbd96d6bf629d32cd8ab376fedf1fd62585b52a42b9fa9fa6c20b6 \ + --hash=sha256:23a9ba564b2db709ff16eca990992ba95a19069972b34bff87c81d4b473cd755 \ + --hash=sha256:25e7e1080f9f7ce7cd9d114b31470ce912771bd02f38c824721d3c35d312abff \ + --hash=sha256:26cb012c4b8ca9f847bd0ac15978bd3d0f55b050bfbe6c47355edfc7e945029b \ + --hash=sha256:29358a8ca74e7d81158d14e2b10c904bd18773293ae3788716c0626fe0342347 \ + --hash=sha256:2980a701be88f9128a7470189fa3bcda5387f76c298a6f8e000fc29eb2a6f4e7 \ + --hash=sha256:2a60ec2a57ac3ef3767e526e9bf706ec75aa3d79c4ea134d9d4fcf7c62a297a7 \ + --hash=sha256:2f42584e5785385f681163a42506cab0d51295e17599a648396c52a7046c1372 \ + --hash=sha256:2f5cc5bcb94063fbbdfd285a2b302da34af07491337c10bb35de1d5220fa1583 \ + --hash=sha256:2f6767122b37c780bb756a720a4eef2bc6a050a0a1143428834b3cbc89448bd2 \ + --hash=sha256:300753f71c73302e218124baf995f00058e085cd01869bd9610bcbd0bd4500c1 \ + --hash=sha256:30d4dc35bc0eea52202a90b3820445ee0072c820241bfa710a623a078c9b267b \ + --hash=sha256:32a991aebd165f227b7c7c60bb9d66c2c7de9c24308552da264c9938fde0f8d6 \ + --hash=sha256:32d6dda86383645ec428ea64dfc277036f5cbc60a72238eab28b91a3fdb9a113 \ + --hash=sha256:33b21f69540a12c2053cd1d95766d8bd9667a3897f7c712a642de8aa37eb0865 \ + --hash=sha256:39f489ce31272073e6e146f6781690f9c1ee8c126836e6403361ef91154d89fe \ + --hash=sha256:3a48a5254d15a0ad050318bfc7a9566d4ec740118187e8f303e47a6840287eb7 \ + --hash=sha256:3b8ee2589a082739c522c1fe4be227412fcf108b903abb6672ae2f5570558882 \ + --hash=sha256:3de6c2a4df2af0ac9ab4dc1488746fe8b1a90e27955d870d9edda3187d20092b \ + --hash=sha256:3e0b395648c6cb871bceb2906907f255dc876ec425f2d5b024e129985cea8519 \ + --hash=sha256:3e547ceec1da7382f01f9e13963023e53367a71802c88778b21b9645a077cbdf \ + --hash=sha256:41b2cd8b29dbb5a4c9828a70f50d1abfc92011115c813213d3a91205c6f731b3 \ + --hash=sha256:41f4f8ae714e4fea1d635880f8a1af715ecf080eed4d13c5b04a0f3210f9c61a \ + --hash=sha256:474f7e598c7902165662a5d5160d3fce31037890a2975a9871ebf7c05862300b \ + --hash=sha256:477af785d1846e4e96bf56983b92ea7553aaeccdeb8acdaa55c7cee9eda0ae32 \ + --hash=sha256:49eb1241a969a5994db6880c18c012b6cbe2340343d8f529721571806583e500 \ + --hash=sha256:4c29b8f2d6417069bb1f257e6b9113f5d64dc2f554cc200ea90b4fe2c5cdb733 \ + --hash=sha256:4eb15be588407148ef5937dc8d9256a71f6b115e6cddadb7aa20b6ee384680dc \ + --hash=sha256:4eda7e3fdef382b7d4492745988a5baaf6953923a337f8b9dde5f76fa8afde20 \ + --hash=sha256:523466eba8ee10f7480f3c2057563145978011c583130d2cc01fb1e7af808e25 \ + --hash=sha256:57fa0a9490785139f1a4e4f43891830d55dfe4408845c0c9cb5eff4aeaf75f69 \ + --hash=sha256:5b26e5f1793b96cdc60242bf38da86ff24a27a708aa396214cac9b534bf571c7 \ + --hash=sha256:5bc1811ef2b4d4ba63e8e452f6e332b6374bd1d2cbbfdf66826c8cb1f71dd10d \ + --hash=sha256:5c074454dc6d4f6f4ba6561a56bf33a14db7651d882a5a5321ba3ae8868e082d \ + --hash=sha256:5c1013647be741647895c102831dcf79c34209662dbb683df9efb864417ed7d5 \ + --hash=sha256:601fce6cea9ddeaa85329e12e7f351def38d233075f42a3012b9c48071b02941 \ + --hash=sha256:6118e5a5550e36582e19bac1a403711a748f9f18251b054c326d3db02aaa7a18 \ + --hash=sha256:629eae995185540406e3635df5d5cf1d44f19ea240840b835d3f44541ff694d8 \ + --hash=sha256:6348ad12fa741bcc9c2f173e99fbf27cbc038826d8c31a4a7d836eca27878ba2 \ + --hash=sha256:65376dbe1ab4dbc768ca2b72b7c13993562c035f5925fd3bc7ff9c8c585c515d \ + --hash=sha256:6619d49a89a15cd04334f76fec530c155923bfc60da74ff5d815a52629e1aa6c \ + --hash=sha256:664e74848c2f5fc27db8505fe24e1ecd3ac669412913bf73d176916f86cc08e2 \ + --hash=sha256:67f7cc397e1d5556a801d1cba74de0d27d827eb242e6c036c0ca273c745414f1 \ + --hash=sha256:696613a0c0e7b2b35356e389ba4195ce20cfe7a2fc2e992c87d974d973eabec7 \ + --hash=sha256:6c5687b59b6ba0f663c4f2f15470f68507d6b45ccd3a19ee6d224f95cbee70d8 \ + --hash=sha256:6c7d7b0b596319e9ce79ef96ce57a14054a2eac629c0588a0539187a218be799 \ + --hash=sha256:70dbc9f83c41f37a4faa62dae5203853847223a891da446f48ef2efcfd5df806 \ + --hash=sha256:71395a43da5584bb70556f380387e15f845c0dcf76373c1afbfa0025737576ac \ + --hash=sha256:71ade6d2e445839350d589ff99bbddfde16f3f32db28da5c894a09f99c8b2a03 \ + --hash=sha256:71e03d2ea1a221d020cfc5b6cc8bbbedef23a06704c70fcf4d0afb42965b22d1 \ + --hash=sha256:7210398a1607ad607dc73196e575b3148b00a333cbb602ddbe1b60ba54554f43 \ + --hash=sha256:7472c39480ccc11dda69a196d1b7c7a6b48eb6594b77f05d945599d3e47f731c \ + --hash=sha256:7646353a5a7c553c04167aca628e2550b538f492765b03ccf34321a560acc43c \ + --hash=sha256:76e0065998159244ff4c097a6c05ff08019c6fbb6e597a85846e73044f0215b3 \ + --hash=sha256:789a6453e5ffd18a7ab6b8c3a0dd8403053829197ec258ecb90c604c21ffcc99 \ + --hash=sha256:789f88dea57841cdebef392b5d6e90444d767117e9ff2e0d9172df5c9de6690c \ + --hash=sha256:7ac2769a7ddd661e07e26c12220adc31b17014c48234b2a5a88993b8d4109e09 \ + --hash=sha256:817953730e4a73a09008b010c4a42396cefe799616a22df2ac21d3927b3080cf \ + --hash=sha256:83d2beac85b757bfc404c5c0612df51c4ef33bbb7be65cf4a96b4da7cbc4ff4f \ + --hash=sha256:86c7c4615634b5c57a79770f5b738354e45ae219a89949aeae84f19169a05283 \ + --hash=sha256:8923fcd49f875e8a0448d7223d1fdf1a9973ae2d1f20d4158753ceb8909facd2 \ + --hash=sha256:8cceae48ae7f94990c2f4e36291e9ec9868735e8b0f19e4489a17b0422338466 \ + --hash=sha256:92f8f63df729061bb14558ed740e7a222f6e2aa6c2e6a5bcfb4e706676562049 \ + --hash=sha256:930ad463d3fb7a340d323bcc496ec32dae469ec9974c29ff569f19806b6b03b4 \ + --hash=sha256:94733cb447c37b0ce6f71b39ca1288d5f966a084023a5617b4cc35a852586859 \ + --hash=sha256:9be1cfe715ecaa060ffd5d599ef410b94ef2697a0eed4cee562f788a2aa2175b \ + --hash=sha256:a0c5210d038418a115e7cf8706bfa611bd14add2f5787274dba45aadca3155e0 \ + --hash=sha256:a2f8716344bbbd10443391be0b1f2003b34949e3c4e6883005c2bc498ab6b64b \ + --hash=sha256:a4bb174bd65f795c39ad6642d9d5bdc43351b306b7d0a654ab0d0abb38be245f \ + --hash=sha256:a70d5effebd81ebd8e15a8aabdc7980832367b2b00c36543bac378977004cc80 \ + --hash=sha256:a9ee990bf2cfbd81574c5d4f9f6c9d480a14b5b43d2c4f2ca13f4c6f48089394 \ + --hash=sha256:ab2822bcdcefb54d1e8ca29f5e3ec3afe160fb794bb3a3a73b09d11ed2671104 \ + --hash=sha256:ad92d255a165cde5f9882ff69699eaf5495e0a1f32e97566bbbb80f11e46781f \ + --hash=sha256:aead3b74b68396bf0feab5d57e050b730ded7df55853c1e048a87e00aaf033c6 \ + --hash=sha256:aeb2e123cbf978a905e9f55155c1b8316fbbfa7cf64d04521fe174bab302d100 \ + --hash=sha256:aec3c2d741a8e3ee993de7f95f37afb51e31b169c95dbd29da4cf6688f340914 \ + --hash=sha256:b0cdb655fbd1562c2dfc9986f9103a106f7058cd0915afc6e656d4b1d73f3387 \ + --hash=sha256:b26f39a5be3cd91a2035818be3d0ffdf5282c3e1f5f53d3b80b7024021acee52 \ + --hash=sha256:b2f2d13239487cecaae98c9f4d5904ad0737643cdf8873c88ec6a78b12214f20 \ + --hash=sha256:b300a30304c4c6aeab03ed06809819d9eceacdd58441d3c7dffe41edfd006091 \ + --hash=sha256:b42f64825f5d750228f08318a9bf4d723b7ecb4c472aedcb3013c3ec2dc1f949 \ + --hash=sha256:b67d38e8bb0ade7e6e84575e4bb153fab35b122458077273aeb08fdf12be9d2c \ + --hash=sha256:b867f9fd183d76977f810c626d539265183c25b2284762893a31e8d6cacc81c0 \ + --hash=sha256:b99bed995ed7c41515c11fe2beb86f8a6cc298e5537cae2f736de2f982f74ef0 \ + --hash=sha256:bd46bcc28ed85d3cf71581b42d90b4ebd1f2062f81879519fed209f8a4d1cfc6 \ + --hash=sha256:bee28aab5a580eec673f7b68dfa8dece3dd37bd207ef8d22fafe23a8e9837296 \ + --hash=sha256:c04e9d920e2674f54651fd260a15c5d2843526c73d5242ee4311325ddc9573b3 \ + --hash=sha256:c4c5a1770ecfe8bdb6c6f09f8d81ea4de04f7efb012fac1efa4ad315dccc1fd1 \ + --hash=sha256:c733087ecf7dde06b1d071679bfd5f3ba03266ba77814c1c7253bc48c9adedd9 \ + --hash=sha256:c813ada7a651193acda85b6bc1cf12abd4b37cd25c7c6a75d7183512cc374969 \ + --hash=sha256:c81d98e27d9d9261909dcccab1ba5d6ea1c98b0bb9470e368604614fd1d36ddd \ + --hash=sha256:c81e35862aced259177a537ce1a6264c3a97bae1ced184ca9dc10ea754563688 \ + --hash=sha256:c856e439a9d54d514e81a7131229ba151cdf81df7c408e0f6c89340e5003dfe2 \ + --hash=sha256:c9e70012926e97069cdd09221861aff412aa94e4cac2e019055cdb79485b150c \ + --hash=sha256:ca83a32b2b41653d89f09a3d22b770bca96da72273bef8f7a68136bdd1e8b823 \ + --hash=sha256:cbf0777d54672990b10cb8ca9b0523499e182d7e2ea39f86b138519a902aa601 \ + --hash=sha256:d49127f137f871cde3c5650af33bbbdcee02679dae76e020902fa106f522b8ae \ + --hash=sha256:d690121e80ab16e623415351ab24713534d4e500b3cadff216409cb6826063d4 \ + --hash=sha256:d6a166978f22f10cb91413f70519861605219346decf65bc79008f9257c94afe \ + --hash=sha256:d6e3485a5e5c01fb5339c1ee3d4b9e21e2135a2a9d44caafb71acd994487ee7c \ + --hash=sha256:d7d406709ae924cf0b08b8282ca2f0e1c90526911d93bc040557cbc83b74c55f \ + --hash=sha256:d8201c9f9035520cdcc7dcad383b039ec8123969b87e01cf27c3dd883c02313b \ + --hash=sha256:da779ae50b46f3f7d1e1b5f362fdc0ad376a49fd55f6f3122dc2b6149936cdf7 \ + --hash=sha256:dcf2c7eaaa4cafe8e49b017e5bb49e76e084ab6f0cd712ee4019c812b5cf68b8 \ + --hash=sha256:dd8bed00731a21e3106e5dd6bbffb6c775a2c0bbc7c0c9face534d830057bdc9 \ + --hash=sha256:df1c174796cd63eb6b139f7daf783affe1f3ed659605850e843b24764c21bfc5 \ + --hash=sha256:dfcf6e51000b34f7026322cd9ea9bc340d745637e27e0bbc22f504b4f6b967ee \ + --hash=sha256:e498900bfbf7ddddd862f810440c09e9b81674739e8a11d619b40906dccd4a9a \ + --hash=sha256:e512c75ec5cf4475c1aa50ad975ecdf253f4963b06e152e1a11edd6de4010753 \ + --hash=sha256:e5bd109d095aaae989a0463d5ef0fcc43e9ddd5de125e656d3c119a79e466380 \ + --hash=sha256:e6b4b08d09054310a4dc389fa61ee22a7a5a292cb23ab8a985136ca8828bf924 \ + --hash=sha256:e6da138a1ecc1341c8b788a5ee822670b03788e1f5decf7af9d461de6e508b8e \ + --hash=sha256:ea2f61b0bc12f3592288503961b764579dea0658852d96a0b3d823614d808821 \ + --hash=sha256:ed9c0b6f236648dbf30d57e9f57e1f74878caafa04833a19f529b5ba5164b7a8 \ + --hash=sha256:edbca8789fd10f0de534b660a6b4c71f1fd18039679c918dad392ab044bb37e4 \ + --hash=sha256:edc17549ab592e33cfcaf285f047bb75fcd98f608aa9309af1187fd736ce9641 \ + --hash=sha256:ef8a9ddb2e2a4eae4abb72dc0710eca6c2726779b0664bd10c3ce9fcfaed8c4e \ + --hash=sha256:f08ee8248aad2d054e5bc4c73554d4505464698f6d754f16198dbc5764e9821d \ + --hash=sha256:f1d62fb172db35c6478c9323da34ff37d1f3d37d7d44337a9d94ba8c583e5730 \ + --hash=sha256:f8fd23653a252cefabea11cd041efd7b80bdf403e43a36dea53f9cb0aaa21f0f \ + --hash=sha256:faa4e96385c820ce9d7f7a623486e23d4134ae3c9ba2071e44e0ab5a5a5002c4 \ + --hash=sha256:fb2bb5b557080da398b866408117d98fe9731a12334afd0cdff221b458cdc5dc \ + --hash=sha256:fc04affef30be98c1f36f0c422a4061ef618fdc1dde79f5ad5458dd496fecffa \ + --hash=sha256:ffb616d8d55965839670301dc3bae3abacff560a7e137a89056058a8a9da4d96 + # via pydantic +pygments==2.21.0 \ + --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \ + --hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c + # via pytest +pytest==9.2.0 \ + --hash=sha256:07acdcf88ec174f907dc01af70bf52d49b014bbab03faeeade31c96b18c2e588 \ + --hash=sha256:97c4f3b1f3c7414aa36465e09b8220f1d03627993bd51b1282e193753c80557b + # via + # -r requirements/wimse-cta-mcp-guard-fixed.in + # pytest-cov +pytest-cov==7.1.0 \ + --hash=sha256:30674f2b5f6351aa09702a9c8c364f6a01c27aae0c1366ae8016160d1efc56b2 \ + --hash=sha256:a0461110b7865f9a271aa1b51e516c9a95de9d696734a2f71e3e78f46e1d4678 + # via -r requirements/wimse-cta-mcp-guard-fixed.in +referencing==0.37.0 \ + --hash=sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231 \ + --hash=sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8 + # via + # agentrust-trace + # jsonschema + # jsonschema-specifications +rfc3986-validator==0.1.1 \ + --hash=sha256:2f235c432ef459970b4306369336b9d5dbdda31b510ca1e327636e01f528bfa9 \ + --hash=sha256:3d44bde7921b3b9ec3ae4e3adca370438eccebc676456449b145d533b240d055 + # via agentrust-trace +rfc8785==0.1.4 \ + --hash=sha256:520d690b448ecf0703691c76e1a34a24ddcd4fc5bc41d589cb7c58ec651bcd48 \ + --hash=sha256:e545841329fe0eee4f6a3b44e7034343100c12b4ec566dc06ca9735681deb4da + # via + # -r requirements/wimse-cta-mcp-guard-fixed.in + # agentrust-trace + # agentrust-trace-tests +rpds-py==2026.9.1 \ + --hash=sha256:00ba2d8c7dd4ee537978ddf4b3fbd712bef2d8751603f7f3146b3f4287768e25 \ + --hash=sha256:01445c8d194aa032a08e944f16567672da1c62dbdbefd8b6d0693032e290cf68 \ + --hash=sha256:028ad274ea951dac64491b5d1e65712a4aeabfdbdb9fccf797b57bd899b0c495 \ + --hash=sha256:0483515261947e4e8b8e1375bf7463e7eb6ccfb3d86e7b554d90cd5285f20f32 \ + --hash=sha256:068c37bba854ec2fe42f7365c640af11dd9895890ccbf2df5070d0c059bd7f96 \ + --hash=sha256:074a4d198bc34d9a8ea425114fc3ded6d11ec01f6a314a8db67454a5152d8834 \ + --hash=sha256:07deecbfce94c78473018bc7d10b337cc651d12df87a1eb2cb3e4024bc9c33d0 \ + --hash=sha256:08dae4a4095150a7c4545a1fb40b98e1ab1744fbc2770d92c977b9dadaa49ab6 \ + --hash=sha256:0da298fb372dc192610a4b9ecbc68a0cd8b675bbbd1fc519d01b41cfd658333e \ + --hash=sha256:0f045bb053c9057720d72c56dffe30dffdc05997b2897a827b9325f0ab6623fa \ + --hash=sha256:10e208f2425d973938afcd56e28a7c4be32e27b6a60b5d381f49fb9d8acf9759 \ + --hash=sha256:136a1c3fe4402b7008bc81cb62ee538481795b61a7e83df88dff3b3f02b726ff \ + --hash=sha256:159a7aab5c5e8b112c8830f54717ce56da1252ebdbb526f5be2df2309280b9e7 \ + --hash=sha256:172e47169583f46ce118cbec68e6795d0da0f4606b488b6434f8276bca0a058c \ + --hash=sha256:1c2d1f6da5128eabf34e963d7163a818846075a52568250d006c4c953b40f903 \ + --hash=sha256:1d55198263bb51f557550c6ed2e6d1cb6a6fed6eb5c9120b741c5926bef8a45d \ + --hash=sha256:1d77b649e6f7cdf12ca5c2a98dad0ad37f9ea9b6f960408a92f0cb12bb3d04d9 \ + --hash=sha256:1e8d4d79d828299bf44a55db22a9388ab967b49d17132c88eab0f4360b48da8e \ + --hash=sha256:22ffd29a63d71fb1b81552c21f2c2b734949b7ac751a9be70675a939a900839b \ + --hash=sha256:2693b2728bbcc48d09a981a356954b0c47c53ff25b545856f28a889ea619f69a \ + --hash=sha256:270bdcdaac5d5b6f73c5e22e7e135c7f2a50e789f71d9e241d5be8d90026e19a \ + --hash=sha256:2711d29b653b3bce48a63d18b9c6b53274669e6d6c4094dddeb4d9a0e45128b2 \ + --hash=sha256:2c16ab111bc27c646ba8aa005d0527754edc538ebb636f0b1bf8e244b48d1945 \ + --hash=sha256:306ee1850d8105b5baf977e78d45fcadd12c1a54678d614c9baf217708446e91 \ + --hash=sha256:3231c4c0e521dafa5be0c9f114ee2c2ad46650836f2d72caa86801950c3e7044 \ + --hash=sha256:3890a6aa36e6baa53d5258a2a25d3ef8b37ad165a6ab27a892d7c3e3a432cd69 \ + --hash=sha256:3a72c11530d71abfb66c8d7696a2f86c43e63fca8b948f1a784ac490f4ec688e \ + --hash=sha256:3b5a6f40f0a1486b4b36c888123afc67acdbd9f33235927acf5ff295429a0ba3 \ + --hash=sha256:3c91c210ae7645626c608400e3519b4a642f837cce09ca830db3beb2e9f274d4 \ + --hash=sha256:3cd182d7291d29b92c521a0069d9c01ba6193628a9a105531d11b40a6d731a33 \ + --hash=sha256:3e524c7874ac72884d28e16dd5b8d839fd09e0fe76b020d3fbca23212a7b8c52 \ + --hash=sha256:3e93b2cd69a9830be33e03945cd7cda940a0a8bfcfbff41d6144f0cb0d3d8bd9 \ + --hash=sha256:3edae8c5ddfdb6985d49ae9d150516e5076888879022f91a26c2de9276ce0bdb \ + --hash=sha256:3f0e9ac28fc067d4d34b88ae43c48e9489455c97fee9633d851f7eeed5a05d35 \ + --hash=sha256:42e75466f83cd43f6026c81eab74246efb2bdadafb307b85700632d06c68f299 \ + --hash=sha256:44b32a7c4f0da3d28af31c259e38ddcff096f855e205ed0671d02fcf44f1ea1c \ + --hash=sha256:457866b85daf5034296666168b84a69e0b2e89dc4f1af102b46f6448a60b9063 \ + --hash=sha256:45bc6bccf78b20fd834237d18db64965d7ee68ba7f60440a26c7ab71e7b8d51a \ + --hash=sha256:46d80bc76b51a6c24f9944368c28d38b8bcbcea1da4f2f8d3ebc31a67e8c6ec6 \ + --hash=sha256:4793ef7f78268b124b73fa933440f01d258bbae01de9fa53e9080c9ab0425a12 \ + --hash=sha256:492e5e428cbe126221611f47e068f01660352feec4ad18bc0f5ea9b2ae88fb14 \ + --hash=sha256:4b26b03d9d2658ee2fa234f8f4f19f38a09773fe5261028025032e26d4d35af0 \ + --hash=sha256:4c0d2cb595a420b34d5086db0add011e26e2c09d6a024afbac4228bf8f863a30 \ + --hash=sha256:4cfaf02209061880210819934de2f4f6aa83dc04dafe6770276acc240a56da31 \ + --hash=sha256:501909f2e4a1e2dee528ef766fe3c469060ebc17e54a8383d404ba07a81a6f02 \ + --hash=sha256:50906f5aea24b5a865cbd0a589698288631d9f3a54c3a937c83aefa95a0d14af \ + --hash=sha256:54ac2158a6f96cfbabff0b2eedaf94b90c5ec7ca8317fcadc61e1c2b2e0ff6ef \ + --hash=sha256:56c6952a9b15047466d0c2347c446a761d4527f89976156341e68f0ce5cc08b0 \ + --hash=sha256:56cd8b3f77d7b6812f533b662186a1f28316931166ddc00fb893b1b0db7e9888 \ + --hash=sha256:57492a550a1d88d29d003247e5f78dd8cf04a701fac0e4c8db8745a6d2504e0a \ + --hash=sha256:5943980471829f6de242a20b109de3111ba6b77e3af0ffc587028ac854b05e6c \ + --hash=sha256:5c6ee90dee3e85e055ddfd502d611643d9b0fd94c818220bda84ec3dacd9b27b \ + --hash=sha256:5c90e7fa02e8f5de0d10c17595c568ada48c5302e749462c0ea1a4c362111a86 \ + --hash=sha256:5ce8943f79c2210f7abcc28e86367b03b28d95027fd01c46d2472373ae70c86f \ + --hash=sha256:617f59cde379b4f648a09797b7f683d04b90a46344cddab85639da5aff0f5531 \ + --hash=sha256:6307a0da524939decb8ca4a3933b8ab62525794411d6984fca6726e732804af6 \ + --hash=sha256:684fd492fff4fead00587544e059be2bbcb6f93454f21fa2a91b66fc7508be82 \ + --hash=sha256:6b5b393eda5ea42cca1c1a6665f2a4882b4fd5d1777e41ce0545a107fb008c9d \ + --hash=sha256:6b723eb406dec5bc9ec516c73ab9c3239a3284e017f7eb89ee2b3258bd504fb7 \ + --hash=sha256:6b9bf3135b4ad5981df9a73d71a35272d650a2985ae9c2746357b24d59de2448 \ + --hash=sha256:6beb738155fe8ab8091afdfa5a3226b21c2b1593f1e50ebb90eb25b44dbc0391 \ + --hash=sha256:6c0dbbcc19735fe5f8b0a54c07659d154a9e69f47e15d0a6ab7299215daf62cb \ + --hash=sha256:6cdc537c8633d7fd92a82e2e0d2ab74320a3f63d5e59fb9cf08711e08fe151c4 \ + --hash=sha256:6eae33003518fd4cb4f83a218d5371469dd3001aa3b87128c005b07762f7fe5e \ + --hash=sha256:740d0a99cf9de0b17a3943388e9294a59becf75e7c43421f387bd3c7a9901f7c \ + --hash=sha256:75c38c50ab9aca840225d9a9a3810bf11d04bd5c1f186cabbb8aee56db3e9b15 \ + --hash=sha256:761fdae6728ceb99ab182fad2f0cc1e262f610834dc891aea1d1a2a2e634776f \ + --hash=sha256:7664419f27db41d4f1c43a78dccda7dd6e8ef2428df3ee01d0c2a07a6b071297 \ + --hash=sha256:76d3af9732d2dab69f28179b40ba2d87e2f1d5824b4a694780aa787d685e8f36 \ + --hash=sha256:78326f4cb4427a56ba4996c0762b63be45f06b85f086526420d2b3a66e40f84d \ + --hash=sha256:7868b85224291c6cb6759f9b5adb9745f486d226f62b16a614dd5a2a5ab2b35b \ + --hash=sha256:815d26356930846a40c7bc1366e7b1b0320ab8a063e66c11298a208bed0fd237 \ + --hash=sha256:8171b44a054e5c67fd748ada04187f1250bf35b95f85e52ab64bcf3331a923bb \ + --hash=sha256:821b2755db9194409254012f429c56643416fb96ef9be090be82ec8826b7f477 \ + --hash=sha256:837c6b305e26fe0f75b15c92cf3b2ba29e0ae19dc40b1c557b026cb426347d0c \ + --hash=sha256:839dde845559254f34885267c6878f60d61d5205180226d976fe488d45fa128e \ + --hash=sha256:84a6ecc0c940169190d2c23bd969debd48c94dbc855acd60188a68d71d421608 \ + --hash=sha256:8601470267d938bcb7f3ab1a336100af51a4fd5b6ed030ef52461bb3ef5e7e07 \ + --hash=sha256:88b5268892fde430d5531f95bc560b6efbbd67c929662c586afd729a96e7461c \ + --hash=sha256:8aa5dda18d39b6143eb24809d158f9252c88f402749b6f1b62a506cc7d96cc35 \ + --hash=sha256:926bdd3e3b5998ddf70cc64bc8cf57209571f9044542913afb673799fec77dd0 \ + --hash=sha256:96beca19ec79de272e8668585380ff9092c47077c1d7a1e098e00bbd921f4785 \ + --hash=sha256:9a0460d43603d1fd9ef59c30278531e15d78581721ddb538fa560aa7817ea4ad \ + --hash=sha256:a03d57b86d2a51d0a66c92177e2be154ad015f357791d306e714569999cdb4cc \ + --hash=sha256:a36b70596407634ca82d4b989a3729074a008537a0522e4c8046a67c729103e9 \ + --hash=sha256:a3a52a3ba86436ab3aef510fbe21512abc2ddd1993005dfe50514bd2284ef025 \ + --hash=sha256:a3dbc5ed9514908d5046107d7b1346bde71eea61de6e0e4919c19354f97e769f \ + --hash=sha256:a431156bb41865fc14cd5d79bb9d7bbed83110b0159e34e62ae30951f96c0009 \ + --hash=sha256:a575404ebc9cf2e91edd32eaf570ec1430eb900d4f56724ba7dd4bc1fc9c176d \ + --hash=sha256:a5cf77eb04f20b720be95265a3e00eb2a14814074255cc27069c551b2db53118 \ + --hash=sha256:a8763f20692da7df39b0afdd1ba3042b004c50a45994f76c2d9a25641f7673db \ + --hash=sha256:ab4b2fda7c2b542f7f9d886cc6a838c5079d2b76f72e6081411faba11adde2c9 \ + --hash=sha256:addeda51556dac7c1a2f14cda62db8b621cd12afba3091d03a96c72932387eab \ + --hash=sha256:b242c27c8f836305a4a72df9cdd564386ac57b807bd252a063223331c9316b37 \ + --hash=sha256:b4f062343e7ad3fa94f2c66e5ae667dee47ee74dd41a9057c4fbe163236a123d \ + --hash=sha256:b5b8b0753718d258fd454283fbd57e14545d3b40583fa672e27cb4f987626bcc \ + --hash=sha256:be3e47e2d91aa3942ff9bf4077a505226005abfc39b6f7554a91c1b9393986b9 \ + --hash=sha256:befc2d6a953e563f8a7bfd87a42c22ebf8a3e980dcb7b6a4d17b70b0e914e8a3 \ + --hash=sha256:bf35d0568abda97233239ce32896d3ad53fccc537832c104e30c94aa5fb93569 \ + --hash=sha256:c933c6678c6f116ff8af47a4c6db0868b8ace74af0343016c0ef00f00272ea69 \ + --hash=sha256:c9d1aca01f49170fdcf5c92761b1fafe97f554b721ca4570c5949fff778f0d4b \ + --hash=sha256:cdeaa99ce822dca76cfb1b993e9120c5ea212f2eb66d48950ad63c349668a018 \ + --hash=sha256:ce4d4f52e2a4324396caddbd45a97d8d7be5f42edd25d2355282a9c34f9b2f7f \ + --hash=sha256:d1028417bb44037eb3069c1009bd7b7277212876cda22fbe565b0bca9fab6d2c \ + --hash=sha256:d151e148117294133bf8af7eeace085e7e87432db15ab6adf640330298a47f6f \ + --hash=sha256:d7841166b7fa64c9c56404617ae4341448847482d45933b13135d26c130519e5 \ + --hash=sha256:d7fca4eb6df565e2a928f1c7dad92d27db8f9df0f449e76423ed5d7e713ed445 \ + --hash=sha256:d95a354e02393eada6d7351184671aced9d4cce109dabf927cb7aa99624352a1 \ + --hash=sha256:d9edf30457d74eebfd76b045535e36f1cd89062566a128a0db2145ca042d787e \ + --hash=sha256:dbc2673f9223d420c91145599b3ba45a8a50c207d1976908e5fb5ddb0c9b9429 \ + --hash=sha256:e01b3c878c8641913e688edd1b3f08658c6783d29cf6b826bd3c0d1ae7a1ffaa \ + --hash=sha256:e21c1429e205828ea886a2293a4a2c8e01f4c25d9893ca330e97a6cf73f52e7b \ + --hash=sha256:e43d4a1f673e8a1cbd8533e809e02b4bf9d4f2280269bb640436556312121250 \ + --hash=sha256:e6d198bad4e49dd6732fbd636e2fc5c082f45c8cad0b4acb756b00c82c76072e \ + --hash=sha256:e6ea1cda8d8c688278430e4268a42f5e5da3bdd74578dfadc0820c3f1766ce83 \ + --hash=sha256:ea394a937f17a54c51239348bdbe2e3518124c8d4a8951ba04a311d3095bd18f \ + --hash=sha256:eac2f5dbafd585dfe31f86a23ebf0d3ba480a9d49ebc87947267b5608d4ea0cd \ + --hash=sha256:eb61be926bb81567c1f48bdc8aa22b9855048dc2efd53871f9f7e6e9a5632346 \ + --hash=sha256:eba5d173f7d5708b22a93815017a4611873ed54db9f268077c0dd1ed99cfc858 \ + --hash=sha256:ec450527cbf485e13c8d3602a54f428ab0432fdade0ede75efd74b735421c871 \ + --hash=sha256:eef6a03b0b6d08d0835ccfa8ec8d1bc70525e3801387567137b50c557695e6da \ + --hash=sha256:ef0d8c843e2827d6c120ab4687e9423fb1d893db1df27b7c1506615bcb9734a0 \ + --hash=sha256:ef6b65b03247c54692ad4fd9ee97cb772781927db72e3cb05e70b3db6d1ff14f \ + --hash=sha256:f3d6ed6a98cfd19155996605474982cc470d7601746a6439078f1a5a3fa8b050 \ + --hash=sha256:fce4b85234a0cbad67bf8e6e1201ee815d172c9aebad75f25645bc4d834f8e31 \ + --hash=sha256:fda1d96e542c37b6c804547dbf489c129fe7c97183a76a5ec275909ba1a063df \ + --hash=sha256:fdcd198979b4ecffcc1beba366a7fbcf4eb41243691a82fe52ceb0b902f09c12 \ + --hash=sha256:fe5ad0664ec772b02c45859041aa17655709cced7a31005817fbbbd988c25567 + # via + # jsonschema + # referencing +typing-extensions==4.16.0 \ + --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \ + --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5 + # via + # pydantic + # pydantic-core + # referencing + # typing-inspection +typing-inspection==0.4.5 \ + --hash=sha256:7f16c411e7930dc79596d42ab44672a3fe5f60eb34b781a1647e7872363120c7 \ + --hash=sha256:bc210535442b39e1bf2805e0c7a17dfd6a4ace760c84c7f7d16245d23a6b1c39 + # via pydantic