api-governance: Instructions file for GitHub Copilot

copilot/.github/copilot-instructions.md

api-governance copilot-instructions.md is an instructions file for GitHub Copilot from coderifts/api-governance. It costs 1,148 tokens per session, scanned A, original, MIT.

A set of coding instructions for checking changes to API and tool contracts before they are merged, deployed, published, or registered. These contracts describe interfaces such as OpenAPI, GraphQL, protobuf, AsyncAPI, MCP manifests, and agent tool schemas.

In plain words
What is it for?
Use it in repositories where contract files can change, especially to run the preflight check, interpret its action, handle approval or stop results, and require monitoring for monitored continuation.
Why use it?
It helps catch breaking interface changes and requires the full change set to be checked before releasing it.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file.

This is coderifts/api-governance's own configuration. It tells GitHub Copilot how to work on api-governance itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything api-governance configures →

Reuse

Borrowing it

Nothing to install: this file belongs to coderifts/api-governance. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/coderifts/api-governance/main/copilot/.github/copilot-instructions.md
Clone the repo
git clone --depth 1 https://github.com/coderifts/api-governance

Made for: GitHub Copilot.

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 api-governance copilot-instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/coderifts/api-governance/copilot-instructions/github.svg)](https://agentmods.dev/instructions/coderifts/api-governance/copilot-instructions)
Your own site
<a href="https://agentmods.dev/instructions/coderifts/api-governance/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/coderifts/api-governance/copilot-instructions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for api-governance copilot-instructions.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/coderifts/api-governance/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/coderifts/api-governance/copilot-instructions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,148 This file is loaded in full into every session.
When invoked 1,148 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.01148 $0.01148
Opus 5.5 $0.00459 $0.00459
Sonnet 5.5 $0.00230 $0.00230
Haiku 4.5 $0.00115 $0.00115

Measured 1mo ago against content hash 0f7d5850677c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api-governance copilot-instructions.md 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 1mo 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.

copilot/.github/copilot-instructions.md · 48 lines

How it starts

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

CodeRifts instructions for GitHub Copilot

Call preflight_change_set before merge, deploy, publish, or tool registration when a contract artifact changed (OpenAPI/Swagger, GraphQL, gRPC/protobuf, AsyncAPI, MCP manifest, or agent tool schemas).

Send the complete base-to-head change set: every changed contract artifact with full before and after content. Do not send a single-file subset when other contract files also change.

Branch on execution_action only. Do not branch on decision and do not branch on safe_for_agent (not_for_control_flow_use_execution_action). Canonical execution_action values: CONTINUE, CONTINUE_WITH_MONITORING, REQUEST_APPROVAL, STOP.

An unrecognised execution_action is not permission: fail closed (halt or re-preflight). Well-known code: not_permission_fail_closed.

When execution_action is REQUEST_APPROVAL or STOP, surface the detected patterns and the blast radius, and propose the safer path — deprecate-then-remove, an additive change, or a new version — rather than shipping the break.

CONTINUE_WITH_MONITORING requires a wired monitoring sink (monitoringSinkWired). It is not "proceed with caution" without monitoring.

Do not call preflight_change_set for: a documentation-only change (README, guides, comments) with no contract artifact content change; a static readiness score (a different capability, not a change-set decision); or to verify a receipt you already hold (that is verify_receipt — see the companion-tools rule).

If you already hold a chain receipt and only need authenticity/lifecycle: verify_receipt. If you need a past decision by id: get_decision_details. Neither replaces preflight for a new change set.

The CodeRifts MCP server exposes exactly three tools — preflight_change_set, verify_receipt, get_decision_details. Do not invent or assume others.

A receipt authorizes ONE operation: a merge receipt does not authorize a deploy. Before a different operation (deploy, publish), call preflight_change_set with context.operation set to that operation — reusing a differently-scoped receipt is not permitted and will fail at the gate.

A stale or superseded receipt on a changed head requires a NEW preflight — verify_receipt cannot re-diff.

For mutating tools, put only the guarded version in the agent's tool table; keep the raw handler host-only and unreachable from that table. How you name tools is yours — this is a reachability property, not a product rename of host tools. CodeRifts cannot see or stop a raw call the host makes outside the table it returns; adopt this as a host convention, not as a guarantee from the package.

CodeRifts reports a governance decision and execution_action; it does not by itself block merges. Blocking requires separate repository configuration (required status checks, enforcement) that this rule file does not set.

To act (mutate a contract, merge, deploy, or publish): call preflight_change_set with preflight_mode authorize. Analyze is informational — risk only, may_execute is always false — and is not permission. Read execution_action on the decision_result envelope.

Before acting under a held receipt: call verify_receipt with the same context fields the preflight was made under — operation, environment, repository, branch, pull_request — at the top level of the arguments (a context object is also accepted), AND target_id set to decision_result.artifact_digest from the decision you are acting under, AND the decision_result exactly as received. Without target_id: currently_authorized:false, authz_reason target_not_stated — a missing input, not a refusal.

Act only when currently_authorized is true (control_envelope.receipt_view.currently_authorized). A valid-looking token is not permission if currently_authorized is false or omitted.

Commit / CAS evidence is a separate measurement (commit_observation on GuardOutcome). It is not a substitute for authorize + currently_authorized. Production hosts that want the fail-closed conjunction lock it with profile: ENFORCING_STRICT on withCodeRifts.

Read the full file on GitHub · 48 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. 1mo ago Changed · +53 tokens per session 0f7d5850677c
  2. 1mo ago Changed · +2 lines · +63 tokens per session 57f7784e2c7a
  3. 2mo ago First seen · 46 lines · 1,032 tokens per session scan A 63e83e379e96

Subscribe to this mod's changes

api-governance copilot-instructions.md is an instructions file published in the GitHub repository coderifts/api-governance (0 stars, last pushed 28d ago), licensed MIT. It adds 1,148 tokens to every session, about $0.0046 per session on Opus 5.5. 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.

Related

api-governance copilot-instructions.md compared with instructions from other repositories

api-governance copilot-instructions.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
api-governance copilot-instructions.mdcoderifts/api-governanceInstructions file028d agoMITA1,148GitHub Copilot
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode