Skip to content

docs+examples: working block-first quickstart, mock upstream, enforcing example policies#417

Merged
imran-siddique merged 3 commits into
mainfrom
fix/quickstart-and-examples
Jul 23, 2026
Merged

docs+examples: working block-first quickstart, mock upstream, enforcing example policies#417
imran-siddique merged 3 commits into
mainfrom
fix/quickstart-and-examples

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

Follow-up to #414 (merged). The example policies here depend on the resource fix in #414 to enforce, which is now on main.

Why

The repo quickstart 502'd on the first call, the example catalogs failed schema validation, and the example policies did not enforce (root cause fixed in #414).

What

  • scripts/mock_upstream.py: minimal JSON-RPC MCP upstream on :9001 so an allowed call has something to forward to. The blocked call needs no upstream.
  • docs/quickstart.md: rewritten to lead with a policy block (403 at the gateway, no upstream), then an allowed call to the mock. Resource-scoped policy that matches the runtime, enforcing mode, rotation_mode removed from the catalog, a validate-config checkpoint, expected dev-mode startup warnings called out, explicit second/third-terminal setup. Ran end to end: block = 403, allow = 200, claim records allowed: 1, denied: 1, cmcp verify = partially_verified.
  • examples/minimal + examples/bfsi-demo: policies rewritten to the runtime dialect; rotation_mode stripped; fingerprints fixed; definition_hash added. Verified via loader + evaluator: minimal permits echo; bfsi allows normal calls, blocks communication.send under MNPI and uncovered external calls under PHI.
  • docker-compose.yml: repointed at the examples/minimal bundle with the mock on :9001 sharing the gateway network namespace.

Not verified here

No docker in the authoring environment, so docker-compose.yml is correct-by-construction but not smoke-tested. It needs one docker compose up --build before the party. Everything else was run against the live runtime.

🤖 Generated with Claude Code

imran-siddique and others added 3 commits July 23, 2026 16:06
Adds scripts/mock_upstream.py, a minimal JSON-RPC MCP upstream on :9001 so an
allowed tool call has something to forward to. Rewrites docker-compose to mount
the examples/minimal bundle and run the mock in the gateway's network namespace,
replacing the previous config that pointed at files and a port that did not exist.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The old walkthrough forwarded the first call to an upstream that was never
started (502) and used a Cedar policy that did not actually enforce. Rewrites it
to lead with a policy block (403 at the gateway, no upstream needed), then an
allowed call against the mock upstream. Uses resource-scoped policies that match
the runtime, drops the schema-invalid rotation_mode from the catalog, adds a
validate-config checkpoint, notes the expected dev-mode startup warnings, and
spells out the second/third-terminal setup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The example policies targeted the cMCP:: Cedar namespace the backend never emits,
so none of them matched (every call default-denied or, in advisory, forwarded).
The catalogs carried a schema-invalid rotation_mode field and placeholder TLS
fingerprints that failed validation, and lacked definition_hash, so the gateway
refused to start.

- rewrite policies to the resource/action dialect the runtime uses
- bfsi block-phi: check context.baa_covered (resource entities carry no attributes)
- strip rotation_mode, fix fingerprints to the required format, add definition_hash

Verified: minimal permits echo; bfsi allows normal calls, blocks communication.send
under MNPI and uncovered external calls under PHI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@imran-siddique
imran-siddique merged commit 8c2f268 into main Jul 23, 2026
9 checks passed
@imran-siddique
imran-siddique deleted the fix/quickstart-and-examples branch July 23, 2026 23:07
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