mcpAuthorization— evaluates access to MCP tool calls, resources, and prompts using CEL expressions with MCP-aware context variables.authorization— evaluates access to HTTP routes using CEL expressions with HTTP-aware context variables.
true. If no rule matches, the request is denied.
Configuration location
Both policies are set underbinds[].listeners[].routes[].policies:
mcpAuthorization
object
Authorization policy for MCP access. Controls which MCP tool calls, resource reads, and prompt invocations are allowed.
CEL context variables for mcpAuthorization
The following variables are available inside CEL expressions formcpAuthorization:
Nested JWT claims are accessible using dot notation. For example, a claim
{"nested": {"key": "value"}} can be referenced as jwt.nested.key.authorization
object
Authorization policy for HTTP access. Controls which HTTP requests are allowed based on request attributes.
Rule evaluation
1
Evaluate each rule in order
Agentgateway evaluates each CEL expression in the
rules list sequentially.2
Allow on first match
If any rule returns
true, the request is allowed immediately and evaluation stops.3
Deny if no rules match
If no rules return
true, the request is denied with an HTTP 403 response.Examples
Allow specific tools
Allow specific tools
Allow anyone to call
echo, but restrict add to a specific user:Require a specific JWT claim
Require a specific JWT claim
Allow access to
printEnv only for users who have a specific nested claim value: