What you will have at the end
The orders-mcp Route from OpenAPI to MCP with the rules an agent-facing API needs: every tool call carries the identity of an agent, each agent has a budget of calls per minute, the arguments the calls carry are masked in the request records, and the audit log shows who changed the list of tools and when. Everything below was done on the real Route and measured with an MCP client.
Prerequisites
- A Route that serves MCP tools:
orders-mcpon/mcp/orderswithopenapi-to-mcpreadinghttp://orders-svc:8080/openapi.json. - A Consumer per agent. The article uses
orders_assistantwith akey-authcredential. - Traffic logging turned on under Traffic Explorer › Settings.
Identity: a Consumer per agent
An agent is a client like any other, so it signs in like one. key-auth on the Route turns every tool call into a request by a Consumer; the agent sends its key in the apikey header and the record of each call names the Consumer and the credential that admitted it. A call without a key is refused with 401 and Missing API key in request, a call with a wrong one with 401 and Invalid API key in request, both before any tool runs.
The same Route takes openid-connect instead of key-auth when agents act for a signed-in person: Keycloak and G8 walks through that Plugin on a Route. Whatever the Plugin, the engine runs it before openapi-to-mcp, so the tool conversion only ever sees an authenticated request.
Rate limits: a budget per agent
limit-count on the Route counts tool calls, and with the Key consumer_name it counts them per agent. The Route carried a budget of 100 calls per 60 seconds; for the measurement it was lowered to 10 and Rejected code set to 429, and that save is a Route update in the audit log like any other.

Twelve tools/call requests from the agent within a minute:
200 200 200 200 200 200 200 200 200 200 429 429
X-RateLimit-Limit: 10 X-RateLimit-Remaining: 0 X-RateLimit-Reset: 59
The MCP client sees an HTTP 429 and the headers that tell it when the window opens again. Traffic Explorer shows the refused calls with the Consumer’s name and gateway as the node, because the tool never ran.

The Plugin’s default refusal is 503; set 429 so that the agent’s client library treats the refusal as a limit and not as an outage. A limit-count on a Route with several nodes needs the Redis policy: Rate limiting per Consumer with limit-count.
Logs: what a tool call leaves behind
Every MCP message is a request record. By default a record carries the headers, the sizes and the timing, with the apikey header masked by the gateway before the record is stored. The arguments of a tool call are in the request body, which is not stored unless you turn it on.
Traffic Explorer › Settings › Capture turns request bodies on, with a size limit. The page says what that means: bodies can carry card numbers and passwords, viewing one needs its own permission, and every view is written to the audit log.

Under Masking › Body fields, a JSON path names the values the gateway replaces before the record is stored. For createOrder the customer id sits at $.params.arguments.requestBody.customer.

A createOrder call after the save, opened in Traffic Explorer with Show body:

Opening the body is itself an audit event, as the Capture section warns.
Audit: who changed the tool list
The tools an agent sees are the operations of the document the Plugin reads. Changing that document, or the address it is read from, changes the tool list. In this session the Plugin’s OpenAPI document URL was switched from openapi.json to openapi-v2.json, a version of the document with one more operation. The next tools/list from the agent returned four tools instead of three: listOrders, createOrder, getOrder and the new cancelOrder.
The audit log has the change as a Route update with the two URLs side by side, the actor and the time.

What the audit log does not see is a change to the document behind an unchanged URL. Treat the document as part of the agent’s permissions: serve it from a place with its own change control, and review it before you point the Plugin at a new version.
What to do next
- Give each agent its own Consumer and key, so budgets and records stay apart.
- Keep request bodies off on Routes that do not need them, and mask the fields that identify people on the ones that do.
- Put the agent’s identity on the company’s identity provider: Keycloak and G8. How G8 serves tools is on AI Gateway › OpenAPI to MCP, and the design for agents on AI agents and MCP.