---
id: blog/en/mcp-audit-identity-effect-denial
type: blog
language: en
title: "Audit an MCP tool: from identity to observable denial"
description: A local fixture checks identity, scope, limits and schema before reading. Its access tests do not measure a model’s injection resistance.
summary: A local fixture checks identity, scope, limits and schema before reading. Its access tests do not measure a model’s injection resistance.
url: https://rootzero.eu/en/research/mcp-audit-identity-effect-denial/
markdown_url: https://rootzero.eu/en/research/mcp-audit-identity-effect-denial/index.md
author: rootzero
published: 2026-11-17T00:00:00.000Z
updated: null
tags:
  - IA
  - Sécurité
  - MCP
topics:
  - id: ai-methods
    name: AI and methodology
    url: https://rootzero.eu/en/research/topics/ai-methods/
translations:
  en: https://rootzero.eu/en/research/mcp-audit-identity-effect-denial/
  fr: https://rootzero.eu/research/audit-mcp-identite-effet-refus/
reading_minutes: 2
content_origin: methodology
research_reference: null
research_status: null
vulnerabilities: []
references:
  - label: MCP server construction guide
    url: https://rootzero.eu/en/research/build-a-useful-mcp-server-for-a-tool/
  - label: 28 July 2026 MCP authorization specification
    url: https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization
  - label: downloadable lab
    url: https://rootzero.eu/labs/orca/mcp-access-boundary.mjs
  - label: MCP security guidance
    url: https://modelcontextprotocol.io/specification/2026-07-28/basic/security_best_practices
sections:
  - title: Define the contract boundaries
    level: 2
    url: https://rootzero.eu/en/research/mcp-audit-identity-effect-denial/#define-the-contract-boundaries
  - title: Deny before reading
    level: 2
    url: https://rootzero.eu/en/research/mcp-audit-identity-effect-denial/#deny-before-reading
  - title: Run differential cases
    level: 2
    url: https://rootzero.eu/en/research/mcp-audit-identity-effect-denial/#run-differential-cases
  - title: Connect decisions to effects
    level: 2
    url: https://rootzero.eu/en/research/mcp-audit-identity-effect-denial/#connect-decisions-to-effects
---

# Audit an MCP tool: from identity to observable denial

> A local fixture checks identity, scope, limits and schema before reading. Its access tests do not measure a model’s injection resistance.

An MCP tool returning the correct result for an authorized object has validated one case. An audit must also establish that the same tool rejects missing identity, another tenant’s resource and revoked access without reading the object first.

This lab extends the authorization discussion in the [MCP server construction guide](https://rootzero.eu/en/research/build-a-useful-mcp-server-for-a-tool/). The attached program tests an in-memory access contract; it starts no MCP server and establishes no complete protocol compliance.

![Server identity → Bounded arguments → Object permission → Effect or denial. Model decisions do not replace access control.](https://rootzero.eu/_astro/a12-en.nTbCf2cr_28uc9a.webp)

_Model decisions do not replace access control._

## Define the contract boundaries

The fictional `case_read` tool accepts an object identifier and a maximum row count. Trusted context supplies identity, tenant and access-lease status. Model-generated arguments do not supply these values.

```json
{
  "name": "case_read",
  "arguments": {
    "caseId": "case-a",
    "limit": 10
  }
}
```

Adding a `tenant` argument must fail validation. The server must not use it to replace the context’s tenant. A valid request signature or token does not authorize every submitted object identifier.

For HTTP, the actual integration must validate identity and token audience before constructing context. The [28 July 2026 MCP authorization specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization) covers that layer. This lab begins after it and does not claim to simulate authentication.

## Deny before reading

Verification order is observable behavior:

1.  Require valid identity context and an active lease.
2.  Validate allowed arguments and bounds.
3.  Resolve the requested object’s relationship to the authorized tenant.
4.  Read content only when that relationship permits it.
5.  Log the decision with a request identifier.

Ownership resolution may consult an authorization index. It should avoid loading business content merely to decide that access was forbidden. A tenant-filtered query or storage policy can enforce selection at the data layer in a real system.

This lab returns the same external error for an unknown object and another tenant’s object. Internal traces retain the distinction without exposing the object’s content.

## Run differential cases

Run the [downloadable lab](https://rootzero.eu/labs/orca/mcp-access-boundary.mjs) with Node, without an SDK or network dependency. From the source repository root:

```bash
node docs/drafts/labs/mcp-access-boundary.mjs
```

The local run passes eight cases. It compares permitted access with missing identity, a revoked lease, an attempted tenant override, an out-of-range limit, a foreign resource, an unknown object and an extra argument. Read counters confirm that the seven denied requests load no content.

These cases cover a deterministic function. They measure neither model tool selection nor resistance to every injection. Their value is maintaining denial when an incorrect call actually reaches the access boundary.

## Connect decisions to effects

Integration traces should add client, session, tool and request identifiers. Operators must be able to recover the authorization context without copying access tokens or entire tickets.

For writes, also inspect final state: no modified row, delivered message or queued job after denial. An error response accompanied by a side effect still violates the contract.

[MCP security guidance](https://modelcontextprotocol.io/specification/2026-07-28/basic/security_best_practices) supplies complementary transport and token controls. A complete audit must also cover renewal, revocation during calls, deferred jobs and the deployed transport. This lab provides an executable starting point for object-level decisions.
