Implementation Guide

    Rate-Limiting Bulk Issue and Pull Request Changes by AI Agents on the GitHub MCP Server

    Rate limit AI agents on the GitHub MCP server in layers. Narrow what the agent's credential and the MCP server configuration allow, treat GitHub's platform limits as a shared backstop, and enforce per-agent, per-tool, per-repository and per-time-window limits on each write tool call in the execution path. Define what happens at the threshold (allow, block or escalate for human approval) and record every decision.

    1. 1

      1. Token and app permissions

      Issue each agent its own identity with the minimum repository access and permissions. Avoid sharing one broad personal token across agents and other automation.

    2. 2

      2. MCP server configuration

      Enable only the toolsets the task requires. Use read-only mode for agents that triage or summarize. Filter write tools an agent should never call.

    3. 3

      3. GitHub platform limits

      GitHub's API limits apply to authenticated traffic regardless of your policy. Treat them as a backstop, not a control, because they are shared and not agent-aware.

    4. 4

      4. Policy enforcement in the execution path

      Evaluate each write tool call against explicit limits before it reaches GitHub, and apply the defined threshold behavior.

    5. 5

      Allow within threshold

      The call proceeds and the decision is recorded with the agent, tool, repository and current count.

    6. 6

      Block at the hard limit

      The call is refused with a clear reason returned to the agent so it does not retry in a loop.

    7. 7

      Escalate for human approval

      For merges, closures or large batches, hold the call and route it to a named approver with the pending change set.

    8. 8

      Trip a circuit breaker on repeated breaches

      After repeated blocks, suspend the agent identity's write tools until an owner reviews.

    Rollout checklist for platform teams

    • Inventory which agents connect to the GitHub MCP server and which write tools each can call.
    • Give each agent a separate identity with least-privilege repository access.
    • Move triage and reporting agents to read-only mode and enable only required toolsets elsewhere.
    • Set per agent, per tool, per repository and per window limits from observed traffic.
    • Assign allow, block or escalate behavior to each write tool, with named approvers for merges and closures.
    • Review recorded decisions regularly and adjust limits as agent use changes.

    Why bulk agent writes need their own limits

    The GitHub MCP server gives an agent tools that create, update, comment on, label, close and merge issues and pull requests. A human performs these actions at human speed. An agent can perform them in a tight loop. A misprompted agent, a looping agent, or one steered by injected instructions can produce hundreds of changes before anyone notices.

    The consequences are operational. Repositories fill with noise, CI runs and notifications multiply, and the API budget of the shared credential is consumed, which affects other automation using it. Some changes, such as closed issues or merged pull requests, are hard to reverse in bulk. Asynchronous coding agents already produce commits and pull requests without a developer present in real time, so human attention cannot be the only rate limiter.

    Native controls address part of this. Token permissions decide what is possible, and GitHub's API limits bound total request volume. Neither is designed to express how many times a particular agent may call a particular write tool against a particular repository in a given window. That gap is what a tool-call limit fills.

    Choosing limit dimensions

    Four dimensions cover most bulk-change scenarios. Per agent identity limits contain a single misbehaving agent without affecting others. Per tool limits reflect risk: commenting and labeling can tolerate higher volume than closing or merging. Per repository limits stop one agent from flooding one project, and they allow stricter ceilings on critical repositories. Per time window limits turn a total into a rate, typically with a short window to catch loops and a longer one to catch slow, sustained drift.

    Combine dimensions rather than choosing one. A useful rule has the form: agent A, tool T, repository R, N calls per window. NIST notes that the correct limit is contextual and depends on the organization and application, and its example of five calls per minute is an illustration, not a recommendation. Set initial values from observed agent traffic, then tighten.

    Keep rate limits distinct from quotas. A rate limit applies over a short window to protect availability and repositories. A quota covers an extended period, often tied to billing. Agent write limits are rate limits. Add concurrency limits and a cap on how many downstream calls a single agent task may trigger, since NIST recommends combining rate limits with timeouts, circuit breaking and anomaly detection.

    Evidence and where Trussed fits

    Each decision should generate a record: agent identity, tool, target repository, the limit that applied, the count at decision time, the outcome (allowed, blocked or escalated), and the approver and response for escalations. Without this, a team can say a limit existed but cannot show what the agent was allowed to do and what it did. NIST observes that explicit policies such as rate limits are well suited to automated enforcement, which also makes them straightforward to record against.

    Trussed enforces policy on individual MCP tool calls in the execution path, including rate limiting and escalation for human approval. Limits are enforced at runtime, not reviewed after the fact, and enforcement produces audit-ready evidence that regulated enterprises can use to show what their AI was allowed to do. Trussed runs self-managed in the customer cloud, with configurable retention and data residency. Teams that build this layer themselves need to meet the same requirements: enforcement before the call executes, per-tool behavior, and durable decision records.

    Layered limits for agent write traffic

    Credential scope

    Limit which repositories and actions the token or app can reach.

    MCP server configuration

    Expose only the toolsets an agent needs, or run read-only.

    Platform limits

    GitHub's own API limits apply as a shared backstop.

    Tool-call policy

    Enforce volume limits and escalation per call, at runtime.

    Enforce write limits on individual MCP tool calls

    See how policy is enforced in the execution path and how each allow, block or escalate decision becomes audit-ready evidence.

    Request a Demo
    Next step

    How does your AI governance program compare?

    See where your program has gaps in less than 2 minutes.