Compatibility: Pactmark 0.1.x. @pactmark/mcp supports tested stdio and Streamable HTTP transports. Without a production SandboxAdapter, stdio remains preview-only.

The rule that governs everything here

Discovery never grants authority.
An MCP server tells you what it offers. It does not tell you what your agent is allowed to do. Those are separate facts and Pactmark keeps them separate: discovered metadata is untrusted input that must survive validation before a tool is ever exposed to the model. Figure 1. Boundary 6 is the one this page is about. Everything a server sends you — tool names, schemas, descriptions, pagination cursors, process output — arrives on the untrusted side.

Pinning a server

Host configuration pins the identity and the capabilities. Nothing is inferred:

Exact origin

Traffic goes through the egress broker to one normalized HTTPS origin. Cross-origin redirects are denied.

Origin-bound credentials

A credential issued for this origin cannot be replayed against another one.

Explicit tool allowlist

A server that starts offering a new tool does not gain access to your agent.

Bounded pages and bytes

Cursor loops and oversized responses are terminated, not absorbed.

stdio transport

Stdio is stricter, because it is a local process:
Without a production SandboxAdapter, treat stdio MCP as preview only. A local process is arbitrary code execution with your process’s privileges, and the reference container fixture is explicitly not production isolation — see Sandbox boundary.

What fails closed, and when

All of these are rejected before a tool becomes visible to the model:
1

Malformed discovery pages

A response that does not validate is not partially trusted.
2

Duplicate tool identities

Two tools claiming the same identity is an error, not a last-write-wins race.
3

Cursor loops

Pagination that does not terminate hits the bounded page limit.
4

Unknown risk metadata

A tool whose risk class you cannot interpret is not exposed. Unknown means no.
5

Schema drift

A tool whose schema changed under an existing registration no longer matches its digest.

Mapping an MCP tool into Pactmark

An MCP tool does not arrive with a Pactmark ToolSecurity declaration — you write one. That is the point: you are asserting the risk class, data classes, scopes, egress posture and limits, and your assertion is what policy enforces.

Treat returned content as hostile

Indirect prompt injection through tool output is threat model row TM-02, and it is rated critical. The controls are structural rather than textual:
  • returned content is admitted into context under explicit byte bounds;
  • it carries no authority and cannot create a grant;
  • it cannot select an egress destination;
  • purpose, data class and egress profiles remain those of the work order, not of the content.
Semantic manipulation inside admitted data remains a model risk. Pactmark bounds the blast radius; it does not make a model immune to persuasion.

What to test

Threat model

Row TM-14 covers malicious MCP metadata, drift, cursor loops and transport redirects.

Sandbox boundary

Why the reference container is a test fixture and not isolation.