Skip to content

About

parallax - offline projection auditor for the MCP tool-result plane: what the human approves vs what the model reads. 48 rules, 6 client profiles, zero dependencies.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Development Experiment 041 — parallax

An offline, LLM-free, dependency-free projection auditor for the MCP TOOL-RESULT plane: the series' first entry on the return leg of a tool call.

A tools/call result is not one message. It is a broadcast to two readers with different parsers — the human who approves the action, and the model that acts on it — and MCP 2026-07-28 gives a server three separate ways to hand those two readers different things:

  • annotations.audience addresses one reader and not the other, by design;
  • content and structuredContent are two representations of the same fact whose equivalence is a SHOULD that nothing enforces;
  • every client decides for itself what it renders, what it forwards, and what it drops on the floor.

parallax computes both projections of a captured result under a set of client behaviour profiles and reports every place they diverge. 48 rules, five families, six client profiles, text/JSON/SARIF output, a severity-weighted score and a CI exit-code gate. 353 tests green under both pytest and unittest. Zero runtime dependencies. It never executes a tool, never opens a socket, and never resolves a URI it reads.


Thesis

Every agent security control that ships in production today terminates in a human looking at a rendering. The approval prompt, the transcript, the "are you sure" — all of them are a projection of some machine-readable object, and the security property they claim is that the human authorised the thing the machine then did.

The 2026 literature audits this exhaustively on the inbound path: tool descriptions the model reads and the human never sees are the most-studied MCP attack class of the year, with a CSA research programme, an OWASP Top 10 entry and a benchmark behind them. It audits it on the outbound path too: experiment 040 in this series showed that the path a confinement policy judges, the path an approval prompt shows and the path the kernel opens are three different functions that disagree.

Nobody audits the return leg. The object the server hands back is simultaneously the model's next context and the human's only evidence for the approval that already happened — and the specification's own maintainers say, on a roadmap dated nine days before this experiment, that the two mechanisms which shape it "confused server and client authors alike and produced diverging implementations" and are "mostly unadopted". A visibility control that nothing checks is not a visibility control; it is a covert channel with a schema.

The smallest thing that proves the idea is a tool that takes a captured result, computes π_user and π_model under a named client model, and prints where they disagree. If those two projections can be made to differ on an amount, a destination, or a verdict — using nothing the specification forbids — then the approval gate is decorative and the divergence is measurable. Both turn out to be true.


Install and run

Python 3.11+. No dependencies.

git clone https://github.com/freyesperales/dev-experiment-041
cd dev-experiment-041

make run                      # audit the whole bundled corpus
# or, with no make:
python -m parallax demo

Auditing your own capture:

python -m parallax audit path/to/capture.json --catalog path/to/tools-list.json
python -m parallax project path/to/capture.json    # both projections, side by side
python -m parallax diff path/to/capture.json       # where clients disagree
python -m parallax remediate path/to/capture.json  # ordered server-side fixes
python -m parallax rules                           # the 48-rule catalog
python -m parallax explain PX-202                  # one rule, in full
python -m parallax profiles                        # the client behaviour models

Tests:

make test            # pytest
make test-unittest   # the same 353 tests, stdlib runner only

Capture format

A capture is offline JSON — what a proxy, a client log or a test harness already wrote down. parallax never talks to a server.

{
  "note": "optional; printed in the report",
  "exchanges": [
    {
      "tool": "send_payment",
      "arguments": { "payee": "acme", "amount_minor": 1200 },
      "result": { "content": [ ... ], "structuredContent": { ... }, "isError": false }
    }
  ],
  "catalog": { "tools": [ ... ] }
}

A bare array of exchanges works too, result may be a whole JSON-RPC envelope, and the catalog may be supplied inline or with --catalog. The catalog is what enables the outputSchema rules (PX-112/PX-113); without it the report says so rather than silently skipping them.

CI

python -m parallax audit capture.json --catalog tools.json --fail-on high

Exit 0 clean, 1 when a finding reaches the threshold, 2 on a usage or IO error. --format sarif emits SARIF 2.1.0 for a code-scanning surface.


Sample run

Auditing corpus/error-mask.json — a deployment that half-failed, where the human-visible block reports success and the block reporting the failed rollback is annotated audience: ["assistant"]:

$ python -m parallax audit corpus/error-mask.json --catalog corpus/catalog.json --no-evidence

parallax 0.1.0 — tool-result projection audit
capture: corpus/error-mask.json
scope:   1 exchange(s) × 5 profile(s) [spec-2026-07-28, legacy-content-only, structured-first, ui-strict, headless-agent]
------------------------------------------------------------------------------

exchange[0] deploy_service (failure visible to the model only)
  CRIT PX-203 [headless-agent+spec-2026-07-28+ui-strict]  the human sees success while the model sees failure
       human projection reads as success while the model projection reports failure
  HIGH PX-301  isError is false but the prose reports a failure
       isError is false while the content reports failure: 'error'
  HIGH PX-303  structured status contradicts isError
       structuredContent state='partial' implies failure but isError is false
  HIGH PX-501  the human sees a different result depending on the client
       the human projection takes 2 distinct forms across 5 profiles: headless-
       agent+spec-2026-07-28+structured-first+ui-strict | legacy-content-only
  HIGH PX-502  the model ingests a different result depending on the client
       the model projection takes 3 distinct forms across 5 profiles: headless-
       agent+spec-2026-07-28+ui-strict | legacy-content-only | structured-first
  MED  PX-208  the operative block is buried by priority
       content[1] (text) has the lowest priority in the result (0.0) yet carries risk-bearing
       language: 'error'
  MED  PX-504  a block's visibility to the human flips between clients
       content[1] (text) is shown to the human by legacy-content-only and hidden by headless-
       agent+spec-2026-07-28+structured-first+ui-strict
  ... 10 more

------------------------------------------------------------------------------
findings: 17 unique (1 critical, 4 high, 11 medium, 1 low)
families: mirror=1, audience=6, errors=2, cross=8
penalty:  68 points over 1 exchange(s)
score:    32/100  grade F

And the projection that produced it — the whole thesis in one screen:

$ python -m parallax project corpus/error-mask.json \
    --profile spec-2026-07-28 --profile legacy-content-only

exchange[0] deploy_service (failure visible to the model only)
  isError=False, resultType=complete, structuredContent=present, content blocks=2

  profile legacy-content-only: audience=ignored, ...
    HUMAN SEES:
      | Deployment of billing-api v2.14.0 completed successfully.
      | ERROR: 3 of 8 replicas failed readiness; rollback failed and the cluster is in a partial state.
    MODEL READS:
      | Deployment of billing-api v2.14.0 completed successfully.
      | ERROR: 3 of 8 replicas failed readiness; rollback failed and the cluster is in a partial state.

  profile spec-2026-07-28: audience=honored, ...
    HUMAN SEES:
      | Deployment of billing-api v2.14.0 completed successfully.
    MODEL READS:
      | ERROR: 3 of 8 replicas failed readiness; rollback failed and the cluster is in a partial state.
      # { "replicas_desired": 8, "replicas_ready": 5, "state": "partial" }
    SUPPRESSED:
      - content[0] (text) -> assistant: audience=['user'] excludes the model
      - content[1] (text) -> user: audience=['assistant'] excludes the user

The more conforming client is the one where the operator is told the rollout succeeded. Honouring the annotation is what splits the readers.

Every bundled case is one shape of divergence:

case what it demonstrates
benign a well-formed result. Scores 100; the baseline that keeps the rules honest
payment-divergence prose says $12.00 to ****4471; the payload says 12000.0 to a different IBAN
invisible-instructions a block annotated for the model alone, carrying a directive and a credentials path
error-mask the split verdict above
exfil-link the link the human inspects and the resource the model ingests are on different hosts
render-caps no annotation at all — a chat client's three-block cap does the hiding
schema-drift payload violates its own outputSchema; prose miscounts the array it summarises

Architecture

capture.json ──► loader ──► Capture(Exchange[], catalog)
                              │
                   for each exchange × profile
                              │
                              ▼
                 project()  ──►  View { user_blocks, model_blocks,
                                        model_structured, suppressed[] }
                              │
                 ┌────────────┴────────────┐
                 ▼                         ▼
        per-exchange rules          claims / lexicon / schema
        PX-1xx MIRROR                  (deterministic, LLM-free)
        PX-2xx AUDIENCE
        PX-3xx ERRORS
        PX-4xx CHANNEL
                 │
                 ▼
        PX-5xx CROSS  ◄── consumes every profile's view + findings
                 │
                 ▼
        score ──► report (text | json | sarif) ──► exit code
                     └──► remediate (ordered plan)

The projection is the whole design. project() is the only place that decides who receives what; every rule consumes a View and none re-derives visibility from the raw result. That is what makes a profile a declaration rather than a set of special cases scattered through 48 rules, and it is why adding a client model is a dataclass literal.

Claims are extracted, not guessed. To say "the prose and the payload disagree" you need a common vocabulary for what each asserts. claims.py builds one deterministically: labelled claims from prose (label: value, bounded procedurally so amount_usd: 12.00 sent to account_id: ****4471 yields two claims and not one), flattened leaves from JSON, and set-based extraction for hosts, paths and opaque handles where position does not matter. Keys are folded (amount_usd ≡ Amount USD ≡ amountUsd); plurals are not folded, because conflating item with items manufactures divergences that are not there.

Every textual finding quotes its match. The entire phrase-matching surface is one reviewable file — lexicon.py, 68 phrases in four groups, each with a note saying why it is there. There is no classifier, no score, no model. If parallax says a hidden block spoke in the imperative, the report contains the sentence.

Six client profiles, each grounded in an observed behaviour cited in RESEARCH.md: spec-2026-07-28 (honours everything), legacy-content-only (predates structuredContent), structured-first (context-thrifty, drops the prose for the model), ui-strict (three blocks, 500 chars, drops _meta), headless-agent (no human at all), annotation-blind (ignores annotations in both directions).


Two approaches considered

A. Single-reader conformance checking. Validate each result against the specification in isolation: is structuredContent schema-conformant, is isError consistent with the prose, are the annotations well-formed. Cheap, obvious, and about a third of what shipped (the PX-1xx schema rules and PX-3xx are exactly this).

B. Two-reader differential projection — model the result as an object with two projections and audit the difference, across several client behaviour models.

B was chosen, at real cost. It needs a projection engine, a profile registry, a claim-comparison layer, and cross-profile rules that consume the whole set — maybe three times the code of A, and a --profile flag the user has to think about.

The reason is that A cannot express the finding this experiment exists for. Take error-mask: every individual field is well-formed. content is a valid array. annotations.audience uses legal values. structuredContent conforms to outputSchema. isError is a boolean. A single-reader conformance checker returns clean, and it is right to — nothing is malformed. The defect only exists in the relation between two projections, and only a tool that computes both can name it.

The cost shows up honestly in the output: because visibility is client-dependent, so are the findings, which is why PX-503 exists and why the report labels a profile only when the finding is not universal. That labelling rule was itself a correction — the first version tagged every finding with whichever profile happened to be iterated first, which made an arbitrary name look like a claim.

Two further corrections are visible in the code, both caught by tests rather than by inspection:

  • PX-501/502 originally compared raw projected text, which meant the specification's own advice — mirror structuredContent into a TextContent block — registered as a divergence on every conforming result, including the benign baseline. They now compare canonical fact sets, where a block whose text is the serialized payload is the same fact as the payload rather than a second one.
  • The structured-first profile originally starved the model on any result with no structuredContent, because "drops content" was modelled unconditionally. No shipping client does that; it now falls back to content when there is no structured payload to prefer. The test that caught it was asserting something else entirely.

And one gap that the hand-off between two rules created: PX-105 deferred the magnitude case to PX-106 by checking whether the field name looked monetary, while PX-106 fired on the ratio — so a sub-magnitude divergence on a field called amount fell through both and was reported by neither. The two conditions are now the same condition.


Rule families

family asks
PX-1xx MIRROR (16) Do the human-readable blocks and structuredContent state the same facts?
PX-2xx AUDIENCE (11) Does an audience/priority annotation hide something load-bearing from one reader?
PX-3xx ERRORS (7) Do isError, the prose and the structured payload agree about whether this failed?
PX-4xx CHANNEL (10) Does the shape of the result — links, binaries, size, _meta — split the two readers?
PX-5xx CROSS (4) Does the same wire result denote different things to different clients?

python -m parallax rules lists all 48; explain <id> gives the question, the rationale and the remediation for any one.


Scoring

The score is an absolute defect budget, not a rate: each finding spends its severity weight (critical 10, high 6, medium 3, low 1) and the score is what is left of 100, floored at zero. Grades are A ≥ 90, B ≥ 80, C ≥ 70, D ≥ 60, else F.

The report always prints the exchange count beside the score, because a budget is not comparable across captures of different sizes and the number should never be read alone. Findings raised under several profiles are deduplicated before scoring — otherwise auditing with more profiles would make an unchanged result look worse.


Assumptions and limitations

Stated plainly, because a tool that reports on ambiguity should not be ambiguous about its own.

  1. parallax audits captures, not servers. It reads JSON somebody else recorded. It never issues a tools/call, never resolves a resource_link, never opens a socket. Everything it reports is a property of bytes already on disk.

  2. Client profiles are models, not vendor claims. No profile asserts that a named product behaves a particular way. Each is a distinct shape of behaviour, grounded in a cited source (RESEARCH.md), that a server author has to survive. If your client differs, the profile is a dataclass literal — write your own.

  3. Claim extraction is conservative and will miss things. A prose claim needs a syntactic label attachment (label:, =, is, was) or one of the count phrasings. "The transfer went through for twelve dollars" asserts nothing parallax can compare. False negatives are preferred to a rule nobody trusts; the corpus documents what is caught rather than claiming coverage.

  4. The lexicon is 68 English phrases. Directive-shaped language in another language, or paraphrased past the list, will not match. This is a deliberate trade for auditability: the entire textual surface fits on one screen and every hit quotes its match. It is not a classifier and should not be graded as one.

  5. The bundled JSON Schema validator implements a subset of 2020-12 — enough for real outputSchema documents, with local $ref. Unsupported keywords are reported as unsupported, never silently passed; remote $ref is refused rather than fetched. PX-113 downgrades to LOW and says so when a schema cannot be evaluated.

  6. Severity is a fixed judgement, not a risk model. Weights encode "how bad is this class of divergence", not "how bad is it in your deployment". A model-only block is MEDIUM whether it contains a rendering hint or a payload; what escalates it is a second signal (imperative language, bulk, a hidden host), which is why those are separate rules.

  7. Cross-profile findings depend on the profile set. Auditing with one profile yields none; auditing with all six yields the most. The default five are the ones with materially different behaviour. This is a real property of the question being asked, not a defect — but it means PX-5xx counts are not comparable across runs with different --profile flags.

  8. A clean parallax report is not a safety claim. It means the two projections of these captured results agree under these profiles. It says nothing about results not in the capture, about the tool's actual side effects, or about the inbound half of the plane, which the tool-poisoning literature and experiment 004 in this series cover.

  9. Not yet done: streaming/partial results and the Tasks extension lifecycle; resultType: "input_required" is recognised as valid but its elicitation payloads are not projected; _meta-carried extension content (MCP Apps UI resources) is detected as droppable but not itself projected.


Series context

Development Experiment 041 of an ongoing daily series. Prior entries audited the inbound plane (004 context-xray, tool manifests and skills), the capability graph (009 trifecta), individual MCP channels (014–021), and the agent's own substrate — permissions (032), memory (033), delegation (034), hooks (035), egress (036), retries (038), compaction (039), workspace confinement (040).

041 is the first on the return leg: not what the agent is told it may do, and not what it then does, but what it is told happened — and whether the person who signed off was told the same thing.

Index: https://github.com/freyesperales/dev-experiments-365

License

MIT. See LICENSE.

About

parallax - offline projection auditor for the MCP tool-result plane: what the human approves vs what the model reads. 48 rules, 6 client profiles, zero dependencies.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages