docs+examples: working block-first quickstart, mock upstream, enforcing example policies#415
Closed
imran-siddique wants to merge 3 commits into
Closed
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #414 (base =
fix/cedar-resource-enforcement). Retarget tomainonce #414 merges. The example policies here depend on the resource fix in #414 to enforce.Why
Follow-up to the QA pass on the release-party demo. The repo quickstart 502'd on the first call, the example catalogs failed schema validation, and the example policies did not enforce (see #414 for the root cause).
What
scripts/mock_upstream.py: a minimal JSON-RPC MCP upstream on:9001so 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,enforcingmode,rotation_moderemoved from the catalog, avalidate-configcheckpoint, the expected dev-mode startup warnings called out, and explicit second/third-terminal setup. Ran end to end: block = 403, allow = 200, claim recordsallowed: 1, denied: 1,cmcp verify=partially_verified.examples/minimal+examples/bfsi-demo: policies rewritten to the dialect the runtime actually uses;rotation_modestripped; fingerprints fixed to the required format;definition_hashadded. Verified via the loader + evaluator: minimal permitsecho; bfsi allows normal calls, blockscommunication.sendunder MNPI and uncovered external calls under PHI.docker-compose.yml: repointed at theexamples/minimalbundle with the mock on:9001sharing the gateway network namespace.Not verified here
I could not run docker in this environment, so
docker-compose.ymlis correct-by-construction but not smoke-tested. It needs onedocker compose up --buildbefore the party. Everything else (quickstart, examples) was run against the live runtime.🤖 Generated with Claude Code