Agent Scope Gate plugin
The Agent Scope Gate plugin checks an agent’s identity before it lets a request through. It can require scopes, a principal type, or a consumer group, and different scopes per HTTP method or per MCP tool. When an agent lists MCP tools, the plugin leaves out the tools whose scopes the agent doesn’t hold.
A caller is an agent when JWT Auth or Postman API key auth identified it and the identity’s kind is agent. Users, and callers identified by Key Auth, pass untouched unless apply_to_humans is on.
Where it runs
Configuration
If you set none of required_scopes, require_consumer_group, allow_principal_types, methods, or tool_scopes, the plugin checks nothing.
A refused request gets 403 with {"error":"forbidden","reason":"..."}. On MCP routes, it gets HTTP 200 with JSON-RPC error -32002. The upstream isn’t called.

