Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
198 lines (182 loc) · 6.35 KB
/
Copy pathpyproject.toml
File metadata and controls
198 lines (182 loc) · 6.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
[project]
name = "nomos"
version = "0.1.0"
description = "Stops AI agents from taking unwanted or overeager actions by reviewing each one against the agent's own context, then running only what was approved under a signed, single-use Writ"
readme = "README.md"
license = { text = "Apache-2.0" }
requires-python = ">=3.11"
authors = [{ name = "NVIDIA Corporation" }]
maintainers = [{ name = "NVIDIA Corporation" }]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Security",
"Topic :: System :: Systems Administration",
]
dependencies = [
# Shared HTTP/MCP dependency: TLS hostname validation fix (CVE-2026-63374).
"anyio>=4.14.2",
# nvidia-nat-core 1.9 requires cryptography<49. This floor fixes its bundled
# OpenSSL advisory; the remaining crypto fixes require upstream support for 50.
"cryptography>=48.0.1,<49",
"pydantic>=2.0.0",
"pydantic-settings>=2.15.0",
"pyyaml>=6.0.0",
"httpx>=0.27",
"redis>=6.0.0",
]
[project.optional-dependencies]
assurance = [
"nomos[postgres]",
"fastapi>=0.141.1",
"uvicorn>=0.44.0",
"httpx>=0.28.1",
"jsonschema>=4.26.0",
"pydantic>=2.12.5",
"starlette>=1.3.1",
]
assurance-compass = [
"nomos[assurance]",
# 1.106.0 loads optional MCP 2.x imports for ordinary function-tool calls.
# Keep ETHOS inference compatible with the core MCP 1.x environment.
"litellm==1.105.1 ; python_version >= '3.12' and python_version < '3.14'",
# Compass's reviewed runtime supports Python 3.12 and 3.13 only. Core
# Nomos remains usable without Compass on its other supported versions.
"insight-agent @ git+https://github.com/NVIDIA-NeMo/nemo-compass.git@518ad41d583e259205fb89623cb035ae3904f3f8 ; python_version >= '3.12' and python_version < '3.14'",
]
nat = [
"nvidia-nat[mcp]==1.9.0",
# Security floors for transitive deps introduced by the nvidia-nat stack.
# Not imported directly by nomos; pinned at advisory fixed versions so the
# manifest-based scanner and image builds never select a vulnerable range.
"authlib>=1.6.11",
"click>=8.3.3",
"pyjwt>=2.15.0",
"python-multipart>=0.0.27",
"mcp>=1.28.1,<2",
"soupsieve>=2.8.4",
"starlette>=1.3.1",
"urllib3>=2.8.0",
]
openai = [
"openai>=1.0.0",
]
anthropic = [
"anthropic>=0.30.0",
]
grpc = [
"grpcio>=1.62.0",
"grpcio-tools>=1.62.0",
"mcp>=1.28.1,<2",
"starlette>=1.3.1",
"protobuf>=4.25.0",
]
postgres = [
"psycopg[binary,pool]>=3.2",
]
all-backends = [
"nomos[nat,openai,anthropic]",
]
dev = [
"nomos[grpc,postgres]",
"fastapi>=0.110",
"mcp>=1.28.1,<2",
"starlette>=1.3.1",
"pytest>=8.0.0",
"pytest-cov>=4.0.0",
"pytest-asyncio>=0.23.0",
"pytest-mock>=3.12.0",
"uvicorn[standard]>=0.27",
"mypy>=2.4.0",
"ruff>=0.2.0",
"pre-commit>=4.7.0",
# Activation script and seed-wheel fixes (CVE-2026-102925/102930/102937).
"virtualenv>=21.7.13",
"bandit[toml]>=1.8.0",
"detect-secrets>=1.5.0",
]
all = [
"nomos[all-backends,dev,grpc]",
]
[project.urls]
Homepage = "https://github.com/NVIDIA/Nomos"
Repository = "https://github.com/NVIDIA/Nomos"
Issues = "https://github.com/NVIDIA/Nomos/issues"
[project.entry-points.'nat.plugins']
nomos = "nomos.nat.plugin"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.uv]
managed = true
[tool.hatch.build.targets.wheel]
packages = ["nomos", "trusted_executor_contract", "nomos_runtime", "assurance"]
[tool.hatch.metadata]
allow-direct-references = true
[tool.pytest.ini_options]
testpaths = ["tests"]
# scripts/ holds operator utilities, not pytest suites; scripts/test_live_e2e.py
# parses sys.argv at import time, so `pytest .` aborts collection on it. Keep the
# pytest defaults and add scripts so an explicit path argument still works.
norecursedirs = ["*.egg", ".*", "_darcs", "build", "CVS", "dist", "node_modules", "venv", "{arch}", "scripts"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = "-v --tb=short"
markers = [
"live_mcp: opt-in tests that exercise a deployed MCP council",
"kind_e2e: opt-in tests that exercise a deployed Kind council and executor",
]
[tool.coverage.run]
source = ["nomos", "executors", "trusted_executor_contract", "nomos_runtime"]
omit = [
"nomos/grpc/v1/*_pb2*.py",
# Integration-tested against a real PostgreSQL (NOMOS_TEST_DATABASE_URL);
# their suites skip when no server is reachable, so they are excluded from
# the unit-coverage floor rather than dragging it on machines without PG.
"nomos/store/postgres_store.py",
"nomos/store/migrate.py",
"nomos/level_1/ledger/postgres_storage.py",
]
[tool.coverage.report]
fail_under = 79
show_missing = true
skip_covered = false
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "S", "B", "UP", "RUF"]
# S = flake8-bandit rules, B = flake8-bugbear, UP = pyupgrade, RUF = ruff-specific
ignore = [
"S101", # assert used (fine in tests)
"S603", # subprocess call — checked by design in executor
"S607", # partial executable path — intentional in permission categorizer
"S108", # hardcoded temp directory — used in tests
"B008", # function call in default arg — used by pydantic Field()
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["S101", "S105", "S106"] # asserts, hardcoded passwords in test fixtures
"scripts/**" = ["S101", "S105", "E501"]
"nomos/grpc/v1/*_pb2*.py" = ["ALL"]
"nomos/grpc/server.py" = ["N802"]
"tests/test_opa_client.py" = ["N802"]
"executors/docker/api.py" = ["N802"]
"executors/openshell/runtime.py" = ["N802"]
"tests/test_openshell_executor.py" = ["N802"]
[tool.bandit]
exclude_dirs = ["tests", "scripts"]
skips = ["B101", "B105", "B107", "B110", "B104", "B310", "B404", "B602", "B603", "B607"]