Agent permissions: read, write, delete, approve
An agent with a GitHub or CRM key can do everything that key can — merge,
delete, send. Most agents only need to look things up. PromptGate gives
each pg_ key an access level per MCP server, tool or API, so an agent
that should only read can’t write, whatever a prompt or a poisoned page
tells it to do. Every build is checked from the outside by the
quality gate’s mcp-permissions stage.
What it can do
Section titled “What it can do”| feature | does | |
|---|---|---|
| three levels | read: only calls that read; write: also calls that change things; full: delete too (the default) |
below |
| per server, tool or API | one access map per key: "*" for everything, mcp:github, mcp:github/merge_pull_request, api:crm — the most specific entry wins |
below |
| MCP tools classified | from the server’s own annotations (readOnlyHint, destructiveHint); a tool that says nothing counts as delete |
below |
| your word over the server’s | classify per server overrides annotations that are missing or wrong |
below |
| API calls classified | GET, HEAD, OPTIONS read; DELETE deletes; everything else writes; classify rules per API for the exceptions — a search sent as POST |
below |
| hidden, not just refused | tools/list leaves out tools above the key’s level, so the agent doesn’t try them |
below |
| logged | a refusal is a log row access: blocked delete, an event and a metric |
below |
| ask a person first | approve: delete (or write): such MCP tool calls wait until the agent’s user says yes in their client |
below |
Everything in one config:
mcp: servers: github: url: https://api.githubcopilot.com/mcp/ headers: { Authorization: "Bearer ${GITHUB_TOKEN}" } classify: # where the server's annotations are wrong or missing merge_pull_request: delete search_code: readapis: crm: url: https://crm.example.com/api headers: { set: { Authorization: "Bearer ${CRM_TOKEN}" } } classify: - { method: POST, path: /search, as: read } - { path: /admin/*, as: delete }keys: - name: support-agent hash: sha256:… access: "*": read # everything else: read only mcp:github: write # issues and comments, no merges, no deletes mcp:github/merge_pull_request: full # but this one tool, yes api:crm: read approve: delete # and a person says yes to every deletepromptgate keys create support-agent --access "*=read" --access mcp:github=write, the key form in the web UI and the
key_create control tool take the same entries.
Levels
Section titled “Levels”| level | may call |
|---|---|
read |
tools and API calls that only read |
write |
those, and the ones that create or change things |
full |
everything, deletes too — what a key without access gets |
For a call, PromptGate takes the key’s entry for the tool
(mcp:github/merge_pull_request), else for its server (mcp:github) or
API (api:crm), else "*", else full. A key’s mcp and apis lists
still decide which servers and APIs it reaches at all; access decides
what it may do there. PromptGate’s own tools keep their
control level; endpoint tools
call a model and are not classified.
MCP tools
Section titled “MCP tools”Servers describe their tools with annotations:
| annotations | class |
|---|---|
readOnlyHint: true |
read |
destructiveHint: false |
write |
| anything else, or none | delete — the protocol’s own default for a tool that says nothing |
Annotations come from the server, and a server can be wrong or lie: a
tool marked read-only that deletes would pass a read key. Set
classify for the tools that matter; it always wins. Which tool counts
as what follows from the annotations in the server’s tool list.
API calls
Section titled “API calls”| method | class |
|---|---|
| GET, HEAD, OPTIONS | read |
| DELETE | delete |
| POST, PUT, PATCH | write |
classify rules per API go first, in order: method (empty: any),
path (a pattern below the API, /search, /admin/*) and as.
What the agent sees
Section titled “What the agent sees”- MCP:
tools/listshows only the tools within the key’s level. A call to one above it anyway gets JSON-RPC error-32028— “Access denied: github__merge_pull_request deletes, and this key may only read it (access: read).” The server never sees the call. - API Gateway: 403,
forbidden, with the same reason.
Both are a log row with access: blocked <class> and status 403, an
event and a metric, like a guardrail’s block.
Approvals
Section titled “Approvals”approve holds MCP tool calls until a person says yes: delete holds
the calls that delete, write those that write or delete, off (the
default) none. The access level comes first — a call it refuses is
never asked about.
PromptGate asks through the agent’s own client, the way MCP lets a server ask its user (elicitation): “PromptGate: allow github__merge_pull_request (deletes) for key “agent”? Arguments: …“, and the client shows it. With yes the call goes on; with no the agent gets a tool error, “The user did not approve …”, and the server never sees the call.
| client | how it is asked |
|---|---|
| 2026-07-28 (stateless) | the call is answered with input_required and an elicitation/create form; the client sends the call again with the answer |
| 2025-06-18 and 2025-11-25 sessions | PromptGate sends elicitation/create on the call’s event stream and waits for the client’s answer, up to 10 minutes |
- Bound to the call: a stateless question carries a sealed state with the key, the tool and the arguments. Other arguments, a changed state or one sent twice are asked about again; a question is open for 10 minutes, and a restart of PromptGate asks again.
- The server’s own questions after a yes (a login, a choice) pass through, and the yes holds across them.
- Audit trail: every answer is an entry,
tool.approvedortool.declined, with the key, the tool and the agent’s address (audit). - Clients that can’t ask — those that declare no
elicitation, 2025-03-26 sessions, and requests that accept no event stream — get such calls refused (error-32021, missing client capability), never passed unasked. The API Gateway has no client to ask:approvedoesn’t apply to it; useaccessthere.
Limits
Section titled “Limits”- The level is about the call, not its effect: a “read” tool with a
side effect — a search that logs, a fetch that triggers a webhook —
is still read.
classifyit if that matters. - Levels don’t look at arguments:
writeonrun_queryis write forSELECTandDROP TABLEalike. Give such toolsdeleteand the agentwrite, or keep them out of the key’smcplist.
Common settings for keys are in configuration; the MCP gateway and the API Gateway describe the rest of what a key may do there.