---
schema_version: "1"
id: cc0dedc1da76718aa6cbdc027f15091db00707fc360111a8b1f9a338f7c171ae
title: MCP Attribute-Based Access Control Policy
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/1.9/policies-included-mcp-attribute-access-control.md
canonical_url: https://docs.mulesoft.com/gateway/1.9/policies-included-mcp-attribute-access-control
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 4f6803475d3ec45aad2b951b06975447d727f6189ecd0afa38f24d39cd0463fa
description: MuleSoft Documentation Site
release: "1.9"
latest: false
---
---
product: Omni Gateway
version: 1.9
keywords: api gateway, flex gateway, gateway, policy
---

# MCP Attribute-Based Access Control Policy

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

<table><colgroup><col> <col></colgroup><tbody><tr><td><p><strong>Policy Name</strong></p></td><td><p>MCP Attribute-Based Access Control</p></td></tr><tr><td><p><strong>Summary</strong></p></td><td><p>Controls access to tools, resources, and prompts based on user information such as Tiers, IP, Headers, or Claims</p></td></tr><tr><td><p><strong>Category</strong></p></td><td><p>MCP</p></td></tr><tr><td><p><strong>First Flex Gateway version available</strong></p></td><td><p>v1.9.3</p></td></tr><tr><td><p><strong>Returned Status Codes</strong></p></td><td><p>400 - Invalid token</p></td></tr></tbody></table>

## Summary

The MCP Attribute-Based Access Control policy controls access to server tools, resources, and
prompts based on user information such as Tiers, IP, Headers, or Claims. Use the
[Cedar policy language](https://docs.cedarpolicy.com/) to define access rules.

This policy requires that another authentication policy be applied before the MCP Attribute-Based
Access Control policy. For detailed guidance, see [Writing Cedar Rules](#writing-cedar-rules).

## Configuring Policy Parameters

### Flex Gateway Local Mode

The MCP Attribute-Based Access Control policy is not supported in Local Mode.

### Managed Flex Gateway and Flex Gateway Connected Mode

When you apply the policy to your API instance from the UI, the following parameters are displayed:

<table><colgroup><col> <col></colgroup><thead><tr><th>Element</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p>Rules</p></div></div></td><td><div><div><p>Rules to control access to tools, resources, and prompts written in the <a href="https://docs.cedarpolicy.com/">Cedar policy language</a>.</p></div></div></td></tr><tr><td><div><div><p>Cedar Expression</p></div></div></td><td><div><div><p>Cedar expression defining the access rule. For example: <code>permit(principal,action == Action::"tools/call</code> or <code>resource == Tool::"calculator");</code>. To learn more about the Cedar bindings provided by the requests, see <a href="#writing-cedar-rules">Writing Cedar Rules</a>.</p></div></div></td></tr><tr><td><div><div><p>Authentication Type</p></div></div></td><td><div><div><p>Type of authentication used by the authentication policy applied before this policy.</p></div></div></td></tr></tbody></table>

## Writing Cedar Rules

You must apply either an included authentication policy or a custom authentication policy before the
MCP Attribute-Based Access Control policy.

### Included Authentication Policies

The authentication policy you apply affects the available Cedar `principal` bindings:

- Multiple policies can validate Client ID:

  - [Client ID Enforcement Policy](https://docs.mulesoft.com/gateway/1.9/policies-included-client-id-enforcement)

  - [Rate Limiting: SLA-Based Policy](https://docs.mulesoft.com/gateway/1.9/policies-included-rate-limiting-sla)

  - [OAuth 2.0 Token Introspection Policy](https://docs.mulesoft.com/gateway/1.9/policies-included-oauth-token-introspection) (If Client
    ID enforcement is configured)

  - [OpenID Connect OAuth 2.0 Token Enforcement Policy](https://docs.mulesoft.com/gateway/1.9/policies-included-openid-token-enforcement)
    (If Client ID enforcement is configured)

  - [JWT Validation Policy](https://docs.mulesoft.com/gateway/1.9/policies-included-jwt-validation) (If Client ID enforcement is
    configured)

    Policies validating Client ID provide these Cedar bindings:

  - `principal.client_name`: Name of the contract’s client application

  - `principal.principal`: ID of the contract’s client application

  - `principal.properties.slaId`: SLA ID assigned to the contract

- [JWT Validation Policy](https://docs.mulesoft.com/gateway/1.9/policies-included-jwt-validation):

  - `principal.properties.claims.<claimName>`: All claims provided by the JWT

- Multiple policies validate basic authentication credentials:

  - [Basic Authentication: Simple Policy](https://docs.mulesoft.com/gateway/1.9/policies-included-basic-auth-simple)

  - [Basic Authentication: LDAP Policy](https://docs.mulesoft.com/gateway/1.9/policies-included-basic-auth-ldap)

    Policies validating basic authentication credentials provide these Cedar bindings:

  - `principal.principal`: Username passed as basic auth user

### Custom Authentication Policies

For custom authentication policies, the custom policy must authenticate by using the
`Authentication` injectable. To configure the `Authentication` injectable, see
[Accessing Request Authentication Information](https://docs.mulesoft.com/pdk/latest/policies-pdk-configure-features-authentication).

For the Rust `AuthenticationData` struct:

```rust
pub struct AuthenticationData {
    pub principal: Option<String>,
    pub client_id: Option<String>,
    pub client_name: Option<String>,
    pub properties: Value,
}
```

The `AuthenticationData` parameters map to these Cedar bindings:

- `principal`: `principal.principal`

- `client_name`: `principal.client_name`

- `properties`: `principal.properties.*`
