Contact Us 1-800-596-4880

MCP Attribute-Based Access Control Policy

Policy Name

MCP Attribute-Based Access Control

Summary

Controls access to tools, resources, and prompts based on user information such as Tiers, IP, Headers, or Claims

Category

MCP

First Omni Gateway version available

v1.9.3

Release Notes

MCP Attribute-Based Access Control

Returned Status Codes

400 - Invalid token

This policy supports Model Context Protocol (MCP) version 2025-06-18 and earlier. To learn more about MCP, see MCP Specification.

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 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.

Payload Handling

The MCP Attribute-Based Access Control policy handles requests and responses differently:

  • Requests: The policy buffers the full request body.

  • Responses: The policy processes only tools/list, resources/list, and prompts/list responses. It buffers the full body of JSON responses. For SSE (text/event-stream) responses, it processes the stream one event at a time and doesn’t buffer the full stream. Responses to other methods pass through.

Buffered payloads count toward the Omni Gateway payload limit, which is 1 MB by default. To change the limit on a self-managed Omni Gateway, set the FLEX_DOWNSTREAM_CONNECTION_BUFFER_LIMIT_BYTES environment variable. In Connected Mode, you can also set Global connection buffer limit in Runtime Manager. For more information, see Configure Global and Routing Settings in Runtime Manager. For more information about the limit, see Omni Gateway Limits and Performance Metrics.

Configure Policy Parameters

Omni Gateway Local Mode

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

Managed Omni Gateway and Omni Gateway Connected Mode

When you apply the policy from the UI, the following parameters are displayed:

Element Description

Rules

Rules to control access to tools, resources, and prompts written in the Cedar policy language.

Cedar Expression

Cedar expression defining the access rule. For example: permit(principal,action == Action::"tools/call or resource == Tool::"calculator");. To learn more about the Cedar bindings provided by the requests, see Writing Cedar Rules.

Authentication Type

Type of authentication used by the authentication policy applied before this policy.

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:

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.

For the Rust AuthenticationData structure:

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.*