How it works
The proxy runs inside the Paseo daemon, as part of the plugin. There is no external service.
The injected tools
When an agent session opens, the plugin adds its github_* tools to it (Paseo exposes plugin agent tools to the agent as MCP tools). Every agent gets them; sessions opened for history do not. With the soft rule on, a short instruction is also added to the system prompt: saved when an agent is created (the only path on Paseo 0.16, marked in the agent metadata) and appended when a session opens on Paseo 0.17 or later, and each tool description says to use it instead of gh or curl.
The pipeline of one call
- Classify. A curated tool states its action (for example
create_pr).github_apiis classified from the request: the method, the path, or the GraphQL root fields. - Owner allowlist. Every owner the call touches must be allowed. A call that cannot be tied to an owner is refused, unless every owner is allowed.
- Policy. Each needed action is checked. A matching deny rule wins, then an allow rule, then the default permissions. A denial returns a message naming the rule and reason.
- Cache. A read younger than the TTL is answered locally. An older one is sent with
If-None-Match; a304costs no rate limit and restarts the clock. - Credentials. The active source is used, then the other if fallback is on. With GitHub Apps, the App is chosen by the owner of the call: the App claiming it, else the default App. A credential that is rate limited is skipped until it resets.
- Response. The rate-limit headers are recorded, the response is cached, a write drops the cached reads of that repository, and the call is added to the activity log.
Cache
Entries are keyed by method, URL and request body, kept in memory and in cache.json so they survive a restart, and trimmed oldest-used first (500 entries or about 25 MB). Reads are served locally for the TTL (30 seconds by default, 0 to 3600, set in the Policy tab). Past it, the saved ETag is sent. GraphQL queries have no ETag, so they are cached by TTL only; mutations are never cached.
Rate limits
The plugin tracks x-ratelimit-* per credential (the gh CLI and each GitHub App) and per resource (core, graphql, search). A credential is blocked until its reset (the other Apps keep working) when a response says the limit is exhausted, carries retry-after, or reports a secondary limit. With nothing left to try, the agent gets a cached answer marked as stale when one exists, and otherwise an error such as Retry at 14:07 (in about 12 min). The Overview tab shows the remaining count, a live countdown, and a warning when a limit is nearly used up.
Policy
A policy is a default list of allowed actions (from a preset, read-only by default) plus ordered rules. See the reference for the actions and how generic calls are classified. The generic github_api tool can never bypass a rule: a merge through it needs both merge and generic_api_write.
What is stored, and where
| File | Contents |
|---|---|
config.json | Active source, fallback, allowed owners, TTL, soft rule, hard rule, policy. |
apps.json | The GitHub Apps: organization, App ID, installation ID, extra owners, default flag. No secret. |
secrets.json (0600) | The private key of each GitHub App. |
cache.json | Cached GitHub responses, kept per credential so an answer is never shared between Apps. |
All four are in $PASEO_HOME/plugin-data/lerenn/paseo-github-proxy/. The activity log and counters live in memory and reset when the plugin restarts.
Limits
- The soft rule is an instruction. An agent with a shell can still run
gh. - The hard rule (Block gh/curl commands) only sees permission requests, so an agent in a bypass mode is never checked. It matches command words, it is not a sandbox: a script file or a command built at run time gets through. Block egress to GitHub on the daemon machine for a real block.
- GraphQL scoping is best effort: it checks the repository you pass and
owner:values in the query. Queries by node ID cannot be scoped to an owner and are refused unless every owner is allowed. - On Paseo 0.16 the soft rule only reaches agents created after it was turned on.