Skip to content

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

Closed
imran-siddique wants to merge 3 commits into
fix/cedar-resource-enforcementfrom
fix/quickstart-and-examples
Closed

docs+examples: working block-first quickstart, mock upstream, enforcing example policies#415
imran-siddique wants to merge 3 commits into
fix/cedar-resource-enforcementfrom
fix/quickstart-and-examples

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

Stacked on #414 (base = fix/cedar-resource-enforcement). Retarget to main once #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 :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, the expected dev-mode startup warnings called out, and 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 dialect the runtime actually uses; rotation_mode stripped; fingerprints fixed to the required format; definition_hash added. Verified via the 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

I could not run docker in this 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 (quickstart, examples) was run against the live runtime.

🤖 Generated with Claude Code

imran-siddique and others added 3 commits July 23, 2026 14:01
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 deleted the branch fix/cedar-resource-enforcement July 23, 2026 23:05
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