Repository navigation
fix(security): remediate high-severity Python advisories - #51
Conversation
- Upgrade cryptography, MCP, Soup Sieve, Starlette, and NVIDIA NAT - Enforce patched dependency floors in service and container manifests - Add a cryptography override for NVIDIA NAT compatibility - Adapt synchronous MCP authentication to Python event-loop lifecycle - Refresh the lockfile and third-party license inventory Signed-off-by: Eli Fajardo <efajardo@nvidia.com>
WalkthroughThe PR updates dependency constraints, container and CI validation, and MCP authentication control flow. It adds asynchronous authentication with timeout cleanup, bounded synchronous workers, and expanded failure-path tests. ChangesDependency enforcement
Authentication event-loop handling
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant CouncilMCPServer
participant AuthenticationTask
Caller->>CouncilMCPServer: call_tool_async(name, arguments)
CouncilMCPServer->>AuthenticationTask: authenticate with timeout
AuthenticationTask-->>CouncilMCPServer: success, failure, or timeout
CouncilMCPServer-->>Caller: tool result or authentication error
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 10
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@demo/requirements.txt`:
- Line 13: Update the mcp dependency requirement in demo/requirements.txt from
the unbounded minimum to mcp>=1.28.1,<2, keeping the demo constrained to the MCP
v1 release line.
In `@deploy/Dockerfile`:
- Around line 48-57: Update the Docker image validation around the dependency
installation command to block shipping until the cryptography override is
resolved or explicitly supported against nvidia-nat-core. Add a build or CI gate
that runs pip check, imports NAT and MCP, and exercises the signing and
verification path; ensure the image build fails when any validation fails.
- Around line 45-57: Update the dependency installation stages in the Dockerfile
to copy and use the committed uv.lock, replacing both open-ended uv pip install
resolutions—including the second install around line 71—with frozen lock-derived
installs. Preserve the cryptography>=48.0.1 requirement in the lock-based
dependency setup.
In `@deploy/Dockerfile.executor`:
- Around line 56-60: Make the dependency installation in the executor Docker
build reproducible by adding or using an executor-specific constraints/lock file
derived from the repository’s uv.lock. Update the pip install step to copy and
apply that file, pinning the direct and transitive dependency versions instead
of relying on open-ended requirements, while preserving the existing executor
dependency set.
In `@deploy/requirements-overrides.txt`:
- Around line 1-3: Add the standard NVIDIA proprietary header used by
deploy/Dockerfile.executor to the beginning of
deploy/requirements-overrides.txt, including the SPDX copyright line,
LicenseRef-NvidiaProprietary, the standard proprietary notice, and copyright
year 2026. Keep the existing cryptography override unchanged below the header.
In `@nomos/mcp/server.py`:
- Around line 393-399: Update the authentication branch in call_tool so it never
blocks the active event-loop thread: use an async execution path or offload the
complete synchronous call, and ensure executor cleanup cannot exceed the
10-second authentication timeout. Preserve propagation of authentication
failures, and add coverage for loop progress, timeout behavior, and failed
authentication.
- Around line 396-399: Update call_tool() authentication so every execution path
enforces a 10-second deadline: wrap _authenticate() with asyncio.wait_for,
including the direct async path, and ensure underlying client operations observe
the same bound. Avoid relying on ThreadPoolExecutor context cleanup to enforce
the deadline after Future.result(timeout=10), and add timeout coverage for both
event-loop and no-event-loop paths.
In `@pyproject.toml`:
- Line 35: Update the MCP dependency specification in the nat, grpc, and dev
extras to require version >=1.28.1 and <2, preserving the existing lower bound
while preventing MCP 2.x resolution.
- Line 19: The project’s published nat extra has incompatible cryptography
requirements. Update the nat dependency or packaging boundary so nvidia-nat and
nvidia-nat-core resolve alongside the project’s cryptography constraint in
published metadata, then add a clean pip install ".[nat]" validation check.
In `@tests/test_dynamic_councils.py`:
- Around line 253-255: Update the test covering _management_token_error to
isolate it from COUNCIL_MANAGEMENT_TOKEN and NOMOS_COUNCIL_MANAGEMENT_TOKEN in
the process environment, using the test framework’s environment-mocking
facility. Ensure both variables are absent for this assertion so it
deterministically verifies the “management token is not configured” failure
path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 5c81a8bd-80be-47bb-b5ad-6e935d7f60d3
⛔ Files ignored due to path filters (2)
LICENSE-THIRD-PARTYis excluded by!LICENSE-THIRD-PARTYand included by**uv.lockis excluded by!**/*.lockand included by**
📒 Files selected for processing (9)
agent_signup/requirements.txtdemo/requirements.txtdeploy/Dockerfiledeploy/Dockerfile.executordeploy/requirements-overrides.txtmonitor/requirements.txtnomos/mcp/server.pypyproject.tomltests/test_dynamic_councils.py
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
- GitHub Check: Lint
- GitHub Check: Bandit
- GitHub Check: Secret scan
- GitHub Check: Type check
- GitHub Check: Validate config
🧰 Additional context used
📓 Path-based instructions (9)
**/*
📄 CodeRabbit inference engine (.agents/coding-guidelines.md)
**/*: Before coding, state material assumptions, ask about ambiguous requirements, surface simpler alternatives or risks, and stop when behavior, ownership, or success criteria are unclear.
Implement the smallest solution: avoid speculative features, unnecessary abstractions, and clever control flow; prefer simple, readable code.
Make surgical changes: follow surrounding style, avoid unrelated refactors, and remove only obsolete code caused by the change.
Define verifiable success criteria, add a failing test first for behavior changes, run focused verification during development, and run broader documented validation before handoff when applicable.
Meaningful behavior changes require TDD and unit tests: add or update a focused failing test, implement the smallest passing change, refactor only after tests pass, run focused tests, and run the full suite before handoff.
Add coverage near changed components, cover failure paths, prefer deterministic tests over live-service tests, and reserve live smoke tests for deployment and transport verification.
Follow existing local patterns; use Pydantic models or typed dataclasses for structured data crossing boundaries; keep public contracts stable and small; avoid broad refactors and cross-level imports; and provide explicit operator-helpful configuration errors.
Write comments only for non-obvious policy, security, or protocol reasoning; do not narrate obvious code; update documentation when behavior, deployment, or public interfaces change.
**/*: Authentication is required by default.
OPA intent filtering is enabled by default.
Decision size defaults to unanimous approval; quorum is permitted only when explicitly configured.
Secrets and private keys must never be committed.
Example executors are examples, not production trust boundaries.
Keep the local agent signup service loopback-bound unless protected by real authentication; keep unauthenticated signup low-blast-radius and useNOMOS_SIGNUP_ALLOWED_ROLESto prevent...
Files:
deploy/requirements-overrides.txtmonitor/requirements.txtdeploy/Dockerfile.executoragent_signup/requirements.txtdemo/requirements.txttests/test_dynamic_councils.pypyproject.tomldeploy/Dockerfilenomos/mcp/server.py
⚙️ CodeRabbit configuration file
Every hand-authored source and configuration file must begin with the NVIDIA proprietary header: an SPDX-FileCopyrightText copyright line and SPDX-License-Identifier: LicenseRef-NvidiaProprietary, followed by the standard NVIDIA proprietary notice. Flag any such file that is missing the header, and when a file is modified confirm its copyright year includes the current year. Generated code (e.g. _pb2.py) and vendored/third-party files are exempt.
Files:
deploy/requirements-overrides.txtmonitor/requirements.txtdeploy/Dockerfile.executoragent_signup/requirements.txtdemo/requirements.txttests/test_dynamic_councils.pypyproject.tomldeploy/Dockerfilenomos/mcp/server.py
deploy/**
📄 CodeRabbit inference engine (.agents/deployment.md)
Recreate the OPA container whenever policy files change, because bundled OPA loads policies at startup; deployment must force-recreate OPA for policy changes.
Files:
deploy/requirements-overrides.txtdeploy/Dockerfile.executordeploy/Dockerfile
⚙️ CodeRabbit configuration file
Deployment assets (Dockerfiles, compose, scripts). Check for pinned base images, non-root users, leaked secrets, and safe entrypoint scripting.
Files:
deploy/requirements-overrides.txtdeploy/Dockerfile.executordeploy/Dockerfile
**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
**/*.py: Keep the dependency graph acyclic; when modules need each other, extract a lower-level abstraction rather than creating a cycle.
Use explicit names over clever indirection, keep files cohesive and small enough for their purpose to be obvious, and prefer structured data models over ad hoc dict/string protocols.
Put protocol and schema definitions near the boundary they govern, and treat public constructors, Pydantic models, protocol objects, and contract modules as component interfaces.
Files:
tests/test_dynamic_councils.pynomos/mcp/server.py
**/*.{py,md}
📄 CodeRabbit inference engine (.agents/architecture.md)
Preserve existing patterns unless there is a concrete architectural reason to change them, and update documentation and tests in the same change when architecture shifts.
Files:
tests/test_dynamic_councils.pynomos/mcp/server.py
tests/**/*.py
📄 CodeRabbit inference engine (.agents/deployment.md)
After deployment, run the full test suite using
NOMOS_GRPC_SMOKE_ADDR="${NOMOS_PUBLIC_HOST:-$(hostname -f)}:9904" uv run pytest tests -q.Run the test suite with coverage enforcement using
uv run pytest tests -q --cov --cov-report=term-missing --cov-fail-under=77; add focused unit tests for uncovered behavior and do not lower the 77% coverage floor unless the reduction is intentional and documented.
Files:
tests/test_dynamic_councils.py
tests/**
⚙️ CodeRabbit configuration file
Tests are mandatory for behavior changes and should cover failure paths, not only happy paths. Prefer deterministic tests over live-service tests; live/kind tests are opt-in (see live_mcp and kind_e2e markers). Flag behavior changes to production code that arrive without corresponding test updates.
Files:
tests/test_dynamic_councils.py
nomos/{nat,mcp,grpc}/**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
Ingress and adapter layers may depend inward, but domain layers must not depend on NAT, MCP, or gRPC adapters.
Files:
nomos/mcp/server.py
nomos/**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
Keep stable abstractions in lower levels and volatile orchestration in higher levels; package boundaries should correspond to design boundaries.
Files:
nomos/mcp/server.py
nomos/**
⚙️ CodeRabbit configuration file
Core library, organized into layered levels (level_0..level_4) plus auth, crypto, opa, store, mcp, grpc, and llm subsystems. Do not introduce cross-level imports to save a few lines. Require Pydantic models or typed dataclasses for structured data crossing service or trust boundaries. Keep public contracts small and stable; flag breaking changes to exported APIs. Prefer explicit, operator-actionable error messages over generic exceptions.
Files:
nomos/mcp/server.py
🧬 Code graph analysis (1)
tests/test_dynamic_councils.py (1)
nomos/nat/plugin.py (1)
_management_token_error(269-302)
🔇 Additional comments (5)
pyproject.toml (1)
29-34: LGTM!Also applies to: 36-37, 50-50, 64-64
demo/requirements.txt (1)
14-14: LGTM!monitor/requirements.txt (1)
12-12: LGTM!agent_signup/requirements.txt (1)
12-17: 🩺 Stability & AvailabilityNo dependency constraint issue found. The signup image uses Python 3.13, and the standalone requirements include FastAPI. Existing tests cover unauthenticated access.
> Likely an incorrect or invalid review comment.nomos/mcp/server.py (1)
389-392: LGTM!
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@deploy/Dockerfile`:
- Around line 48-50: Update the frozen dependency installation in the Dockerfile
around the uv sync step to apply deploy/requirements-overrides.txt, ensuring the
council image enforces cryptography>=48.0.1 while preserving the NVIDIA NAT
cryptography constraint below version 47.
In `@deploy/executor-constraints.txt`:
- Around line 11-21: Update deploy/executor-constraints.txt, which supplies
dependencies for Dockerfile.executor, by regenerating it from the patched
resolution so cryptography is constrained to >=48.0.1 instead of 46.0.7 and all
corresponding transitive dependency pins are included.
In `@nomos/mcp/server.py`:
- Around line 304-328: Update the synchronous call_tool authentication flow that
invokes asyncio.run, using _authenticate_with_timeout and its cleanup handling,
so cancellation-resistant cleanup cannot keep execution running beyond
_AUTHENTICATION_TIMEOUT_SECONDS during event-loop shutdown. Enforce a bounded
lifecycle for the timed-out task and add a synchronous test covering an
authenticator that resists cancellation, verifying call_tool returns within the
configured timeout.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 794f70d5-aee3-489d-9539-604382908ef3
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lockand included by**
📒 Files selected for processing (11)
.github/workflows/ci.yml.gitlab-ci.ymldemo/requirements.txtdeploy/Dockerfiledeploy/Dockerfile.executordeploy/executor-constraints.txtdeploy/requirements-overrides.txtnomos/mcp/server.pypyproject.tomltests/test_dynamic_councils.pytests/test_mcp_server.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (9)
**/*
📄 CodeRabbit inference engine (.agents/coding-guidelines.md)
**/*: Before coding, state material assumptions, ask about ambiguous requirements, surface simpler alternatives or risks, and stop when behavior, ownership, or success criteria are unclear.
Implement the smallest solution: avoid speculative features, unnecessary abstractions, and clever control flow; prefer simple, readable code.
Make surgical changes: follow surrounding style, avoid unrelated refactors, and remove only obsolete code caused by the change.
Define verifiable success criteria, add a failing test first for behavior changes, run focused verification during development, and run broader documented validation before handoff when applicable.
Meaningful behavior changes require TDD and unit tests: add or update a focused failing test, implement the smallest passing change, refactor only after tests pass, run focused tests, and run the full suite before handoff.
Add coverage near changed components, cover failure paths, prefer deterministic tests over live-service tests, and reserve live smoke tests for deployment and transport verification.
Follow existing local patterns; use Pydantic models or typed dataclasses for structured data crossing boundaries; keep public contracts stable and small; avoid broad refactors and cross-level imports; and provide explicit operator-helpful configuration errors.
Write comments only for non-obvious policy, security, or protocol reasoning; do not narrate obvious code; update documentation when behavior, deployment, or public interfaces change.
**/*: Authentication is required by default.
OPA intent filtering is enabled by default.
Decision size defaults to unanimous approval; quorum is permitted only when explicitly configured.
Secrets and private keys must never be committed.
Example executors are examples, not production trust boundaries.
Keep the local agent signup service loopback-bound unless protected by real authentication; keep unauthenticated signup low-blast-radius and useNOMOS_SIGNUP_ALLOWED_ROLESto prevent...
Files:
deploy/executor-constraints.txtdemo/requirements.txtpyproject.tomltests/test_dynamic_councils.pydeploy/requirements-overrides.txtdeploy/Dockerfile.executortests/test_mcp_server.pynomos/mcp/server.pydeploy/Dockerfile
⚙️ CodeRabbit configuration file
Every hand-authored source and configuration file must begin with the NVIDIA proprietary header: an SPDX-FileCopyrightText copyright line and SPDX-License-Identifier: LicenseRef-NvidiaProprietary, followed by the standard NVIDIA proprietary notice. Flag any such file that is missing the header, and when a file is modified confirm its copyright year includes the current year. Generated code (e.g. _pb2.py) and vendored/third-party files are exempt.
Files:
deploy/executor-constraints.txtdemo/requirements.txtpyproject.tomltests/test_dynamic_councils.pydeploy/requirements-overrides.txtdeploy/Dockerfile.executortests/test_mcp_server.pynomos/mcp/server.pydeploy/Dockerfile
deploy/**
📄 CodeRabbit inference engine (.agents/deployment.md)
Recreate the OPA container whenever policy files change, because bundled OPA loads policies at startup; deployment must force-recreate OPA for policy changes.
Files:
deploy/executor-constraints.txtdeploy/requirements-overrides.txtdeploy/Dockerfile.executordeploy/Dockerfile
⚙️ CodeRabbit configuration file
Deployment assets (Dockerfiles, compose, scripts). Check for pinned base images, non-root users, leaked secrets, and safe entrypoint scripting.
Files:
deploy/executor-constraints.txtdeploy/requirements-overrides.txtdeploy/Dockerfile.executordeploy/Dockerfile
**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
**/*.py: Keep the dependency graph acyclic; when modules need each other, extract a lower-level abstraction rather than creating a cycle.
Use explicit names over clever indirection, keep files cohesive and small enough for their purpose to be obvious, and prefer structured data models over ad hoc dict/string protocols.
Put protocol and schema definitions near the boundary they govern, and treat public constructors, Pydantic models, protocol objects, and contract modules as component interfaces.
Files:
tests/test_dynamic_councils.pytests/test_mcp_server.pynomos/mcp/server.py
**/*.{py,md}
📄 CodeRabbit inference engine (.agents/architecture.md)
Preserve existing patterns unless there is a concrete architectural reason to change them, and update documentation and tests in the same change when architecture shifts.
Files:
tests/test_dynamic_councils.pytests/test_mcp_server.pynomos/mcp/server.py
tests/**/*.py
📄 CodeRabbit inference engine (.agents/deployment.md)
After deployment, run the full test suite using
NOMOS_GRPC_SMOKE_ADDR="${NOMOS_PUBLIC_HOST:-$(hostname -f)}:9904" uv run pytest tests -q.Run the test suite with coverage enforcement using
uv run pytest tests -q --cov --cov-report=term-missing --cov-fail-under=77; add focused unit tests for uncovered behavior and do not lower the 77% coverage floor unless the reduction is intentional and documented.
Files:
tests/test_dynamic_councils.pytests/test_mcp_server.py
tests/**
⚙️ CodeRabbit configuration file
Tests are mandatory for behavior changes and should cover failure paths, not only happy paths. Prefer deterministic tests over live-service tests; live/kind tests are opt-in (see live_mcp and kind_e2e markers). Flag behavior changes to production code that arrive without corresponding test updates.
Files:
tests/test_dynamic_councils.pytests/test_mcp_server.py
nomos/{nat,mcp,grpc}/**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
Ingress and adapter layers may depend inward, but domain layers must not depend on NAT, MCP, or gRPC adapters.
Files:
nomos/mcp/server.py
nomos/**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
Keep stable abstractions in lower levels and volatile orchestration in higher levels; package boundaries should correspond to design boundaries.
Files:
nomos/mcp/server.py
nomos/**
⚙️ CodeRabbit configuration file
Core library, organized into layered levels (level_0..level_4) plus auth, crypto, opa, store, mcp, grpc, and llm subsystems. Do not introduce cross-level imports to save a few lines. Require Pydantic models or typed dataclasses for structured data crossing service or trust boundaries. Keep public contracts small and stable; flag breaking changes to exported APIs. Prefer explicit, operator-actionable error messages over generic exceptions.
Files:
nomos/mcp/server.py
🪛 actionlint (1.7.12)
.github/workflows/ci.yml
[error] 350-350: constant expression "false" in condition. remove the if: section
(if-cond)
[error] 401-401: constant expression "false" in condition. remove the if: section
(if-cond)
🪛 Checkov (3.3.9)
deploy/Dockerfile
[low] 72-72: Ensure the base image uses a non latest version tag
(CKV_DOCKER_7)
🪛 LanguageTool
deploy/executor-constraints.txt
[grammar] ~2-~2: Ensure spelling is correct
Context: ...ts reserved. # SPDX-License-Identifier: LicenseRef-NvidiaProprietary # # NVIDIA CORPORATION, its affiliates and l...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
deploy/requirements-overrides.txt
[grammar] ~2-~2: Ensure spelling is correct
Context: ...ts reserved. # SPDX-License-Identifier: LicenseRef-NvidiaProprietary # # NVIDIA CORPORATION, its affiliates and l...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🪛 YAMLlint (1.37.1)
.github/workflows/ci.yml
[warning] 13-13: truthy value should be one of [false, true]
(truthy)
🪛 zizmor (1.29.0)
.github/workflows/ci.yml
[error] 54-54: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
[error] 107-107: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
[error] 148-148: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
[error] 191-191: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
[error] 242-242: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
[error] 283-283: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
[warning] 350-350: obfuscated usage of GitHub Actions features (obfuscation): can be replaced by its static evaluation
(obfuscation)
[warning] 401-401: obfuscated usage of GitHub Actions features (obfuscation): can be replaced by its static evaluation
(obfuscation)
🔇 Additional comments (14)
nomos/mcp/server.py (2)
43-44: LGTM!Also applies to: 383-415
451-457: 🩺 Stability & AvailabilityProvide an asynchronous raw-request handler for async transports.
handle_mcp_requestcallscall_tool, which raises on an active event loop. No in-repository caller currently useshandle_mcp_request; confirm external transports and add an active-loop failure-path test.tests/test_mcp_server.py (1)
12-17: LGTM!Also applies to: 38-48, 58-58, 142-198, 220-230
tests/test_dynamic_councils.py (1)
253-257: LGTM!pyproject.toml (1)
19-21: LGTM!Also applies to: 30-37, 51-51, 65-65
demo/requirements.txt (1)
13-13: LGTM!deploy/requirements-overrides.txt (1)
1-10: LGTM!deploy/Dockerfile (1)
30-31: LGTM!Also applies to: 65-85
deploy/Dockerfile.executor (1)
56-61: LGTM!deploy/executor-constraints.txt (1)
1-10: LGTM!.github/workflows/ci.yml (3)
67-70: 🗄️ Data Integrity & IntegrationVerify that CI rejects a stale
uv.lock.No
uv lock --checkoruv sync --lockedcontrol appears before these frozen installs.uv sync --frozenuses the lockfile without checking that currentpyproject.tomlchanges are included. Confirm this behavior with the pinned uv 0.12.1 release. Add a lock-freshness gate if no other required workflow provides one. Current uv documentation distinguishes--frozenfrom--lockedanduv lock --checkfor this purpose. (docs.astral.sh)Also applies to: 120-123, 161-164, 204-207, 255-258, 296-299
348-421: 🩺 Stability & AvailabilityConfirm that the permanently disabled build jobs are intentional.
if: ${{ false }}at Line 350 and Line 401 makespackageanddocker_build_imagesunreachable for every trigger. CI does not runuv buildor the Dockerfilepip checkand Ed25519 validation. Enable these jobs for required release triggers, or remove them and document an equivalent required gate.Source: Linters/SAST tools
1-66: LGTM!Also applies to: 81-119, 124-160, 168-203, 213-254, 264-295, 303-347
.gitlab-ci.yml (1)
57-60: LGTM!
Review of #51 — remediate high-severity Python advisories We began at 1.
|
| Was | Now |
|---|---|
Image built from loose >= floors, not uv.lock, so scan results described one build at one moment |
uv sync --frozen --no-dev — the image builds from the lock |
nvidia-nat-langchain installed outside the lock; replay resolved 168 distributions, 75 absent from the lock, and 19 packages deleted from LICENSE-THIRD-PARTY reappeared at runtime |
no longer installed outside the lock; the inventory and the image agree again |
Unbounded mcp>=1.28.1 resolved to mcp 2.0.0 when compiled |
mcp>=1.28.1,<2 |
The event-loop change had no regression test, and .result(timeout=10) did not bound the call — leaving with ThreadPoolExecutor() calls shutdown(wait=True), so a 2s timeout against a 6s authenticator still blocked the full 6s |
_authenticate_with_timeout cancels the task and drains it via add_done_callback; four new tests in tests/test_mcp_server.py cover the loop-running, no-loop, timeout, and failure paths |
The added build-time validation (pip check plus an Ed25519 sign/verify smoke test) is a good addition — it turns "the image built" into a checked claim. Note that call_tool becoming call_tool_async is an API change worth calling out in the description for anyone embedding the server.
Verdict
Changes requested, on §1 only. The dependency work at 6490de3 is materially better than at 413a595e and the build is now reproducible from the lock, which was our main structural concern. What blocks it is that the cryptography reversal left the description behind: one of the eight advertised advisories is not fixed at this head, and the validation section still reports results from before the reversal. Update the description (or restore the upgrade), delete or rewire the dead overrides file, and ideally take click>=8.3.3 while you are regenerating the lock.
Automated review by an opposed reviewer pair with independent director verification. Re-verified against 6490de3 after the branch advanced mid-review; resolution and behavioral claims were produced by execution, and the advisory-database lookups in §3 were denied by policy and are raised as questions.
drobison00
left a comment
There was a problem hiding this comment.
Codex 5.6-Sol via @drobison00
Requesting changes on one item. At head 6490de3, GHSA-537c-gmf6-5ccf is no longer remediated: cryptography is pinned >=46.0.6,<47, [tool.uv] override-dependencies was removed, and the lock is back to 46.0.7 — the merge-base version. The description still lists it fixed via 46.0.7 -> 50.0.0, still reports Trivy and Grype at 0 Critical/High, and still asserts "Rebuilt-image package check: cryptography 50.0.0".
Backing off is defensible — NAT 1.8 caps cryptography<47 — but nothing else followed. Two loose ends from the same reversal: deploy/requirements-overrides.txt still declares cryptography>=48.0.1 that no build reads any more (the --overrides flag was dropped from both Dockerfiles), and the executor lost its explicit floor to a constraint pinning ==46.0.7.
To clear this: update the description (or restore the upgrade), and delete or rewire the dead overrides file.
Worth saying plainly that 6490de3 is a real improvement over 413a595e — it moved the image onto uv sync --frozen, brought nvidia-nat-langchain back under the lock, bounded mcp<2, and added the auth regression tests plus a proper cancelling timeout. Those were four of our findings, now closed.
Full analysis, including the click / PYSEC-2026-2132 note and the changelog correction:
#51 (comment)
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
nomos/mcp/server.py (1)
305-318: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winCancel authentication when the caller cancels.
When
call_tool_async()is cancelled,asyncio.wait()raisesCancelledErrorwithout cancellingtask. The authentication task can continue after the request exits. Cancel the task, consume its eventual result, and re-raiseCancelledError. Add a test for cancellation while authentication is pending.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nomos/mcp/server.py` around lines 305 - 318, Update _authenticate_with_timeout to catch caller-driven asyncio.CancelledError while awaiting asyncio.wait, cancel the pending authentication task, attach _consume_authentication_result to consume its eventual completion, and re-raise the cancellation. Preserve the existing timeout handling and add a test covering cancellation while authentication remains pending.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@deploy/executor-constraints.txt`:
- Around line 13-22: Update the pinned requirements artifact used by
Dockerfile.executor to enforce package integrity: provide hashes for every
installed distribution and configure installation with hash verification (such
as --require-hashes), or replace it with a digest-verified wheelhouse. Ensure
all packages installed by the executor build are covered.
In `@nomos/mcp/server.py`:
- Around line 460-479: Add a bounded concurrency/admission mechanism around the
authenticated synchronous call’s worker creation, rejecting requests immediately
and fail-closed when the limit is reached. In the visible invoke/thread flow,
acquire capacity before starting the daemon worker and release it only from a
wrapper that runs after asyncio.run() fully exits, not from invoke() or
completed.set(); add a stress test using cleanup that never finishes to verify
repeated calls do not create unbounded threads.
---
Outside diff comments:
In `@nomos/mcp/server.py`:
- Around line 305-318: Update _authenticate_with_timeout to catch caller-driven
asyncio.CancelledError while awaiting asyncio.wait, cancel the pending
authentication task, attach _consume_authentication_result to consume its
eventual completion, and re-raise the cancellation. Preserve the existing
timeout handling and add a test covering cancellation while authentication
remains pending.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 86b3e192-763e-4199-aa61-360442d5ee83
📒 Files selected for processing (3)
deploy/executor-constraints.txtnomos/mcp/server.pytests/test_mcp_server.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (9)
**/*
📄 CodeRabbit inference engine (.agents/coding-guidelines.md)
**/*: Before coding, state material assumptions, ask about ambiguous requirements, surface simpler alternatives or risks, and stop when behavior, ownership, or success criteria are unclear.
Implement the smallest solution: avoid speculative features, unnecessary abstractions, and clever control flow; prefer simple, readable code.
Make surgical changes: follow surrounding style, avoid unrelated refactors, and remove only obsolete code caused by the change.
Define verifiable success criteria, add a failing test first for behavior changes, run focused verification during development, and run broader documented validation before handoff when applicable.
Meaningful behavior changes require TDD and unit tests: add or update a focused failing test, implement the smallest passing change, refactor only after tests pass, run focused tests, and run the full suite before handoff.
Add coverage near changed components, cover failure paths, prefer deterministic tests over live-service tests, and reserve live smoke tests for deployment and transport verification.
Follow existing local patterns; use Pydantic models or typed dataclasses for structured data crossing boundaries; keep public contracts stable and small; avoid broad refactors and cross-level imports; and provide explicit operator-helpful configuration errors.
Write comments only for non-obvious policy, security, or protocol reasoning; do not narrate obvious code; update documentation when behavior, deployment, or public interfaces change.
**/*: Authentication is required by default.
OPA intent filtering is enabled by default.
Decision size defaults to unanimous approval; quorum is permitted only when explicitly configured.
Secrets and private keys must never be committed.
Example executors are examples, not production trust boundaries.
Keep the local agent signup service loopback-bound unless protected by real authentication; keep unauthenticated signup low-blast-radius and useNOMOS_SIGNUP_ALLOWED_ROLESto prevent...
Files:
deploy/executor-constraints.txtnomos/mcp/server.pytests/test_mcp_server.py
⚙️ CodeRabbit configuration file
Every hand-authored source and configuration file must begin with the NVIDIA proprietary header: an SPDX-FileCopyrightText copyright line and SPDX-License-Identifier: LicenseRef-NvidiaProprietary, followed by the standard NVIDIA proprietary notice. Flag any such file that is missing the header, and when a file is modified confirm its copyright year includes the current year. Generated code (e.g. _pb2.py) and vendored/third-party files are exempt.
Files:
deploy/executor-constraints.txtnomos/mcp/server.pytests/test_mcp_server.py
deploy/**
📄 CodeRabbit inference engine (.agents/deployment.md)
Recreate the OPA container whenever policy files change, because bundled OPA loads policies at startup; deployment must force-recreate OPA for policy changes.
Files:
deploy/executor-constraints.txt
⚙️ CodeRabbit configuration file
Deployment assets (Dockerfiles, compose, scripts). Check for pinned base images, non-root users, leaked secrets, and safe entrypoint scripting.
Files:
deploy/executor-constraints.txt
nomos/{nat,mcp,grpc}/**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
Ingress and adapter layers may depend inward, but domain layers must not depend on NAT, MCP, or gRPC adapters.
Files:
nomos/mcp/server.py
**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
**/*.py: Keep the dependency graph acyclic; when modules need each other, extract a lower-level abstraction rather than creating a cycle.
Use explicit names over clever indirection, keep files cohesive and small enough for their purpose to be obvious, and prefer structured data models over ad hoc dict/string protocols.
Put protocol and schema definitions near the boundary they govern, and treat public constructors, Pydantic models, protocol objects, and contract modules as component interfaces.
Files:
nomos/mcp/server.pytests/test_mcp_server.py
nomos/**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
Keep stable abstractions in lower levels and volatile orchestration in higher levels; package boundaries should correspond to design boundaries.
Files:
nomos/mcp/server.py
**/*.{py,md}
📄 CodeRabbit inference engine (.agents/architecture.md)
Preserve existing patterns unless there is a concrete architectural reason to change them, and update documentation and tests in the same change when architecture shifts.
Files:
nomos/mcp/server.pytests/test_mcp_server.py
nomos/**
⚙️ CodeRabbit configuration file
Core library, organized into layered levels (level_0..level_4) plus auth, crypto, opa, store, mcp, grpc, and llm subsystems. Do not introduce cross-level imports to save a few lines. Require Pydantic models or typed dataclasses for structured data crossing service or trust boundaries. Keep public contracts small and stable; flag breaking changes to exported APIs. Prefer explicit, operator-actionable error messages over generic exceptions.
Files:
nomos/mcp/server.py
tests/**/*.py
📄 CodeRabbit inference engine (.agents/deployment.md)
After deployment, run the full test suite using
NOMOS_GRPC_SMOKE_ADDR="${NOMOS_PUBLIC_HOST:-$(hostname -f)}:9904" uv run pytest tests -q.Run the test suite with coverage enforcement using
uv run pytest tests -q --cov --cov-report=term-missing --cov-fail-under=77; add focused unit tests for uncovered behavior and do not lower the 77% coverage floor unless the reduction is intentional and documented.
Files:
tests/test_mcp_server.py
tests/**
⚙️ CodeRabbit configuration file
Tests are mandatory for behavior changes and should cover failure paths, not only happy paths. Prefer deterministic tests over live-service tests; live/kind tests are opt-in (see live_mcp and kind_e2e markers). Flag behavior changes to production code that arrive without corresponding test updates.
Files:
tests/test_mcp_server.py
🔇 Additional comments (5)
deploy/executor-constraints.txt (1)
1-12: LGTM!nomos/mcp/server.py (3)
23-23: 📐 Maintainability & Code QualityVerify the NVIDIA header and copyright year.
The supplied range does not include the file header. Confirm that this modified hand-authored file begins with the required NVIDIA proprietary header and that its copyright includes 2026.
As per path instructions, modified hand-authored source files must carry the NVIDIA proprietary header and include the current year.
Source: Path instructions
384-437: 🔒 Security & PrivacyReachability path
● Entry tests/test_mcp_server.py │ ▼ ● Sink nomos/mcp/server.pyRequire authentication by default.
call_tool_async()authenticates only names in_AUTHENTICATED_TOOLS. Define an explicit anonymous-read allowlist and authenticate every other tool. Add tests for an unlisted tool and confirm that anonymous read responses are approved for each deployed MCP transport.
452-483: 🎯 Functional CorrectnessNo async MCP dispatch change is required.
handle_mcp_request()has no callers in the repository. Async paths use the transport client'scall_tool()orCouncilMCPServer.call_tool_async(), whose contracts are documented in the source.> Likely an incorrect or invalid review comment.tests/test_mcp_server.py (1)
13-13: 📐 Maintainability & Code QualityVerify the NVIDIA header and copyright year.
The supplied range does not include the file header. Confirm that this modified hand-authored file begins with the required NVIDIA proprietary header and that its copyright includes 2026.
As per path instructions, modified hand-authored source files must carry the NVIDIA proprietary header and include the current year.
Source: Path instructions
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
deploy/Dockerfile.executor (2)
51-53: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winSecurity Misconfiguration (CWE-494): Download of Code Without Integrity Check
Reachability: External
Pin and verify the
kubectlartifact.This build follows
stable.txtand installs the downloaded executable without checksum or signature validation. Pin an exact version and verify its matching SHA-256 or signature before installation.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@deploy/Dockerfile.executor` around lines 51 - 53, Update the kubectl installation RUN command to use a fixed, explicitly declared kubectl version instead of resolving stable.txt, then download the corresponding checksum or signature and verify the artifact before chmod and installation. Ensure verification failure stops the build.
66-70: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy liftExecutor Signing-key Exposure (CWE-668)
Reachability: External · Exploitability: Moderate
Isolate submitted commands from the executor signing key.
Because submitted commands run as the executor user, an accepted writ can run
cat /app/executor-keys/executor.key;catis allowed and this path is not denied. Directory mode0700alone will not prevent access by the same user. Run commands in a separate user/container without the key volume, or use provider-backed signing. Retain0700for the directory and0600for private-key files as defense against other users.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@deploy/Dockerfile.executor` around lines 66 - 70, Update the executor image and runtime setup around the executor user and /app/executor-keys so submitted commands cannot access the signing key: run commands under a separate user or container that has no key volume, or switch signing to a provider-backed mechanism. Preserve restrictive 0700 directory and 0600 private-key permissions for defense against other users.nomos/mcp/server.py (2)
464-496: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winRelease capacity when worker startup fails. Wrap
threading.Threadconstruction andthread.start()intry/except BaseException, releasecapacity, and re-raise. Add a test that forcesThread.start()to raise and verifies a later call can acquire capacity.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nomos/mcp/server.py` around lines 464 - 496, The synchronous authentication path must release capacity when worker creation or startup fails. Wrap the threading.Thread construction and thread.start() operations in run_worker’s surrounding flow with except BaseException, call capacity.release(), then re-raise; add a test that makes Thread.start() raise and confirms a subsequent authentication call can acquire capacity.
456-501: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winAdd async raw-request dispatch.
If an async transport calls
handle_mcp_request(), itscall_tool()call raisesRuntimeErrorbefore returning JSON-RPC. Add an async dispatch method usingcall_tool_async(), document the dispatch contract, and testtools/callinside an active event loop.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nomos/mcp/server.py` around lines 456 - 501, Add an async raw-request dispatch method alongside call_tool that routes MCP tools/calls through call_tool_async and returns the expected JSON-RPC response without invoking the synchronous event-loop guard. Document that async transports must use this method for handle_mcp_request dispatch, while preserving call_tool for synchronous callers, and add coverage for tools/call executed inside an active event loop.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_mcp_server.py`:
- Around line 267-273: Update the authentication cleanup test using the locally
retained BoundedSemaphore created for _SYNCHRONOUS_AUTHENTICATION_CAPACITY:
after joining the worker threads, acquire all worker_limit slots and release
them, asserting full capacity recovery in addition to the existing thread-stop
checks.
---
Outside diff comments:
In `@deploy/Dockerfile.executor`:
- Around line 51-53: Update the kubectl installation RUN command to use a fixed,
explicitly declared kubectl version instead of resolving stable.txt, then
download the corresponding checksum or signature and verify the artifact before
chmod and installation. Ensure verification failure stops the build.
- Around line 66-70: Update the executor image and runtime setup around the
executor user and /app/executor-keys so submitted commands cannot access the
signing key: run commands under a separate user or container that has no key
volume, or switch signing to a provider-backed mechanism. Preserve restrictive
0700 directory and 0600 private-key permissions for defense against other users.
In `@nomos/mcp/server.py`:
- Around line 464-496: The synchronous authentication path must release capacity
when worker creation or startup fails. Wrap the threading.Thread construction
and thread.start() operations in run_worker’s surrounding flow with except
BaseException, call capacity.release(), then re-raise; add a test that makes
Thread.start() raise and confirms a subsequent authentication call can acquire
capacity.
- Around line 456-501: Add an async raw-request dispatch method alongside
call_tool that routes MCP tools/calls through call_tool_async and returns the
expected JSON-RPC response without invoking the synchronous event-loop guard.
Document that async transports must use this method for handle_mcp_request
dispatch, while preserving call_tool for synchronous callers, and add coverage
for tools/call executed inside an active event loop.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 2dabe45f-17dc-4a79-a8c5-5e69a5c32cfe
📒 Files selected for processing (4)
deploy/Dockerfile.executordeploy/executor-constraints.txtnomos/mcp/server.pytests/test_mcp_server.py
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
- GitHub Check: Validate config
- GitHub Check: Type check
- GitHub Check: Secret scan
🧰 Additional context used
📓 Path-based instructions (9)
**/*
📄 CodeRabbit inference engine (.agents/coding-guidelines.md)
**/*: Before coding, state material assumptions, ask about ambiguous requirements, surface simpler alternatives or risks, and stop when behavior, ownership, or success criteria are unclear.
Implement the smallest solution: avoid speculative features, unnecessary abstractions, and clever control flow; prefer simple, readable code.
Make surgical changes: follow surrounding style, avoid unrelated refactors, and remove only obsolete code caused by the change.
Define verifiable success criteria, add a failing test first for behavior changes, run focused verification during development, and run broader documented validation before handoff when applicable.
Meaningful behavior changes require TDD and unit tests: add or update a focused failing test, implement the smallest passing change, refactor only after tests pass, run focused tests, and run the full suite before handoff.
Add coverage near changed components, cover failure paths, prefer deterministic tests over live-service tests, and reserve live smoke tests for deployment and transport verification.
Follow existing local patterns; use Pydantic models or typed dataclasses for structured data crossing boundaries; keep public contracts stable and small; avoid broad refactors and cross-level imports; and provide explicit operator-helpful configuration errors.
Write comments only for non-obvious policy, security, or protocol reasoning; do not narrate obvious code; update documentation when behavior, deployment, or public interfaces change.
**/*: Authentication is required by default.
OPA intent filtering is enabled by default.
Decision size defaults to unanimous approval; quorum is permitted only when explicitly configured.
Secrets and private keys must never be committed.
Example executors are examples, not production trust boundaries.
Keep the local agent signup service loopback-bound unless protected by real authentication; keep unauthenticated signup low-blast-radius and useNOMOS_SIGNUP_ALLOWED_ROLESto prevent...
Files:
deploy/executor-constraints.txtdeploy/Dockerfile.executortests/test_mcp_server.pynomos/mcp/server.py
⚙️ CodeRabbit configuration file
Every hand-authored source and configuration file must begin with the NVIDIA proprietary header: an SPDX-FileCopyrightText copyright line and SPDX-License-Identifier: LicenseRef-NvidiaProprietary, followed by the standard NVIDIA proprietary notice. Flag any such file that is missing the header, and when a file is modified confirm its copyright year includes the current year. Generated code (e.g. _pb2.py) and vendored/third-party files are exempt.
Files:
deploy/executor-constraints.txtdeploy/Dockerfile.executortests/test_mcp_server.pynomos/mcp/server.py
deploy/**
📄 CodeRabbit inference engine (.agents/deployment.md)
Recreate the OPA container whenever policy files change, because bundled OPA loads policies at startup; deployment must force-recreate OPA for policy changes.
Files:
deploy/executor-constraints.txtdeploy/Dockerfile.executor
⚙️ CodeRabbit configuration file
Deployment assets (Dockerfiles, compose, scripts). Check for pinned base images, non-root users, leaked secrets, and safe entrypoint scripting.
Files:
deploy/executor-constraints.txtdeploy/Dockerfile.executor
**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
**/*.py: Keep the dependency graph acyclic; when modules need each other, extract a lower-level abstraction rather than creating a cycle.
Use explicit names over clever indirection, keep files cohesive and small enough for their purpose to be obvious, and prefer structured data models over ad hoc dict/string protocols.
Put protocol and schema definitions near the boundary they govern, and treat public constructors, Pydantic models, protocol objects, and contract modules as component interfaces.
Files:
tests/test_mcp_server.pynomos/mcp/server.py
**/*.{py,md}
📄 CodeRabbit inference engine (.agents/architecture.md)
Preserve existing patterns unless there is a concrete architectural reason to change them, and update documentation and tests in the same change when architecture shifts.
Files:
tests/test_mcp_server.pynomos/mcp/server.py
tests/**/*.py
📄 CodeRabbit inference engine (.agents/deployment.md)
After deployment, run the full test suite using
NOMOS_GRPC_SMOKE_ADDR="${NOMOS_PUBLIC_HOST:-$(hostname -f)}:9904" uv run pytest tests -q.Run the test suite with coverage enforcement using
uv run pytest tests -q --cov --cov-report=term-missing --cov-fail-under=77; add focused unit tests for uncovered behavior and do not lower the 77% coverage floor unless the reduction is intentional and documented.
Files:
tests/test_mcp_server.py
tests/**
⚙️ CodeRabbit configuration file
Tests are mandatory for behavior changes and should cover failure paths, not only happy paths. Prefer deterministic tests over live-service tests; live/kind tests are opt-in (see live_mcp and kind_e2e markers). Flag behavior changes to production code that arrive without corresponding test updates.
Files:
tests/test_mcp_server.py
nomos/{nat,mcp,grpc}/**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
Ingress and adapter layers may depend inward, but domain layers must not depend on NAT, MCP, or gRPC adapters.
Files:
nomos/mcp/server.py
nomos/**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
Keep stable abstractions in lower levels and volatile orchestration in higher levels; package boundaries should correspond to design boundaries.
Files:
nomos/mcp/server.py
nomos/**
⚙️ CodeRabbit configuration file
Core library, organized into layered levels (level_0..level_4) plus auth, crypto, opa, store, mcp, grpc, and llm subsystems. Do not introduce cross-level imports to save a few lines. Require Pydantic models or typed dataclasses for structured data crossing service or trust boundaries. Keep public contracts small and stable; flag breaking changes to exported APIs. Prefer explicit, operator-actionable error messages over generic exceptions.
Files:
nomos/mcp/server.py
🔇 Additional comments (7)
deploy/executor-constraints.txt (2)
11-13: 🗄️ Data Integrity & IntegrationVerify that the old executor override is no longer used.
deploy/executor-constraints.txtnow defines the executor dependency set. The PR context also identifiesdeploy/requirements-overrides.txtas contradictory. Search Dockerfiles, CI jobs, and deployment scripts. Remove or rewire any path that still consumes the old file.
1-10: LGTM!Also applies to: 14-37
deploy/Dockerfile.executor (2)
56-58: LGTM!
30-30: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winSecurity Misconfiguration (CWE-494): Download of Code Without Integrity Check
Reachability: External
Pin the Python base image by digest.
FROM python:3.13-slimuses a mutable tag. A later build can run theapt-get,curl, andpipsteps on a different or compromised base layer. The hash enforcement at Lines 57-58 does not protect this input. Use a reviewedpython:3.13-slim@sha256:<digest>reference.As per path instructions: “Deployment assets (Dockerfiles, compose, scripts). Check for pinned base images, non-root users, leaked secrets, and safe entrypoint scripting.”
nomos/mcp/server.py (2)
45-48: LGTM!
317-322: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winDenial of Service (CWE-400): Uncontrolled Resource Consumption
Reachability path
● Entry tests/test_mcp_server.py │ ▼ ● Sink nomos/mcp/server.pyCancel the child authentication task when its caller is cancelled.
If an async MCP transport propagates a client disconnect,
call_tool_async()can be cancelled while Line 317 waits.asyncio.wait()then exits withCancelledErrorwithout cancellingtask, so Lines 319-320 never run. The detached authentication continues against the store for up to the timeout, or longer during cancellation-resistant cleanup. Repeated cancelled requests can accumulate pending work and violate availability.Catch
asyncio.CancelledError, canceltask, attach_consume_authentication_result, and re-raise. Add a cancellation regression test.Proposed fix
- done, _ = await asyncio.wait({task}, timeout=_AUTHENTICATION_TIMEOUT_SECONDS) + try: + done, _ = await asyncio.wait( + {task}, + timeout=_AUTHENTICATION_TIMEOUT_SECONDS, + ) + except asyncio.CancelledError: + task.cancel() + task.add_done_callback(self._consume_authentication_result) + raisetests/test_mcp_server.py (1)
253-266: LGTM!Also applies to: 274-310
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
tests/test_mcp_server.py (3)
282-315: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winJoin workers on every failure path.
workersremains empty until the firstworker_limitcalls complete. If an assertion in Lines [283]-[286] fails, thefinallyblock setsrelease_cleanupbut joins no authentication worker. The cancellation-resistant authenticator can leave background threads running into later tests.Capture newly created
"mcp-authentication"threads infinally, setrelease_cleanup, and join the captured threads before the test exits.Proposed cleanup adjustment
finally: + workers_to_join = list(workers) + workers_to_join.extend( + thread + for thread in threading.enumerate() + if thread not in existing_threads + and thread.name == "mcp-authentication" + and thread not in workers_to_join + ) release_cleanup.set() - for worker in workers: + for worker in workers_to_join: worker.join(timeout=0.5) + workers = workers_to_joinAs per path instructions, “Tests are mandatory for behavior changes and should cover failure paths, not only happy paths.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_mcp_server.py` around lines 282 - 315, Update the cleanup in this authentication worker capacity test so the finally block always discovers and captures newly created "mcp-authentication" threads, including when assertions fail before workers is populated. Set release_cleanup, then join the captured threads before exiting; preserve the existing timeout and thread filtering behavior.Source: Path instructions
201-220: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winRemove the strict 200 ms wall-clock gate.
Line [295] starts a timer for 20 rejected calls. Line [299] requires completion in less than 200 ms. CI scheduling and thread startup can exceed this limit even when the non-blocking semaphore path is correct. The
"capacity exhausted"results and worker-count assertion already verify admission behavior.Remove the fixed threshold, or use a generous timeout only to detect a hang. Apply the same rule to short elapsed-time assertions in the synchronous timeout tests.
Proposed test adjustment
- started = time.monotonic() rejected = [server.call_tool("propose_intent", _proposal_arguments()) for _ in range(20)] - elapsed = time.monotonic() - started - assert elapsed < 0.2 assert all(result["success"] is False for result in rejected)As per coding guidelines, “Prefer deterministic tests over live-service tests.”
Also applies to: 221-252, 295-301
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_mcp_server.py` around lines 201 - 220, Remove strict short wall-clock assertions from test_authentication_timeout_without_running_event_loop and the related synchronous timeout tests, including the 20-rejected-call test. Retain assertions for failed authentication, “capacity exhausted” results, and worker counts; if hang detection is needed, replace elapsed < 200 ms checks with a generous timeout that tolerates CI scheduling and thread startup.Source: Coding guidelines
143-334: 🩺 Stability & Availability | 🔵 TrivialRun the required test suites in an environment with
uvinstalled.The focused tests, coverage-gated suite, and post-deployment suite remain unrun. Confirm worker cleanup, timeout behavior, and the 77% coverage floor.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_mcp_server.py` around lines 143 - 334, Run the focused authentication tests in tests/test_mcp_server.py, the coverage-gated test suite, and the post-deployment suite in an environment with uv installed. Confirm that timeout behavior, event-loop progress, cleanup of authentication workers, admission bounds, and the required 77% coverage threshold all pass.Sources: Coding guidelines, Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@tests/test_mcp_server.py`:
- Around line 282-315: Update the cleanup in this authentication worker capacity
test so the finally block always discovers and captures newly created
"mcp-authentication" threads, including when assertions fail before workers is
populated. Set release_cleanup, then join the captured threads before exiting;
preserve the existing timeout and thread filtering behavior.
- Around line 201-220: Remove strict short wall-clock assertions from
test_authentication_timeout_without_running_event_loop and the related
synchronous timeout tests, including the 20-rejected-call test. Retain
assertions for failed authentication, “capacity exhausted” results, and worker
counts; if hang detection is needed, replace elapsed < 200 ms checks with a
generous timeout that tolerates CI scheduling and thread startup.
- Around line 143-334: Run the focused authentication tests in
tests/test_mcp_server.py, the coverage-gated test suite, and the post-deployment
suite in an environment with uv installed. Confirm that timeout behavior,
event-loop progress, cleanup of authentication workers, admission bounds, and
the required 77% coverage threshold all pass.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 8ee6ad54-244f-4d25-a27e-b162b222ce94
📒 Files selected for processing (1)
tests/test_mcp_server.py
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: Type check
- GitHub Check: Secret scan
- GitHub Check: Validate config
- GitHub Check: Lint
🧰 Additional context used
📓 Path-based instructions (5)
**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
**/*.py: Keep the dependency graph acyclic; when modules need each other, extract a lower-level abstraction rather than creating a cycle.
Use explicit names over clever indirection, keep files cohesive and small enough for their purpose to be obvious, and prefer structured data models over ad hoc dict/string protocols.
Put protocol and schema definitions near the boundary they govern, and treat public constructors, Pydantic models, protocol objects, and contract modules as component interfaces.
Files:
tests/test_mcp_server.py
**/*.{py,md}
📄 CodeRabbit inference engine (.agents/architecture.md)
Preserve existing patterns unless there is a concrete architectural reason to change them, and update documentation and tests in the same change when architecture shifts.
Files:
tests/test_mcp_server.py
**/*
📄 CodeRabbit inference engine (.agents/coding-guidelines.md)
**/*: Before coding, state material assumptions, ask about ambiguous requirements, surface simpler alternatives or risks, and stop when behavior, ownership, or success criteria are unclear.
Implement the smallest solution: avoid speculative features, unnecessary abstractions, and clever control flow; prefer simple, readable code.
Make surgical changes: follow surrounding style, avoid unrelated refactors, and remove only obsolete code caused by the change.
Define verifiable success criteria, add a failing test first for behavior changes, run focused verification during development, and run broader documented validation before handoff when applicable.
Meaningful behavior changes require TDD and unit tests: add or update a focused failing test, implement the smallest passing change, refactor only after tests pass, run focused tests, and run the full suite before handoff.
Add coverage near changed components, cover failure paths, prefer deterministic tests over live-service tests, and reserve live smoke tests for deployment and transport verification.
Follow existing local patterns; use Pydantic models or typed dataclasses for structured data crossing boundaries; keep public contracts stable and small; avoid broad refactors and cross-level imports; and provide explicit operator-helpful configuration errors.
Write comments only for non-obvious policy, security, or protocol reasoning; do not narrate obvious code; update documentation when behavior, deployment, or public interfaces change.
**/*: Authentication is required by default.
OPA intent filtering is enabled by default.
Decision size defaults to unanimous approval; quorum is permitted only when explicitly configured.
Secrets and private keys must never be committed.
Example executors are examples, not production trust boundaries.
Keep the local agent signup service loopback-bound unless protected by real authentication; keep unauthenticated signup low-blast-radius and useNOMOS_SIGNUP_ALLOWED_ROLESto prevent...
Files:
tests/test_mcp_server.py
⚙️ CodeRabbit configuration file
Every hand-authored source and configuration file must begin with the NVIDIA proprietary header: an SPDX-FileCopyrightText copyright line and SPDX-License-Identifier: LicenseRef-NvidiaProprietary, followed by the standard NVIDIA proprietary notice. Flag any such file that is missing the header, and when a file is modified confirm its copyright year includes the current year. Generated code (e.g. _pb2.py) and vendored/third-party files are exempt.
Files:
tests/test_mcp_server.py
tests/**/*.py
📄 CodeRabbit inference engine (.agents/deployment.md)
After deployment, run the full test suite using
NOMOS_GRPC_SMOKE_ADDR="${NOMOS_PUBLIC_HOST:-$(hostname -f)}:9904" uv run pytest tests -q.Run the test suite with coverage enforcement using
uv run pytest tests -q --cov --cov-report=term-missing --cov-fail-under=77; add focused unit tests for uncovered behavior and do not lower the 77% coverage floor unless the reduction is intentional and documented.
Files:
tests/test_mcp_server.py
tests/**
⚙️ CodeRabbit configuration file
Tests are mandatory for behavior changes and should cover failure paths, not only happy paths. Prefer deterministic tests over live-service tests; live/kind tests are opt-in (see live_mcp and kind_e2e markers). Flag behavior changes to production code that arrive without corresponding test updates.
Files:
tests/test_mcp_server.py
🔇 Additional comments (4)
tests/test_mcp_server.py (4)
39-49: LGTM!Also applies to: 59-59
143-170: LGTM!Also applies to: 171-200
12-18: 📐 Maintainability & Code QualityNo header change needed.
tests/test_mcp_server.pyincludes the NVIDIA proprietary header, the required SPDX license identifier, and copyright year 2026.> Likely an incorrect or invalid review comment.
324-334: 🔒 Security & PrivacyKeep this test focused on the authentication response.
call_tool_asyncreturns the authentication error before dispatchingpropose_intentwhen authentication returnsNone; a protected-operation spy is not required here.
Addressed:
- Updated the PR description to disclose that the council remains on Cryptography 46.0.7 because required NAT 1.8 imposes cryptography<47.
- Removed stale claims that the council used Cryptography 50.0.0 or had zero Critical/High findings.
- Deleted the unused deploy/requirements-overrides.txt instead of rewiring its incompatible cryptography>=48.0.1 override.
- Kept the executor independently pinned to Cryptography 50.0.0 because it does not install NAT.
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@nomos/mcp/server.py`:
- Around line 456-463: Update the synchronous authentication capacity rejection
in server.py so the failure payload from the block around
_SYNCHRONOUS_AUTHENTICATION_CAPACITY.acquire is classified as a transient
service-capacity condition instead of an authentication failure. Keep the
existing logger.warning and fail-closed return path, but change the returned
error message to avoid "Authentication failed" and clearly indicate capacity
exhaustion, using the same success/error/data shape from the current auth
response.
- Around line 301-314: Update _authenticate_with_timeout to create the task
directly from self._authenticate(auth_token), removing the inner
asyncio.wait_for wrapper. Keep the outer asyncio.wait using
_AUTHENTICATION_TIMEOUT_SECONDS, including its explicit task.cancel(), callback
registration, timeout error, and task.result() handling.
- Around line 465-492: Bound the completed.wait() call in call_tool and detect
when the worker thread exits without signalling completion, then raise an
appropriate failure instead of blocking indefinitely. Preserve normal result and
invoke() error propagation, while ensuring run_worker captures or exposes
failures from asyncio.run before invoke() starts. Add a focused test that forces
asyncio.run to fail before invoke() executes and verifies call_tool returns
rather than hanging.
In `@tests/test_mcp_server.py`:
- Around line 137-161: Widen the wall-clock upper bounds in the timing
assertions across the authentication tests, including
test_authentication_allows_event_loop_progress,
test_authentication_timeout_does_not_wait_for_cleanup, and the assertions near
the referenced lines. Keep the short monkeypatched timeout values unchanged;
only increase wait_for and elapsed thresholds so tests verify ordering without
relying on tight CI timing margins.
- Around line 193-210: Add a test in tests/test_mcp_server.py that invokes the
synchronous CouncilMCPServer.call_tool from within an active asyncio event loop
and asserts it raises RuntimeError with the message indicating that call_tool
cannot run on an active event loop and call_tool_async must be awaited. Use the
existing server setup and proposal arguments where appropriate, keeping the test
focused on this rejection path.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 23d72512-4e22-48eb-b24f-bfd1be3d5da6
⛔ Files ignored due to path filters (2)
LICENSE-THIRD-PARTYis excluded by!LICENSE-THIRD-PARTYand included by**uv.lockis excluded by!**/*.lockand included by**
📒 Files selected for processing (12)
.github/workflows/ci.yml.gitlab-ci.ymlagent_signup/requirements.txtdemo/requirements.txtdeploy/Dockerfiledeploy/Dockerfile.executordeploy/executor-constraints.txtmonitor/requirements.txtnomos/mcp/server.pypyproject.tomltests/test_dynamic_councils.pytests/test_mcp_server.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (9)
**/*
📄 CodeRabbit inference engine (.agents/coding-guidelines.md)
**/*: Before coding, state material assumptions, ask about ambiguous requirements, surface simpler alternatives or risks, and stop when behavior, ownership, or success criteria are unclear.
Implement the smallest solution: avoid speculative features, unnecessary abstractions, and clever control flow; prefer simple, readable code.
Make surgical changes: follow surrounding style, avoid unrelated refactors, and remove only obsolete code caused by the change.
Define verifiable success criteria, add a failing test first for behavior changes, run focused verification during development, and run broader documented validation before handoff when applicable.
Meaningful behavior changes require TDD and unit tests: add or update a focused failing test, implement the smallest passing change, refactor only after tests pass, run focused tests, and run the full suite before handoff.
Add coverage near changed components, cover failure paths, prefer deterministic tests over live-service tests, and reserve live smoke tests for deployment and transport verification.
Follow existing local patterns; use Pydantic models or typed dataclasses for structured data crossing boundaries; keep public contracts stable and small; avoid broad refactors and cross-level imports; and provide explicit operator-helpful configuration errors.
Write comments only for non-obvious policy, security, or protocol reasoning; do not narrate obvious code; update documentation when behavior, deployment, or public interfaces change.
**/*: Authentication is required by default.
OPA intent filtering is enabled by default.
Decision size defaults to unanimous approval; quorum is permitted only when explicitly configured.
Secrets and private keys must never be committed.
Example executors are examples, not production trust boundaries.
Keep the local agent signup service loopback-bound unless protected by real authentication; keep unauthenticated signup low-blast-radius and useNOMOS_SIGNUP_ALLOWED_ROLESto prevent...
Files:
deploy/Dockerfile.executorpyproject.tomldeploy/executor-constraints.txttests/test_dynamic_councils.pymonitor/requirements.txtnomos/mcp/server.pytests/test_mcp_server.pydemo/requirements.txtagent_signup/requirements.txtdeploy/Dockerfile
⚙️ CodeRabbit configuration file
Every hand-authored source and configuration file must begin with the Apache-2.0 header: an SPDX-FileCopyrightText copyright line followed by SPDX-License-Identifier: Apache-2.0. Flag any such file that is missing the header, and when a file is modified confirm its copyright year includes the current year. Generated code (e.g. _pb2.py) and vendored/third-party files are exempt.
Files:
deploy/Dockerfile.executorpyproject.tomldeploy/executor-constraints.txttests/test_dynamic_councils.pymonitor/requirements.txtnomos/mcp/server.pytests/test_mcp_server.pydemo/requirements.txtagent_signup/requirements.txtdeploy/Dockerfile
deploy/**
📄 CodeRabbit inference engine (.agents/deployment.md)
Recreate the OPA container whenever policy files change, because bundled OPA loads policies at startup; deployment must force-recreate OPA for policy changes.
Files:
deploy/Dockerfile.executordeploy/executor-constraints.txtdeploy/Dockerfile
⚙️ CodeRabbit configuration file
Deployment assets (Dockerfiles, compose, scripts). Check for pinned base images, non-root users, leaked secrets, and safe entrypoint scripting.
Files:
deploy/Dockerfile.executordeploy/executor-constraints.txtdeploy/Dockerfile
**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
**/*.py: Keep the dependency graph acyclic; when modules need each other, extract a lower-level abstraction rather than creating a cycle.
Use explicit names over clever indirection, keep files cohesive and small enough for their purpose to be obvious, and prefer structured data models over ad hoc dict/string protocols.
Put protocol and schema definitions near the boundary they govern, and treat public constructors, Pydantic models, protocol objects, and contract modules as component interfaces.
Files:
tests/test_dynamic_councils.pynomos/mcp/server.pytests/test_mcp_server.py
**/*.{py,md}
📄 CodeRabbit inference engine (.agents/architecture.md)
Preserve existing patterns unless there is a concrete architectural reason to change them, and update documentation and tests in the same change when architecture shifts.
Files:
tests/test_dynamic_councils.pynomos/mcp/server.pytests/test_mcp_server.py
tests/**/*.py
📄 CodeRabbit inference engine (.agents/deployment.md)
After deployment, run the full test suite using
NOMOS_GRPC_SMOKE_ADDR="${NOMOS_PUBLIC_HOST:-$(hostname -f)}:9904" uv run pytest tests -q.Run the test suite with coverage enforcement using
uv run pytest tests -q --cov --cov-report=term-missing --cov-fail-under=77; add focused unit tests for uncovered behavior and do not lower the 77% coverage floor unless the reduction is intentional and documented.
Files:
tests/test_dynamic_councils.pytests/test_mcp_server.py
tests/**
⚙️ CodeRabbit configuration file
Tests are mandatory for behavior changes and should cover failure paths, not only happy paths. Prefer deterministic tests over live-service tests; live/kind tests are opt-in (see live_mcp and kind_e2e markers). Flag behavior changes to production code that arrive without corresponding test updates.
Files:
tests/test_dynamic_councils.pytests/test_mcp_server.py
nomos/{nat,mcp,grpc}/**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
Ingress and adapter layers may depend inward, but domain layers must not depend on NAT, MCP, or gRPC adapters.
Files:
nomos/mcp/server.py
nomos/**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
Keep stable abstractions in lower levels and volatile orchestration in higher levels; package boundaries should correspond to design boundaries.
Files:
nomos/mcp/server.py
nomos/**
⚙️ CodeRabbit configuration file
Core library, organized into layered levels (level_0..level_4) plus auth, crypto, opa, store, mcp, grpc, and llm subsystems. Do not introduce cross-level imports to save a few lines. Require Pydantic models or typed dataclasses for structured data crossing service or trust boundaries. Keep public contracts small and stable; flag breaking changes to exported APIs. Prefer explicit, operator-actionable error messages over generic exceptions.
Files:
nomos/mcp/server.py
🧠 Learnings (1)
📚 Learning: 2026-08-05T15:24:57.021Z
Learnt from: ashsong-nv
Repo: NVIDIA/Nomos PR: 52
File: tests/test_live_e2e_status_classification.py:1-4
Timestamp: 2026-08-05T15:24:57.021Z
Learning: For new or modified hand-authored Python files in NVIDIA/Nomos, follow the repository’s Apache-2.0 license header convention. Do not add NVIDIA proprietary notices or `LicenseRef-NvidiaProprietary` identifiers.
Applied to files:
tests/test_dynamic_councils.pynomos/mcp/server.pytests/test_mcp_server.py
🪛 Checkov (3.3.9)
deploy/Dockerfile
[low] 64-64: Ensure the base image uses a non latest version tag
(CKV_DOCKER_7)
🔇 Additional comments (14)
pyproject.toml (1)
11-13: LGTM!Also applies to: 22-31, 43-44, 57-58
agent_signup/requirements.txt (1)
4-4: LGTM!Also applies to: 9-9
demo/requirements.txt (1)
5-6: LGTM!monitor/requirements.txt (1)
4-4: LGTM!deploy/Dockerfile (1)
22-23: LGTM!Also applies to: 38-42, 54-77
deploy/Dockerfile.executor (1)
48-50: LGTM!deploy/executor-constraints.txt (1)
1-30: LGTM!.github/workflows/ci.yml (1)
75-80: LGTM!.gitlab-ci.yml (1)
49-52: LGTM!nomos/mcp/server.py (2)
15-15: LGTM!Also applies to: 36-41
493-493: 🩺 Stability & AvailabilityVerify no caller invokes
call_toolfrom an active event loop.
call_toolnow raisesRuntimeErrorwhen a loop is running. This is a breaking change to an exported entry point.handle_mcp_requestcallscall_toolat Line 521, so any async transport or NAT function that reacheshandle_mcp_requestfrom a coroutine now fails at runtime instead of authenticating.Confirm every call site is synchronous, and confirm that
handle_mcp_requestitself is never awaited or called from within a loop.#!/bin/bash set -euo pipefail echo '--- call_tool / handle_mcp_request call sites ---' rg -nP -C 10 '\.(call_tool|handle_mcp_request)\s*\(' \ --glob '*.py' --glob '!**/site-packages/**' . echo '--- async functions that reference the MCP server facade ---' ast-grep run --lang python --pattern $'async def $F($$$): $$$' nomos demo 2>/dev/null \ | rg -n -C 6 'call_tool|handle_mcp_request|CouncilMCPServer' || true echo '--- executor / transport wiring ---' rg -nP -C 8 'CouncilMCPServer|handle_mcp_request' \ --glob '*.py' --glob '*.yaml' --glob '*.yml' --glob '!tests/**' .tests/test_mcp_server.py (2)
4-10: LGTM!Also applies to: 31-41, 51-51, 316-326
213-242: LGTM!Also applies to: 245-313
tests/test_dynamic_councils.py (1)
245-249: LGTM!
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
tests/test_mcp_server.py (1)
178-257: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winAdd tests for asynchronous cancellation and admission.
The current tests cover timeout handling and synchronous worker capacity. They do not cancel
call_tool_async()itself or exercise concurrent asynchronous calls with cancellation-resistant authentication.Add deterministic tests for both paths. Verify task cleanup and bounded pending work.
Also applies to: 279-349
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_mcp_server.py` around lines 178 - 257, The existing authentication timeout tests do not cover cancellation of call_tool_async or concurrent asynchronous admission limits. Extend the tests around test_authentication_timeout_does_not_wait_for_cleanup and the related async authentication cases to cancel an in-flight call, verify its task and authenticator cleanup complete, and add concurrent cancellation-resistant authentication calls that assert pending work remains bounded and admission capacity is released deterministically.Source: Path instructions
nomos/mcp/server.py (3)
406-416: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winDo not report authentication service failures as invalid tokens.
The broad
except Exceptionconverts timeouts and backend failures intoagent_id = None. The response then says"Authentication failed: invalid or expired token". A valid agent can receive a credential error during a service outage and re-provision unnecessarily.Keep the fail-closed decision, but return a temporary service-unavailable error for timeouts and backend failures. Reserve the invalid-token message for
authenticate()returningNone. Update timeout tests to assert the distinct error class.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nomos/mcp/server.py` around lines 406 - 416, Update the authentication handling around _authenticate_with_timeout so exceptions from timeouts or backend/service failures remain distinguishable from authenticate() returning None: keep rejecting the request, but return a temporary service-unavailable error for exception paths and retain the invalid-or-expired-token error only for a None agent_id. Update the timeout tests to assert the distinct service-unavailable error class.
301-309: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winCancel authentication when the caller cancels.
Cancelling
asyncio.wait()does not cancel its authentication task. The task can continue without the 10-second timeout or result consumer. Cancel it in anasyncio.CancelledErrorpath and add a regression test for cancelledcall_tool_async()calls.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nomos/mcp/server.py` around lines 301 - 309, Update _authenticate_with_timeout to catch asyncio.CancelledError while awaiting asyncio.wait, cancel the authentication task, register _consume_authentication_result to consume its eventual outcome, and re-raise the cancellation. Add a regression test covering a cancelled call_tool_async() and verifying the authentication task is cancelled and cleaned up.Source: Path instructions
301-309: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy liftDenial of Service (CWE-400): Uncontrolled Resource Consumption
Reachability: External · Exploitability: Moderate
Reachability path
● Entry tests/test_mcp_server.py │ ▼ ● Sink nomos/mcp/server.pyBound asynchronous authentication admission.
When an authenticator resists cancellation,
_authenticate_with_timeout()leaves one task pending per timed-outcall_tool_async()request. Unlikecall_tool(), the asynchronous path has no admission limit. Reject excess asynchronous authentication attempts or enforce bounded cancellation at the authentication boundary. Add a concurrency test with a cancellation-resistant authenticator.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nomos/mcp/server.py` around lines 301 - 309, The asynchronous authentication path in _authenticate_with_timeout currently permits an unbounded number of cancellation-resistant tasks to remain pending after timeouts. Add an admission limit or bounded cancellation mechanism at this authentication boundary, ensuring excess call_tool_async authentication attempts are rejected or safely bounded while preserving existing successful and timeout behavior; add a concurrency test using a cancellation-resistant authenticator.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@nomos/mcp/server.py`:
- Around line 406-416: Update the authentication handling around
_authenticate_with_timeout so exceptions from timeouts or backend/service
failures remain distinguishable from authenticate() returning None: keep
rejecting the request, but return a temporary service-unavailable error for
exception paths and retain the invalid-or-expired-token error only for a None
agent_id. Update the timeout tests to assert the distinct service-unavailable
error class.
- Around line 301-309: Update _authenticate_with_timeout to catch
asyncio.CancelledError while awaiting asyncio.wait, cancel the authentication
task, register _consume_authentication_result to consume its eventual outcome,
and re-raise the cancellation. Add a regression test covering a cancelled
call_tool_async() and verifying the authentication task is cancelled and cleaned
up.
- Around line 301-309: The asynchronous authentication path in
_authenticate_with_timeout currently permits an unbounded number of
cancellation-resistant tasks to remain pending after timeouts. Add an admission
limit or bounded cancellation mechanism at this authentication boundary,
ensuring excess call_tool_async authentication attempts are rejected or safely
bounded while preserving existing successful and timeout behavior; add a
concurrency test using a cancellation-resistant authenticator.
In `@tests/test_mcp_server.py`:
- Around line 178-257: The existing authentication timeout tests do not cover
cancellation of call_tool_async or concurrent asynchronous admission limits.
Extend the tests around test_authentication_timeout_does_not_wait_for_cleanup
and the related async authentication cases to cancel an in-flight call, verify
its task and authenticator cleanup complete, and add concurrent
cancellation-resistant authentication calls that assert pending work remains
bounded and admission capacity is released deterministically.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 2cf2806d-0910-4810-ad52-1de5489c5ef2
📒 Files selected for processing (2)
nomos/mcp/server.pytests/test_mcp_server.py
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
- GitHub Check: Bandit
- GitHub Check: Validate config
- GitHub Check: Lint
- GitHub Check: Type check
- GitHub Check: Secret scan
🧰 Additional context used
📓 Path-based instructions (8)
nomos/{nat,mcp,grpc}/**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
Ingress and adapter layers may depend inward, but domain layers must not depend on NAT, MCP, or gRPC adapters.
Files:
nomos/mcp/server.py
**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
**/*.py: Keep the dependency graph acyclic; when modules need each other, extract a lower-level abstraction rather than creating a cycle.
Use explicit names over clever indirection, keep files cohesive and small enough for their purpose to be obvious, and prefer structured data models over ad hoc dict/string protocols.
Put protocol and schema definitions near the boundary they govern, and treat public constructors, Pydantic models, protocol objects, and contract modules as component interfaces.
Files:
nomos/mcp/server.pytests/test_mcp_server.py
nomos/**/*.py
📄 CodeRabbit inference engine (.agents/architecture.md)
Keep stable abstractions in lower levels and volatile orchestration in higher levels; package boundaries should correspond to design boundaries.
Files:
nomos/mcp/server.py
**/*.{py,md}
📄 CodeRabbit inference engine (.agents/architecture.md)
Preserve existing patterns unless there is a concrete architectural reason to change them, and update documentation and tests in the same change when architecture shifts.
Files:
nomos/mcp/server.pytests/test_mcp_server.py
**/*
📄 CodeRabbit inference engine (.agents/coding-guidelines.md)
**/*: Before coding, state material assumptions, ask about ambiguous requirements, surface simpler alternatives or risks, and stop when behavior, ownership, or success criteria are unclear.
Implement the smallest solution: avoid speculative features, unnecessary abstractions, and clever control flow; prefer simple, readable code.
Make surgical changes: follow surrounding style, avoid unrelated refactors, and remove only obsolete code caused by the change.
Define verifiable success criteria, add a failing test first for behavior changes, run focused verification during development, and run broader documented validation before handoff when applicable.
Meaningful behavior changes require TDD and unit tests: add or update a focused failing test, implement the smallest passing change, refactor only after tests pass, run focused tests, and run the full suite before handoff.
Add coverage near changed components, cover failure paths, prefer deterministic tests over live-service tests, and reserve live smoke tests for deployment and transport verification.
Follow existing local patterns; use Pydantic models or typed dataclasses for structured data crossing boundaries; keep public contracts stable and small; avoid broad refactors and cross-level imports; and provide explicit operator-helpful configuration errors.
Write comments only for non-obvious policy, security, or protocol reasoning; do not narrate obvious code; update documentation when behavior, deployment, or public interfaces change.
**/*: Authentication is required by default.
OPA intent filtering is enabled by default.
Decision size defaults to unanimous approval; quorum is permitted only when explicitly configured.
Secrets and private keys must never be committed.
Example executors are examples, not production trust boundaries.
Keep the local agent signup service loopback-bound unless protected by real authentication; keep unauthenticated signup low-blast-radius and useNOMOS_SIGNUP_ALLOWED_ROLESto prevent...
Files:
nomos/mcp/server.pytests/test_mcp_server.py
⚙️ CodeRabbit configuration file
Every hand-authored source and configuration file must begin with the Apache-2.0 header: an SPDX-FileCopyrightText copyright line followed by SPDX-License-Identifier: Apache-2.0. Flag any such file that is missing the header, and when a file is modified confirm its copyright year includes the current year. Generated code (e.g. _pb2.py) and vendored/third-party files are exempt.
Files:
nomos/mcp/server.pytests/test_mcp_server.py
nomos/**
⚙️ CodeRabbit configuration file
Core library, organized into layered levels (level_0..level_4) plus auth, crypto, opa, store, mcp, grpc, and llm subsystems. Do not introduce cross-level imports to save a few lines. Require Pydantic models or typed dataclasses for structured data crossing service or trust boundaries. Keep public contracts small and stable; flag breaking changes to exported APIs. Prefer explicit, operator-actionable error messages over generic exceptions.
Files:
nomos/mcp/server.py
tests/**/*.py
📄 CodeRabbit inference engine (.agents/deployment.md)
After deployment, run the full test suite using
NOMOS_GRPC_SMOKE_ADDR="${NOMOS_PUBLIC_HOST:-$(hostname -f)}:9904" uv run pytest tests -q.Run the test suite with coverage enforcement using
uv run pytest tests -q --cov --cov-report=term-missing --cov-fail-under=77; add focused unit tests for uncovered behavior and do not lower the 77% coverage floor unless the reduction is intentional and documented.
Files:
tests/test_mcp_server.py
tests/**
⚙️ CodeRabbit configuration file
Tests are mandatory for behavior changes and should cover failure paths, not only happy paths. Prefer deterministic tests over live-service tests; live/kind tests are opt-in (see live_mcp and kind_e2e markers). Flag behavior changes to production code that arrive without corresponding test updates.
Files:
tests/test_mcp_server.py
🧠 Learnings (1)
📚 Learning: 2026-08-05T15:24:57.021Z
Learnt from: ashsong-nv
Repo: NVIDIA/Nomos PR: 52
File: tests/test_live_e2e_status_classification.py:1-4
Timestamp: 2026-08-05T15:24:57.021Z
Learning: For new or modified hand-authored Python files in NVIDIA/Nomos, follow the repository’s Apache-2.0 license header convention. Do not add NVIDIA proprietary notices or `LicenseRef-NvidiaProprietary` identifiers.
Applied to files:
nomos/mcp/server.pytests/test_mcp_server.py
🔇 Additional comments (3)
tests/test_mcp_server.py (1)
4-10: LGTM!Also applies to: 31-41, 51-51, 135-177, 259-277, 350-361
nomos/mcp/server.py (2)
443-500: 🎯 Functional CorrectnessNo production async caller uses
handle_mcp_request().The NAT MCP transport registers separate tools and does not invoke
CouncilMCPServer.handle_mcp_request(). Thecall_tool()event-loop guard is covered by an existing unit test.> Likely an incorrect or invalid review comment.
375-405: 🔒 Security & PrivacyReachability path
● Entry tests/test_mcp_server.py │ ▼ ● Sink nomos/mcp/server.pyRequire authentication for read-only tools when
CouncilMCPServeris externally exposed.
handle_mcp_request()forwardstools/calltocall_tool()without transport authentication. The read-only tools are outside_AUTHENTICATED_TOOLS. Confirm that every production transport protects this entry point; otherwise require authentication or define an explicit public-tool allowlist.
There was a problem hiding this comment.
Claude Opus 4.8 · Role: Reviewer · via @drobison00
🔴 Required — LICENSE-THIRD-PARTY reports a cryptography version the council cannot ship
The manifest changes cryptography 46.0.7 → 50.0.0, but the council resolves cryptography==46.0.7 (uv.lock, installed via uv sync --frozen) under pyproject.toml's cryptography>=46.0.6,<47 + nvidia-nat[mcp]==1.8.0 (→ <47). 50.0.0 cannot be installed in that environment — it is the executor's pin (deploy/executor-constraints.txt), so the SBOM looks regenerated from the wrong resolution.
Why it matters: a scanner or auditor reading the shipped SBOM sees cryptography 50.0.0 (past the GHSA-537c-gmf6-5ccf fix line of 48.0.1) and reports the council clean — while it actually ships the deferred-vulnerable 46.0.7. The one file downstream consumers trust for compliance hides the exact advisory this PR sets out to transparently defer. Please regenerate LICENSE-THIRD-PARTY from the council resolution (uv.lock).
🟠 Please justify — the cryptography deferral does not address the Writ-signing path
The council signs every Writ of Execution with cryptography Ed25519 (nomos/level_0/crypto/signing.py) and ships 46.0.7 — the deferred-vulnerable line. The deferral rests only on "NAT forces <47" (correct — nvidia-nat-core 1.8.0 requires it), with no analysis of whether GHSA-537c-gmf6-5ccf actually reaches Ed25519 sign/verify. Meanwhile the same PR moves the other two Ed25519 users off that line: agent_signup/requirements.txt >=42.0.0 → >=48.0.1 and deploy/executor-constraints.txt ==50.0.0. If the advisory does not touch Ed25519, those bumps are unnecessary; if it does, the component whose entire purpose is cryptographic non-repudiation is on known-vulnerable crypto. Please state the signing-path reachability explicitly in the accepted-risk note rather than resting on the NAT ceiling alone.
🟡 Minor
[nat]floors below the declared fixes:pyproject.tomlhasmcp>=1.28.1,<2/soupsieve>=2.8.4, but the advisory table's fixes aremcp 1.29.0/soupsieve 2.9.1. The image is safe (the frozen lock pins the fixed versions), but the newpip install ".[nat]"CI gate resolves from the floors, not the lock — confirm those floors are at/above the first-fixed versions (soupsieve's pre-fix was2.8.3, so2.8.4may be right;mcp 1.28.1vs the three CVE fixes is the one to check) or raise them to match the table.- CI gates diverge:
.github/workflows/ci.ymlhash-pins the pip wheel while.gitlab-ci.ymlfloatspip install --upgrade pip, and neither added block selects the Python 3.13 the validation claims (both use the runner's ambientpython -m venv). nvidia-nat-langchainsilently dropped from the council image (deploy/Dockerfileremoved the explicit install; absent fromuv.lock). Appears runtime-safe — no council path imports the NAT langchain integration (plugin.py/registry.py/council.yaml) — but it is undisclosed; please confirm nothing depends on it.
✅ Verified sound
- The async auth rewrite fails closed: authentication timeout, exception, and
capacity exhaustedall returnsuccess: false(deny);_bind_authenticated_identityoverwrites any caller-suppliedagent_idwith the authenticated principal;_AUTHENTICATED_TOOLScovers every mutating tool. No path produces an incorrect authorization. The availability/leak concerns on this path (theBoundedSemaphore(8)also throttles healthy concurrent calls, not just stuck cleanup; unbounded async task orphaning;completed.wait()can block the full 10 s) are real but already covered in the existing review thread onnomos/mcp/server.py— I concur with those. - Dependency core is consistent:
uv.lockmatches the claimedmcp 1.29.0/soupsieve 2.9.1/starlette 1.3.1/nvidia-nat 1.8.0; both Docker stages install from the frozen lock;executor-constraints.txtis a self-consistent hashed closure that legitimately avoids the NAT<47ceiling; the Ed25519 build gate is a genuine fail-hard round trip. - The management-token test change hardens (deletes the inherited env vars so the "not configured" fail-closed branch is now deterministically asserted), not weakens.
Scope note: diff-and-reasoning review — the council image and dependency resolution were not built in this environment.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pyproject.toml`:
- Line 27: Regenerate LICENSE-THIRD-PARTY from the current uv.lock so the Click
entry reflects version 8.4.2, then add uv lock --check to the CI validation
workflow.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 3010225f-601b-4520-a2c5-73bc1d777518
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lockand included by**
📒 Files selected for processing (1)
pyproject.toml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*
📄 CodeRabbit inference engine (.agents/coding-guidelines.md)
**/*: Before coding, state material assumptions, ask clarifying questions when interpretations differ, surface simpler alternatives or risky tradeoffs, and stop when requirements or success criteria are ambiguous.
Implement the smallest solution that meets the current requirement; avoid speculative features, unnecessary abstractions, and clever control flow.
Keep changes surgical: match surrounding style, avoid unrelated refactors, and remove only obsolete code caused by the change.
Define verifiable success criteria, add a failing test first for behavior changes, run focused verification during development, run broader validation before handoff, and record blockers and residual risk when verification cannot run.
**/*: This project brokers privileged actions; use a fail-closed default posture.
Authentication is required by default.
OPA intent filtering is enabled by default.
Decision size defaults to unanimous approval; quorum is permitted only when explicitly configured.
Secrets and private keys must never be committed.
Keep the local agent signup service loopback-bound unless it is behind real authentication; keep its unauthenticated HTTP path low-blast-radius and useNOMOS_SIGNUP_ALLOWED_ROLESto prevent browser-created accounts from receiving operator/admin privilege.
When fail-closed mode is enabled, OPA errors and undefined decisions must deny.
Writ execution must verify signatures, target agent, expiry, nonce, command, and packaged file integrity before execution.
Executor implementations must conform totrusted_executor_contract.
Do not couple core council behavior to the internals of the in-repository getting-started executor.
Prefer absolute executable paths in privileged commands.
Treat opaque scripts, remotely fetched code, broad recursive mutation, and secret/key access as high-risk until proven otherwise.
Security-sensitive changes require tests covering both allow and deny paths.
Auth, OPA, writ validation, executor boundaries, and account ma...
Files:
pyproject.toml
⚙️ CodeRabbit configuration file
Every hand-authored source and configuration file must begin with the Apache-2.0 header: an SPDX-FileCopyrightText copyright line followed by SPDX-License-Identifier: Apache-2.0. Flag any such file that is missing the header, and when a file is modified confirm its copyright year includes the current year. Generated code (e.g. _pb2.py) and vendored/third-party files are exempt.
Files:
pyproject.toml
🔇 Additional comments (1)
pyproject.toml (1)
27-27: 📐 Maintainability & Code QualityNo SPDX header change is needed.
pyproject.tomlalready includes the Apache-2.0 header and a2026copyright year.> Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)
76-81: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winValidate the built or published artifact.
Line 80 installs
.[nat]from the checkout. It does not validate the wheel or source distribution that users receive. A packaging regression can therefore pass this job while the published artifact has different metadata or missing files.Build the artifact and install it into the isolated environment, or install the exact published version from the package index. Then run
pip checkand the NAT import or startup smoke test against that artifact.Suggested validation flow
- name: Validate published NAT extra run: | + uv build --wheel --out-dir /tmp/nomos-nat-dist python -m venv /tmp/nomos-nat-install /tmp/nomos-nat-install/bin/python -m pip install --upgrade "pip @ https://files.pythonhosted.org/packages/62/36/a3aed958d60531cb442b7ab4596cda7b3621cfb916f8ae1d6769795c7dc1/pip-26.2-py3-none-any.whl#sha256=931c303696af6fa3417112103b1cad26890e5a07eccb5b99783700e33f2b8aad" - /tmp/nomos-nat-install/bin/python -m pip install ".[nat]" + /tmp/nomos-nat-install/bin/python -m pip install /tmp/nomos-nat-dist/*.whl /tmp/nomos-nat-install/bin/python -m pip check🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci.yml around lines 76 - 81, Update the “Validate published NAT extra” workflow step to build the distribution artifact or install the exact published package version instead of installing `.[nat]` from the checkout. Install that artifact into `/tmp/nomos-nat-install`, then retain `pip check` and add the existing NAT import or startup smoke test against the installed artifact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 76-81: Update the “Validate published NAT extra” workflow step to
build the distribution artifact or install the exact published package version
instead of installing `.[nat]` from the checkout. Install that artifact into
`/tmp/nomos-nat-install`, then retain `pip check` and add the existing NAT
import or startup smoke test against the installed artifact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 570acc29-9207-471d-b6b9-080e7660ac72
⛔ Files ignored due to path filters (1)
LICENSE-THIRD-PARTYis excluded by!LICENSE-THIRD-PARTYand included by**
📒 Files selected for processing (1)
.github/workflows/ci.yml
📜 Review details
🔇 Additional comments (1)
.github/workflows/ci.yml (1)
71-74: LGTM!
Summary
Remediates eight High-severity Python dependency advisories in the council stack and hardens dependency installation and MCP authentication. The remaining
cryptographyadvisory is explicitly deferred because the required latest stable NVIDIA NAT release, 1.8.0, depends onnvidia-nat-core==1.8.0, which requirescryptography>=46.0.6,<47. The affected OpenSSL PKCS#7 verification path is not reachable from the council's raw-key Ed25519 Writ signing or verification path; the reachability analysis and residual risk are documented below.The change also makes council image dependencies reproducible from
uv.lockand executor dependencies reproducible from a fully pinned constraints file, adds build-time dependency and signing validation, constrains MCP to the v1 release line, and ensures authentication does not block an active event loop or exceed its 10-second deadline.Advisory status
cryptographyPKCS7_verify(); none of its listed issues targets Ed25519. Nomos signs and verifies canonical Writ bytes directly with raw Ed25519 keys and does not invoke PKCS#7/S/MIME APIs. Stablenvidia-nat-core1.8.0 requires<47, so the package-level finding remains accepted until NAT supports the patched line.mcpmcpmcpsoupsievesoupsievestarletteStaticFiles.starletteAdditional scanner findings
cryptographyaiohttpaiohttpis no longer in the resolved lockfile.clickpip-auditdetected command injection exposure in 8.3.2 through attacker-controlled input passed toclick.edit(); the security floor is 8.3.3 and the lock now resolves 8.4.2.Changes
nvidia-nat[mcp]release to 1.8.0 and publishes its compatiblecryptography>=46.0.6,<47boundary.pip checkand was ignored by normalpip install ".[nat]"consumers.mcp>=1.28.1,<2in thenat,grpc, anddevextras and in the demo requirements.click>=8.3.3as a transitive security floor and refreshes the lock toclick==8.4.2.uv sync --frozenfrom the committeduv.lockin both Docker dependency stages.pip check, imports NAT and MCP, and performs an Ed25519 sign/verify round trip.pip install ".[nat]"andpip checkvalidation to GitHub and GitLab CI.COUNCIL_MANAGEMENT_TOKENandNOMOS_COUNCIL_MANAGEMENT_TOKENvalues.uv.lockwith the verified stable dependency set.Validation
pip install ".[nat]"pip check: no broken requirementsnvidia-nat==1.8.0,nvidia-nat-core==1.8.0,cryptography==46.0.7uv lock --checkpip-audittargeted verification:click==8.4.2, no Click findingsgit diff --checkvalidation passedAccepted risk and follow-up
GHSA-537c-gmf6-5ccf flags
cryptography==46.0.7because its wheel bundles a vulnerable OpenSSL. The linked OpenSSL advisory's only High-severity issue, CVE-2026-45447, is a use-after-free reached when an application passes a crafted PKCS#7 or S/MIME signed message to OpenSSLPKCS7_verify(). None of the issues listed in that OpenSSL advisory targets Ed25519 signing or verification.That vulnerable operation is not reachable from Nomos's Writ signing path.
Signer.sign()andWritOfExecution.sign()construct Ed25519 keys from raw 32-byte key material and callEd25519PrivateKey.sign()over canonical bytes; the corresponding verification paths construct raw Ed25519 public keys and callEd25519PublicKey.verify(). They do not parse PKCS#7/S/MIME containers or call PKCS#7 APIs, and no council application source references those APIs. The advisory therefore does not affect Writ signature authenticity, integrity, or non-repudiation through the current signing/verification path.The package-level finding is still accepted risk: the council ships the affected OpenSSL inside the
cryptographywheel, and a future or transitive code path could use an affected API. The independently resolved agent-signup and executor environments remain upgraded to patchedcryptographyversions because they have no NAT ceiling; removing the vulnerable bundled OpenSSL there avoids carrying unnecessary latent exposure and does not imply that Ed25519 itself is affected.Upgrade the council to
cryptography>=48.0.1and remove the temporary<47ceiling as soon as a stable NVIDIA NAT release widensnvidia-nat-corecompatibility. Until then, the PR does not claim zero Critical/High scanner findings.Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores