Skip to content

Docs: optional TOA verify before gateway enable - #330

Open
dulrajnr wants to merge 3 commits into
AmoyLab:mainfrom
dulrajnr:toa-optional-verify
Open

dulrajnr wants to merge 3 commits into
AmoyLab:mainfrom
dulrajnr:toa-optional-verify

Conversation

@dulrajnr

@dulrajnr dulrajnr commented Aug 31, 2026

Copy link
Copy Markdown

Summary

Docs-only. Optional offline toa-verify before enabling or promoting a proxied MCP upstream in Unla.

  • docs/toa-optional-gateway-gate.md
  • examples/toa-after-gateway.yml
  • README Documentation pointer

Does not change gateway runtime. TOA (toa/0.1) is adjacent delivery evidence, not a wire protocol and not per-call signing. No AgentStatus account is required to verify.

Test plan

  • Docs / example YAML are clearly optional and gated on toa.json
  • Copy does not claim TOA replaces Unla OAuth or config hot-reload

Made with Cursor

Summary by Sourcery

Document an optional offline TOA verification gate for validating MCP tool delivery before gateway configuration changes.

New Features:

  • Add documentation and a reusable workflow example for optionally verifying TOA delivery evidence before enabling or promoting a proxied MCP upstream.

Enhancements:

  • Clarify TOA’s role as offline delivery evidence and distinguish it from per-call signing, Unla OAuth, and gateway configuration hot-reload.

Documentation:

  • Add guidance for offline TOA verification with optional emitter and freshness requirements.
  • Link the new TOA gateway-gating documentation and example from the README.

Adjacent delivery-evidence gate only. Not on the tools/call hot path.
@sourcery-ai

sourcery-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This docs-only PR adds guidance and a copy-paste workflow example for optionally verifying pinned, offline TOA delivery evidence before enabling or promoting an Unla MCP upstream. It keeps the gate off by default, runs only when toa.json exists, and clearly separates TOA from Unla runtime behavior, OAuth, hot-reload, and per-call signing.

Flow diagram for optional TOA gateway enablement gate

flowchart TD
    A[Unla config lint and smoke checks] --> B{"hashFiles('toa.json') != ''"}
    B -->|No| C[Enable or promote MCP upstream]
    B -->|Yes| D[toa-verify toa.json --require-layer functional=pass]
    D -->|Pass| C
    D -->|Fail| E[Do not enable or promote]
Loading

File-Level Changes

Change Details Files
Documents an optional offline TOA delivery-evidence gate for enabling or promoting proxied MCP upstreams.
  • Defines TOA’s scope as signed JSON evidence verified outside the gateway hot path.
  • Recommends requiring a recent attestation and pinned emitter key, while clarifying verification needs no AgentStatus account.
  • Provides a GitHub Actions verification command gated on the presence of toa.json.
  • Explicitly excludes replacing Unla OAuth, hot-reload, or per-call signing.
docs/toa-optional-gateway-gate.md
examples/toa-after-gateway.yml
Adds a README pointer to the optional TOA gateway-gating documentation and workflow example.
  • Links the new guide and example.
  • Clarifies that TOA is not per-call signing and does not replace Unla OAuth or config hot-reload.
README.md

Possibly linked issues

  • #unknown: The docs-only PR directly implements the issue's proposed optional TOA verification example before gateway enable or promotion.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/toa-optional-gateway-gate.md" line_range="17" />
<code_context>
+
+Optional, off by default. Before enabling or promoting a proxied MCP upstream
+(or publishing a new config version), require a recent attestation and verify it
+offline with a pinned emitter public key.
+
+- Any party can emit if they sign the schema.
</code_context>
<issue_to_address>
**🚨 issue (security):** The documented command does not supply or configure the pinned emitter public key promised by the preceding text, so this workflow does not enforce which issuer is trusted. An attestation signed by an untrusted or self-declared key can therefore satisfy the shown layer check.

**Triggers:** When an organization copies this workflow expecting the verification step to enforce an emitter allowlist.

**Suggested fix:** Pass the pinned public key or verifier trust-store configuration to `toa-verify`, and document where that key is maintained.
</issue_to_address>

### Comment 2
<location path="docs/toa-optional-gateway-gate.md" line_range="17" />
<code_context>
+
+Optional, off by default. Before enabling or promoting a proxied MCP upstream
+(or publishing a new config version), require a recent attestation and verify it
+offline with a pinned emitter public key.
+
+- Any party can emit if they sign the schema.
</code_context>
<issue_to_address>
**issue (bug_risk):** The example only requires `functional=pass`; it does not enforce the documented requirement that the attestation be recent. A stale valid `toa.json` continues to pass and can be used to approve a later gateway enable or promotion.

**Triggers:** When `toa.json` contains an old but otherwise valid attestation.

**Suggested fix:** Add an explicit freshness or maximum-age check, and bind the attestation to the upstream/config version being enabled.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread docs/toa-optional-gateway-gate.md Outdated

Optional, off by default. Before enabling or promoting a proxied MCP upstream
(or publishing a new config version), require a recent attestation and verify it
offline with a pinned emitter public key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): The documented command does not supply or configure the pinned emitter public key promised by the preceding text, so this workflow does not enforce which issuer is trusted. An attestation signed by an untrusted or self-declared key can therefore satisfy the shown layer check.

Triggers: When an organization copies this workflow expecting the verification step to enforce an emitter allowlist.

Suggested fix: Pass the pinned public key or verifier trust-store configuration to toa-verify, and document where that key is maintained.

Comment thread docs/toa-optional-gateway-gate.md Outdated
Match toa-verify --require-emitter / --max-age 7d after Carmel-Labs-Inc/toa#1.
@dulrajnr

Copy link
Copy Markdown
Author

Addressed the Sourcery findings in the follow-up commit:

Carmel-Labs-Inc/toa@99e2690 ships keys/agentstatus-v1.json inside the python package (toa#2).
@dulrajnr

Copy link
Copy Markdown
Author

Sourcery findings were addressed in follow-up commits: examples now use --require-emitter agentstatus, --max-age 7d, and pin 99e2690… (packaged AgentStatus public key).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant