02-protocol

02-protocol is an agent for coding agents from NexgenSystemsMX/scopegate. It costs 0 tokens per session (3,158 once invoked), scanned A, original, Apache-2.0.

An operating guide for coding agents using ScopeGate, a gateway that grants temporary permission to perform specific actions. It explains how to request and use those permissions without exposing stored secrets.

In plain words
What is it for?
Use it when an agent needs temporary access to services such as GitHub, AWS, or Huly through ScopeGate. It covers the permission model and the required operating procedure.
Why use it?
It helps agents follow the required permission process for sensitive operations and prevents the gateway from rejecting actions that do not follow its rules.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/nexgensystemsmx/scopegate/02-protocol
Clone the repo
git clone --depth 1 https://github.com/NexgenSystemsMX/scopegate

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 02-protocol

README.md
[![agentmods](https://agentmods.dev/badge/agents/nexgensystemsmx/scopegate/02-protocol.svg)](https://agentmods.dev/agents/nexgensystemsmx/scopegate/02-protocol)
Your own site
<a href="https://agentmods.dev/agents/nexgensystemsmx/scopegate/02-protocol"><img src="https://agentmods.dev/badge/agents/nexgensystemsmx/scopegate/02-protocol.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,158 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.03158
Opus 5 $0.00000 $0.01579
Sonnet 5 $0.00000 $0.00632
Haiku 4.5 $0.00000 $0.00316

Measured 4d ago against content hash 631ae1f9b0a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

02-protocol scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/02-protocol.md · 247 lines

How it starts

The opening of the file, as written. The whole thing — 247 lines — stays where its author put it; the contents beside it link to each section on GitHub.

02 — The Agent Protocol: Operating Behind the Gateway

This guide defines how you (an autonomous coding agent) work with ScopeGate's ephemeral capabilities. It is the operational contract: follow it exactly and privileged work flows; deviate and the gateway fails closed against you.

Prerequisites: ScopeGate is installed and you can call its MCP tools (scopegate_request_capability, scopegate_list_capabilities, …). If not, see the setup guide first. Tool argument schemas live in 03 — Tools Reference; this document covers the protocol, not every field.

1. Mental model

A capability is not a credential. You never see, hold, or transmit a secret value. Secrets live in the encrypted vault; the gateway injects them into upstream requests inside the proxy, outside your context. What you hold is a capability: a permission string of the form <upstream>:<action>:<resource>, e.g. github:write:myorg/myrepo, aws:deploy:staging, huly:read:*. Proxied tool calls map to <upstream>:call:<toolName> when no finer scope applies.

A grant is a time-boxed, audited materialization of a capability. When policy allows your request, the engine issues a persistent grant (UUID, expiresAt, issuing rule). Every grant has a TTL and dies on its own — the default ceiling is 15 minutes unless the matched rule says otherwise.

Why a leaked token is worth ~zero. Any token a minter produces for a call is clamped to the remaining TTL of the covering grant (token_ttl = min(provider ceiling, grant TTL)). It is scoped to one capability, expires with the grant, and every use is attributed in the Ed25519-chained audit log. Meanwhile the long-lived secret never left the vault, and honeytoken decoys (canary:* refs) turn any exfiltration attempt into a high-precision alarm (see §5). Stealing what you can touch buys an attacker minutes of narrow, fully-logged access.

2. Lifecycle of a privileged action

  1. Ask before you act. Call scopegate_request_capability with the minimum capability and a one-line reason (required — it goes to the audit log). Optionally pass ttl (strict format: 30s, 5m, 1h).
  2. The engine evaluates, in this order: rate limit → honeytoken mention → existing covering grant (idempotent re-request: returned as-is, never duplicated) → hard-limit deny globs (fail-closed, beat every rule) → policy rules in order (require: human_approval → escalation; auto_approve → grant). TTL is always min(requested, rule/default ceiling, limits.max_ttl) — you can shorten, never extend.
  3. Read the verdict. Three shapes come back:

Read the full file on GitHub · 247 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 247 lines · 0 tokens per session scan A 631ae1f9b0a0

Subscribe to this mod's changes

02-protocol is an agent published in the GitHub repository NexgenSystemsMX/scopegate (0 stars, last pushed 17d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,158 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.