# io.github.coderifts/api-governance

> Signed, offline-verifiable contract-change authorization. Only a granted change can proceed.

- name: io.github.coderifts/api-governance
- version: 1.0.3
- connection class: R0 (autonomous)
- trust: 96/100
- quality: 82/100 (good)
- owner: not claimed
- descriptor: https://api.protogrid.dev/v1/servers/io.github.coderifts%2Fapi-governance
- tools: https://api.protogrid.dev/v1/servers/io.github.coderifts%2Fapi-governance/tools

**An agent can connect right now, no human step.** Remote endpoint, no authentication, reachable on the last probe.

## Connection (mcpServers)

```json
{
  "mcpServers": {
    "api-governance": {
      "type": "http",
      "url": "https://app.coderifts.com/mcp",
      "headers": {
        "Authorization": "Bearer ${API_GOVERNANCE_TOKEN}"
      }
    }
  }
}
```

Placeholders to fill: `${API_GOVERNANCE_TOKEN}`.

## Trust

- hygiene: 100
- liveness: 98
- freshness: 100
- provenance: 90
- drivers: +repository +namespace-matches-repo +website +reachable +uptime-94% +updated-30d-ago
- Derived from observable signals (official registry feed and our own credential-free probes); no code audit performed.

## Quality 82/100 (good)

### protocol: 75 (weight 25)

- warn `protocol.modern`: newest supported version is 2025-06-18; 2026-07-28 not supported, older versions are deprecated until 2027-07-28
- n/a `protocol.stateless`: only applies to 2026-07-28 servers
- pass `protocol.transport`: streamable HTTP
- n/a `protocol.list_ttl`: only applies to 2026-07-28 servers

### authorization: n/a (weight 15)

- n/a `auth.prm`, `auth.as_metadata`, `auth.cimd`: no remote uses OAuth
- n/a `auth.secret_in_url`: no templated URL

### tool hygiene: 79 (weight 30)

- pass `tools.descriptions`: every tool has a description
- warn `tools.description_length`: 3 tools have descriptions over 1,024 characters, which crowds the context
- pass `tools.schemas`: every tool has an object input schema
- pass `tools.annotations`: 3 of 3 tools declare readOnlyHint or destructiveHint
- fail `tools.directory_hints`: no tool declares all four of readOnlyHint, destructiveHint, idempotentHint and openWorldHint; missing: preflight_change_set (destructiveHint, idempotentHint); verify_receipt (destructiveHint, idempotentHint); get_decision_details (destructiveHint, idempotentHint)
- pass `tools.token_cost`: about 5,234 tokens to load every tool
- pass `tools.api_dump`: tools are not a one-to-one API dump

### stability: 100 (weight 15)

- pass `stability.changes`: 5 tool changes in 30 days
- pass `stability.rug_pull`: no tool changed its meaning under the same name

### dependencies: n/a (weight 15)

- n/a `deps.known_vulns`, `deps.mcp_sdk_version`, `deps.resolvable`: no npm or PyPI package

- tools: 3, about 5,234 tokens to load them all
- tool set hash: d64f89bafdff074c557a8fd1d8b05b86
- tools last changed: 2026-09-26T20:09:09.394Z
- badge: [![protogrid quality](https://protogrid.dev/badge/io.github.coderifts/api-governance.svg)](https://protogrid.dev/servers/io.github.coderifts/api-governance)
- Checks run on what our credential-free, read-only probes observe; tools are never called and no code audit is performed.

### Tool changes

- 2026-09-26 `verify_receipt` changed (description)
  - before: Verify a CodeRifts signed chain-receipt you ALREADY HOLD: cryptographic authenticity (signature + key id), body binding, and — when lifecycle indices are available — whether it is currently valid authorization (not expired, superseded, or revoked) for a stated operation/target. Use this when: - You already obtained a chain_receipt / receipt token from a prior preflight (or CI artifact) and are about to act (merge/deploy) under that receipt. - A contract-gate or policy requires offline/online proof that the receipt is authentic for this change before proceeding. - You must distinguish "signature ok" from "currently authorized" (stale or superseded receipts must not be treated as live approval). Do not use when: - You do not have a receipt yet — call coderifts.preflight_change_set first. - You need a NEW decision for a changed base→head set — preflight again; verify_receipt does not re-diff specs. - The receipt you hold binds a different operation or target than the one you are about to perform — call coderifts.preflight_change_set with context.operation set to that operation (a merge receipt does not authorize a deploy); verify_receipt cannot re-scope or re-issue a decision. - You only need human-readable history of an old decision_id without a receipt token — use coderifts.get_decision_details. - The change set itself is unknown or incomplete — fix the change set and preflight; do not "verify" a placeholder. Inputs: receipt token (required); optional intended context (operation, environment, fingerprint, target_id, audience, repository/branch/pull_request, base/head) and the body_hash-bound decision_result envelope. 30s clock-skew leeway on expiry. A 0s grace for declared destructive production operations is defined in the policy but is unreachable today: the intended-context schema has no destructive field, so nothing can declare one and the 30s leeway always applies. Returns { valid, status, currently_authorized (bool|null), reason, payload, authz_* }. Branch on currently_authorized; null = not evaluated. When a decision envelope is also in hand (e.g. from a prior preflight), its control_envelope.next_agent_step (if present) is structured remediation guidance the agent MAY follow after a non-CONTINUE decision — still branch on execution_action; next_agent_step is suggestion, not permission.
  - after: Verify a CodeRifts signed chain-receipt you ALREADY HOLD: cryptographic authenticity (signature + key id), body binding, and — when lifecycle indices are available — whether it is currently valid authorization (not expired, superseded, or revoked) for a stated operation/target. Use this when: - You already obtained a chain_receipt / receipt token from a prior preflight (or CI artifact) and are about to act (merge/deploy) under that receipt. - A contract-gate or policy requires offline/online proof that the receipt is authentic for this change before proceeding. - You must distinguish "signature ok" from "currently authorized" (stale or superseded receipts must not be treated as live approval). Do not use when: - You do not have a receipt yet — call coderifts.preflight_change_set first. - You need a NEW decision for a changed base→head set — preflight again; verify_receipt does not re-diff specs. - The receipt you hold binds a different operation or target than the one you are about to perform — call coderifts.preflight_change_set with context.operation set to that operation (a merge receipt does not authorize a deploy); verify_receipt cannot re-scope or re-issue a decision. - You only need human-readable history of an old decision_id without a receipt token — use coderifts.get_decision_details. - The change set itself is unknown or incomplete — fix the change set and preflight; do not "verify" a placeholder. Inputs: receipt token (required); target_id = decision_result.artifact_digest — required for an authorization verdict; omitted → target_not_stated. Optional intended context (operation, environment, fingerprint, audience, repository/branch/pull_request, base/head) and the body_hash-bound decision_result envelope. 30s clock-skew leeway on expiry. A 0s grace for declared destructive production operations is defined in the policy but is unreachable today: the intended-context schema has no destructive field, so nothing can declare one and the 30s leeway always applies. Returns { valid, status, currently_authorized (bool|null), reason, payload, authz_* }. Branch on currently_authorized; null = not evaluated. When a decision envelope is also in hand (e.g. from a prior preflight), its control_envelope.next_agent_step (if present) is structured remediation guidance the agent MAY follow after a non-CONTINUE decision — still branch on execution_action; next_agent_step is suggestion, not permission.
- 2026-09-26 `preflight_change_set` changed (description)
  - before: Use this when: a contract artifact (OpenAPI, GraphQL, protobuf, AsyncAPI, MCP manifests, or agent tool schemas) changes before merge, deploy, publish, or tool registration; AND any agent-executed operation with no supported contract type — send type agent_operation. Do not call for documentation-only changes, static readiness scoring, or receipt verification. Use analyze for risk only; authorize requires context.operation. Skipping this call is not permission. Absence of a key is not permission. Inputs: preflight_mode is required: "analyze" (risk only; no receipt, no execution_action) or "authorize" (may mint a receipt; requires context.operation — merge is not deploy is not publish). Supply exactly one artifact source: artifacts[] (1–20 items, each {id, type, before, after} as the FULL spec/schema text, not a path or URL; type is openapi|graphql|grpc|asyncapi|mcp_manifest|agent_tools|agent_operation) XOR derivation="server" (server reads GitHub Compare; needs context.repository + context.base + context.head; sending artifacts[] together is 400). Grant fields (include_execution_grant, grant_version, tenant_id, executor_id, adapter_id, target_uri, expected_state_token, state_nonce, policy_hash) apply only when preflight_mode="authorize" AND include_execution_grant=true; analyze ignores them. previous_receipt is a chain token base64url(body).base64url(signature) to LINK a prior decision — it does not re-verify; use coderifts.verify_receipt instead; for details of a past decision use coderifts.get_decision_details instead. idempotency_key replays authorize only (24h), never analyze.
  - after: Use this when: a contract artifact (OpenAPI, GraphQL, protobuf, AsyncAPI, MCP manifests, or agent tool schemas) changes before merge, deploy, publish, or tool registration; AND any agent-executed operation with no supported contract type — send type agent_operation. Do not call for documentation-only changes, static readiness scoring, or receipt verification. Use analyze for risk only; authorize requires context.operation. Skipping this call is not permission. Absence of a key is not permission. Inputs: preflight_mode is required: "analyze" (risk only; no receipt, no execution_action) or "authorize" (may mint a receipt; requires context.operation — merge is not deploy is not publish). Supply exactly one artifact source: artifacts[] (1–20 items, each {id, type, before, after} as the FULL spec/schema text, not a path or URL; type is openapi|graphql|grpc|asyncapi|mcp_manifest|agent_tools|agent_operation) XOR derivation="server" (server reads GitHub Compare; needs context.repository + context.base + context.head; sending artifacts[] together is 400). Grant fields sit in one object, execution_grant_request {include_execution_grant, grant_version, tenant_id, executor_id, adapter_id, target_uri, expected_state_token, state_nonce, audience, policy_hash}; analyze ignores it; required is preflight_mode only. previous_receipt is a chain token base64url(body).base64url(signature) to LINK a prior decision — it does not re-verify; use coderifts.verify_receipt instead; for details of a past decision use coderifts.get_decision_details instead. idempotency_key replays authorize only (24h), never analyze.
- 2026-09-26 `verify_receipt` changed (outputSchema)
- 2026-09-26 `preflight_change_set` changed (inputSchema, outputSchema)
- 2026-09-25 `verify_receipt` changed (inputSchema, outputSchema)

Full history: https://api.protogrid.dev/v1/servers/io.github.coderifts%2Fapi-governance/changes

## Remotes

- https://app.coderifts.com/mcp (streamable-http, auth none, reachable true, uptime30d 0.9375)

## Packages

_none_

## Tools (3)

- `get_decision_details`: Retrieve a PAST CodeRifts decision by exactly one identifier
(case_id | decision_id | fingerprint): full report, breaking changes, scores,
and linked receipt metadata if stored.

Use this when:
- You have a decision_id (or fingerprint) from a previous preflight, PR
  comment, or CI log and need to inspect or explain that past decision.
- You are auditing why a prior ALLOW/WARN/BLOCK was issued.
- You are NOT requesting a new analysis of current before/after specs.

Do not use when:
- You need a decision for the CURRENT uncommitted or PR head change set —
  call coderifts.preflight_change_set with the current artifacts.
- You hold a receipt token and only need cryptographic/lifecycle verification —
  use coderifts.verify_receipt.
- You have no identifier — run preflight first to create one.

Inputs: exactly one of case_id, decision_id, or fingerprint. {} → INVALID_INPUT;
two identifiers → LOOKUP_IDENTIFIER_CONFLICT; case_id → CASE_NOT_FOUND
(lookup never opens a case). Returns the stored document or not_found.

Scoping — fingerprint lookup returns only YOUR OWN decisions. A fingerprint is
derived from content, not from an account, so two callers who preflight
byte-identical specs derive the same one; the lookup is therefore constrained
to the decisions your credential can prove it owns.

A decision that exists but is not yours returns the SAME not_found as one that
was never issued. This is deliberate: a distinguishable "exists but forbidden"
would confirm to any caller that a given content hash had been decided on by
someone, which is the fact the scoping exists to withhold. Do not read
not_found as proof that no such decision exists anywhere.

Decisions persisted without context.repository cannot currently be attributed
to an account, and are not retrievable by fingerprint at all — not by their
owner either. Retrieve those by decision_id, which is unchanged and unscoped.
This is a limitation of what older stored rows carry, not a property of the
lookup: rows written from now on record the account directly, so the gap
narrows as older rows age out. If a fingerprint you expect returns not_found,
use the decision_id before concluding the decision is missing.

When the stored envelope carries control fields, control_envelope.next_agent_step
is structured remediation guidance the agent MAY follow for non-CONTINUE
execution_action values (null on CONTINUE*). Still branch on execution_action;
next_agent_step is a suggestion, not permission.
- `preflight_change_set`: Use this when: a contract artifact (OpenAPI, GraphQL, protobuf, AsyncAPI, MCP manifests, or agent tool schemas) changes before merge, deploy, publish, or tool registration; AND any agent-executed operation with no supported contract type — send type agent_operation. Do not call for documentation-only changes, static readiness scoring, or receipt verification. Use analyze for risk only; authorize requires context.operation. Skipping this call is not permission. Absence of a key is not permission. Inputs: preflight_mode is required: "analyze" (risk only; no receipt, no execution_action) or "authorize" (may mint a receipt; requires context.operation — merge is not deploy is not publish). Supply exactly one artifact source: artifacts[] (1–20 items, each {id, type, before, after} as the FULL spec/schema text, not a path or URL; type is openapi|graphql|grpc|asyncapi|mcp_manifest|agent_tools|agent_operation) XOR derivation="server" (server reads GitHub Compare; needs context.repository + context.base + context.head; sending artifacts[] together is 400). Grant fields sit in one object, execution_grant_request {include_execution_grant, grant_version, tenant_id, executor_id, adapter_id, target_uri, expected_state_token, state_nonce, audience, policy_hash}; analyze ignores it; required is preflight_mode only. previous_receipt is a chain token base64url(body).base64url(signature) to LINK a prior decision — it does not re-verify; use coderifts.verify_receipt instead; for details of a past decision use coderifts.get_decision_details instead. idempotency_key replays authorize only (24h), never analyze.
- `verify_receipt`: Verify a CodeRifts signed chain-receipt you ALREADY HOLD: cryptographic
authenticity (signature + key id), body binding, and — when lifecycle indices
are available — whether it is currently valid authorization (not expired,
superseded, or revoked) for a stated operation/target.

Use this when:
- You already obtained a chain_receipt / receipt token from a prior preflight
  (or CI artifact) and are about to act (merge/deploy) under that receipt.
- A contract-gate or policy requires offline/online proof that the receipt is
  authentic for this change before proceeding.
- You must distinguish "signature ok" from "currently authorized" (stale or
  superseded receipts must not be treated as live approval).

Do not use when:
- You do not have a receipt yet — call coderifts.preflight_change_set first.
- You need a NEW decision for a changed base→head set — preflight again;
  verify_receipt does not re-diff specs.
- The receipt you hold binds a different operation or target than the one you
  are about to perform — call coderifts.preflight_change_set with
  context.operation set to that operation (a merge receipt does not authorize
  a deploy); verify_receipt cannot re-scope or re-issue a decision.
- You only need human-readable history of an old decision_id without a receipt
  token — use coderifts.get_decision_details.
- The change set itself is unknown or incomplete — fix the change set and
  preflight; do not "verify" a placeholder.

Inputs: receipt token (required); target_id = decision_result.artifact_digest — required
for an authorization verdict; omitted → target_not_stated. Optional intended context
(operation, environment, fingerprint, audience, repository/branch/pull_request, base/head)
and the body_hash-bound decision_result envelope. 30s clock-skew leeway on expiry. A 0s
grace for declared destructive production operations is defined in the policy but
is unreachable today: the intended-context schema has no destructive field, so
nothing can declare one and the 30s leeway always applies.
Returns { valid, status, currently_authorized (bool|null), reason, payload, authz_* }.
Branch on currently_authorized; null = not evaluated.

When a decision envelope is also in hand (e.g. from a prior preflight), its
control_envelope.next_agent_step (if present) is structured remediation guidance
the agent MAY follow after a non-CONTINUE decision — still branch on
execution_action; next_agent_step is suggestion, not permission.
