fix: reject all network effects in os_check - #39
Conversation
- lex.toml: switch to git deps - src/agents/*: build, explore, plan, refactor, review, spec, test agents updated - src/permissions/rules.lex, manifests.lex: permission rules and manifests - src/tools/index.lex, os_check.lex: tool index and OS check tool - src/server/web.lex: web server - src/web/index.html: updated UI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: alpibrupa <alpibrupa@users.noreply.github.com>
Co-authored-by: alpibrupa <alpibrupa@users.noreply.github.com>
Co-authored-by: alpibrupa <alpibrupa@users.noreply.github.com>
Co-authored-by: alpibrupa <alpibrupa@users.noreply.github.com>
| } | ||
|
|
||
| fn network_effects() -> List[Str] { | ||
| ["net", "http", "mcp", "llm_cloud"] |
There was a problem hiding this comment.
Medium: this network denylist misses the real llm effect name used elsewhere in the project ([env, net, llm, ...]). A refactor-mode change that introduces LLM access can pass os_check because llm_cloud is never emitted, bypassing the intended no-network/no-cloud grant and enabling prompt/data exfiltration or unintended model calls.
| lex-llm = { git = "https://github.com/alpibrusl/lex-llm" } | ||
| lex-agent = { git = "https://github.com/alpibrusl/lex-agent" } | ||
| lex-trail = { git = "https://github.com/alpibrusl/lex-trail" } | ||
| lex-spec = { git = "https://github.com/alpibrusl/lex-spec" } | ||
| lex-schema = { git = "https://github.com/alpibrusl/lex-schema" } | ||
| lex-os-manifest = { git = "https://github.com/alpibrusl/lex-os-manifest" } | ||
| lex-web = { git = "https://github.com/alpibrusl/lex-web" } |
There was a problem hiding this comment.
Medium: these dependencies now resolve from Git default branches without a pinned rev/tag or lockfile. Anyone who can alter one of those upstream repos, or a compromised upstream account, can change the code pulled into builds after review, creating a supply-chain code execution path. Pin immutable revisions or commit a lockfile.
There was a problem hiding this comment.
No critical correctness bugs found.
Reviewed the PR diff and traced the os_check/permission-gate path through tools_for_spec, with_permission_gate, and runtime dispatch. Validation performed:
lex checkpassed forsrc/tools/os_check.lex,src/tools/index.lex,src/agents/refactor.lex, andsrc/permissions/manifests.lexwith Lex 0.9.7 afterlex pkg install.- Confirmed scoped network effects still report base
netinlex --output json check, so the newos_checkforbidden list catches scoped network use. - Confirmed refactor tool exposure includes
os_checkand excludes network VCS push/pull.
Caveats below the critical bar: the full src/ check still fails at the pre-existing src/server/api.lex effect-row mismatch noted in repo memory, and lex fmt --check would reformat src/permissions/manifests.lex. I did not open a fix PR because neither is a newly confirmed critical issue from this review.
Sent by Cursor Automation: Quality of PR Lex


Bug and impact
os_checkonly treated barenetas forbidden for refactor/test grants even though the Lex trust lattice classifiesmcpandllm_cloudas network egress effects too. A refactor-mode generated Lex file declaring[llm_cloud]or[mcp]could pass the grant check despitenet=none, creating a policy bypass for cloud LLM/MCP calls.Root cause
The deny list in
src/tools/os_check.lexduplicated only part of upstreamlex-types::trust::effect_requirementinstead of covering every network-effect name.Fix
Added a shared
network_effects()helper containingnet,http,mcp, andllm_cloud, and use it for all modes withnetwork: none.Validation
lex0.9.7 and ranlex pkg install.lex check src/tools/os_check.lexsuccessfully.lex --output json checkemitsrequired_effects: ["llm_cloud"]for a targeted fixture.os_check.executeand confirmed it returnsgrant_violationforllm_cloudunder refactor mode.