Skip to navigation

Agent Static Deny plugin

The Agent Static Deny plugin blocks requests that match fixed rules on method, path, caller type, consumer type, or scope. Rules are checked in order, and the first matching rule blocks the request. A rule applies to every caller, not only agents, unless it sets a caller condition.

Where it runs

ProtocolsThe console offers it for MCP routes. The gateway itself runs it on any protocol, so a global instance also applies to HTTP and LLM routes. On MCP routes, method and path are the same for every message, so a rule can’t target one tool.
Scope kindsglobal, route, on MCP routes
PhaseRequest

Configuration

rules
array of objects

The deny rules. The console labels this Deny rules. A rule matches when every condition it sets holds. A rule with no conditions is ignored.

rules[].name
string

The rule name, returned in the response.

rules[].reason
stringDefaults to denied: <name>

The reason returned in the response. The default is denied: <name>, or request denied by agent-static-deny when the rule has no name.

rules[].methods
array of strings

HTTP methods, in any letter case.

rules[].path_exact
array of strings

Paths that must match exactly.

rules[].path_prefixes
array of strings

Path prefixes. Together with path_exact, the path must match one entry.

rules[].principal_types
array of strings

agent (or bot) and user (or human). Matches only callers with an agent identity.

rules[].consumer_types
array of strings

Consumer types from the caller’s agent identity, in any letter case.

rules[].scopes
array of strings

Matches a caller whose agent identity holds at least one of these scopes.

Paths are compared case-sensitively, after the route rewrites the path. If any entry in rules isn’t an object, every rule is ignored.

A blocked request gets 403 with {"error":"forbidden","reason":"...","rule":"..."}. On MCP routes, it gets HTTP 200 with JSON-RPC error -32002. The upstream isn’t called.

Example

{
"name": "no-agent-deletes",
"plugin_id": "agent-static-deny",
"scope": { "kind": "route", "name": "orders-api" },
"config": {
"rules": [
{
"name": "agents-cannot-delete",
"reason": "Agents can't delete orders.",
"methods": ["DELETE"],
"principal_types": ["agent"]
}
]
}
}