Repository navigation
A deployment without the repository-job sandbox can index repositories its platform admins add - #912
Conversation
…s its platform admins add Without the sandbox, code.repo.add refuses and an entry it added is not fetched: the clone talks to a host the adder chose, and a plain process has no egress proxy to vet it. A deployment whose pods cannot create user namespaces therefore indexes only what its operator lists in LOOM_CODE_REPOS_JSON. LOOM_CODE_SELF_SERVICE_PLATFORM_ADMIN_ONLY leaves code.repo.remote_branches, code.repo.add and code.repo.add_branch to platform admins: the role counts on a flat token used by its own subject, and the check runs before the sandbox probe and before any remote job. LOOM_CODE_SELF_SERVICE_GIT_UNSANDBOXED then lifts the SANDBOX_UNAVAILABLE refusal of those ops and lets the ingest pass and history reads clone and fetch such an entry as plain processes. The waiver is a keyword the two git callers pass to unsandboxed_skip. A compiler tier asks without it and keeps skipping the entry, since its dependency installs and module downloads would run without the proxy too. The setting is refused at load without the platform-admin rule, because whoever names a remote picks what the server connects to, and together with LOOM_CODE_SANDBOX_REQUIRED, under which no job runs as a plain process. Health keeps repo_jobs_unsandboxed as a warning and says what the setting changes. Both settings default to off, so a deployment that sets neither keeps these refusals. Signed-off-by: pufit <[email protected]>
…principal A request without a principal passes the platform-admin rule: with auth off, and over MCP in open mode for a call that sends no bearer. With LOOM_CODE_SELF_SERVICE_GIT_UNSANDBOXED on, such a request names the host the server's git connects to, the one choice the setting leaves to platform admins. Load refuses the setting in those modes, beside its refusal without the platform-admin rule. The handler is unchanged: it has no caller to refuse. The operations guide says that the setting also resumes the git jobs of entries members added before the platform-admin rule was set, and what to review before turning it on. The load test drops assertions that read values nothing had set. Signed-off-by: pufit <[email protected]>
Signed-off-by: pufit <[email protected]>
zlareb1
left a comment
There was a problem hiding this comment.
No findings in the platform-admin gate, settings load refusals, git-only callers, compiler-tier exclusions or rolling-upgrade behavior. The 219 focused authorization, sandbox-policy, mirror, health and settings tests pass locally, with one Linux-only skip; the four generated-reference checks pass. CI must finish, including the real sandbox suite. Real network remotes were not exercised locally.
…t a principal where auth is on LOOM_CODE_SELF_SERVICE_PLATFORM_ADMIN_ONLY passed every call that carried no principal. That is the rule with auth off, where no transport asks for a token. It also let an MCP endpoint in open mode, on a deployment whose auth is on, add repositories for a caller that sent no bearer: such a call reaches the handler without a principal. The rule passes a call without a principal only where auth is off (auth_actually_required), which is when the MCP transport runs open as well. Where auth is on the call is refused like any caller that is not a platform admin. LOOM_CODE_SELF_SERVICE_GIT_UNSANDBOXED still does not load with MCP in open mode. Its message and the guide state the rule as it is: the handler refuses such a call, and the setting needs every caller authenticated. Signed-off-by: pufit <[email protected]>
Signed-off-by: pufit <[email protected]>
docs/reference/status.md conflicted on its count of boolean settings that load false. It is main's file regenerated by scripts/codegen/docs_reference.py, so it counts main's new setting and the two of this branch. Signed-off-by: pufit <[email protected]>
zlareb1
left a comment
There was a problem hiding this comment.
No findings in the updated platform-admin gate or its callers. The gate refuses a call without a principal when authentication is required, before any sandbox probe or remote job; auth-off behavior remains explicit. All 180 focused repository, sandbox-policy, compiler-tier and settings tests pass locally, with one Linux-only skip. CI must finish before merge; real network remotes were not exercised locally.
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
A deployment that cannot run the repository-job sandbox can index repositories its platform admins add with
code.repo.add.LOOM_CODE_SELF_SERVICE_PLATFORM_ADMIN_ONLYleavescode.repo.remote_branches,code.repo.addandcode.repo.add_branchto platform admins, andLOOM_CODE_SELF_SERVICE_GIT_UNSANDBOXEDthen runs such a repository's clone and fetches as plain processes while its compiler tiers stay skipped. Both default to off.Why
Without the repository-job sandbox,
code.repo.remote_branches,code.repo.addandcode.repo.add_branchanswerSANDBOX_UNAVAILABLE, and a repository added earlier is neither cloned nor fetched: its remote is a host the adder chose, and a plain-process job has no egress proxy to vet that host. The default Kubernetes pod security does not grant the user namespaces bubblewrap needs, so such a deployment indexes only what its operator lists inLOOM_CODE_REPOS_JSON, and every new repository is a configuration change and a rollout.Two facts allow a narrower rule. The git jobs between the add and a ready index (
ls-remote, the bare clone, fetches) run no repository code: a clone transfers objects and refs, the mirror is bare, and git reads no system or global configuration. What the sandbox adds for them is the address check, a filesystem view andHOMEof their own, and resource limits (CPU, memory, file size, processes). The address check matters most, because any org member may name the remote.This change adds two settings:
LOOM_CODE_SELF_SERVICE_PLATFORM_ADMIN_ONLYleaves the three ops that start a remote job or add an index to platform admins. The handler checks it after the self-service switch and before the sandbox probe and any remote job. The role counts on a flat token used by its own subject: a scoped token (ns_roles) is refused as on the admin routes, and so is a trusted caller acting for another subject (X-Loom-On-Behalf-Of), whose role is not that subject's. A call without a principal passes only with auth off, when no transport asks for a token and there is no caller to refuse. With auth on it is refused like any caller that is not a platform admin: an MCP endpoint inopenmode takes a call that sends no bearer, and that call reaches the handler without a principal.LOOM_CODE_SELF_SERVICE_GIT_UNSANDBOXEDlifts theSANDBOX_UNAVAILABLErefusal of those ops and lets the ingest pass and history reads clone and fetch a self-registered entry with a network remote. Loom refuses to load it in three cases: without the first setting, since whoever names a remote picks what the server connects to; with auth off (LOOM_AUTH_REQUIRED=falseorLOOM_IDENTITY_PROVIDER=single-user), where the platform-admin rule passes a call without a principal, and withLOOM_MCP_AUTH_MODE=open, where such a call arrives with auth on: the rule refuses it, and the setting still needs every caller authenticated; and together withLOOM_CODE_SANDBOX_REQUIRED, under which no job runs as a plain process.The waiver is a keyword,
git_only, that the two git callers pass tocompiler_tier.unsandboxed_skip. The compiler-tier pass andloom code scip-fullask without it and keep their skip, so no tier of such an entry runs: every tier's jobs reach the network (package installs,go mod download, submodules), and the C/C++ tier runs the repository's build.Alternatives and what each costs:
required_role=PLATFORM_ADMIN. AnOperationis fixed at import, so the role could not follow a setting, and every deployment would lose member self-service.code.reposso the dashboard follows the settings. It is a wire change with both SDK regenerations; the page keeps reading/v1/healthin this change.Scope and risk
server/settings(two fields, one load check),server/code/app/repo_admin.py(one helper, one call in each of the three handlers, the waiver in_require_sandbox),compiler_tier.unsandboxed_skipand its callers iningest_pass.pyandbootstrap.py, therepo_jobs_unsandboxedmessage, four documentation pages and the generated references.run_joband the sandbox, the egress proxy, the compiler-tier call sites, operator entries, self-registered entries on a local mirror (static tiers and no C/C++ tier),code.repo.remove,code.repo.set_accessandcode.repo.set_source(namespace admin gate), and the dashboard.sshremote runssshwith the server'sHOME. The load check ties this to the platform-admin rule, and the operations guide states it.code.repo.set_accessrewrites a registry row'screated_by, so the code cannot tell who named a remote. The operations guide says what to review before turning it on.openmode a call that sends no bearer has no principal, and no other gate stops it. The waiver loads in neither mode; the first setting alone loads in both./v1/healthreportsrepo_jobs_unsandboxedit offers no add, to platform admins included, so they call the op; elsewhere a member still sees the button and gets the refusal sentence.Compatibility, rollout and rollback
LOOM_CODE_SELF_SERVICE_PLATFORM_ADMIN_ONLY=truethe three ops answerAUTH_INSUFFICIENT(403) to a caller that is not a platform admin, a call without a principal included where auth is on; withLOOM_CODE_SELF_SERVICE_GIT_UNSANDBOXED=truethey stop answeringSANDBOX_UNAVAILABLE. A compiler-tier pass names a new skip reason for such an entry, and therepo_jobs_unsandboxedwarning has a second wording; its code and severity are unchanged.false, read at start. No default changes. Load refuses the waiver without the first setting, with auth off or MCP inopenmode, and withLOOM_CODE_SANDBOX_REQUIRED; each message names the settings involved.loom.code_reposwhoserow_kindis notaccess), and have those a platform admin would not add removed withcode.repo.remove. Then set both, with auth required and MCP not inopenmode, leaveLOOM_CODE_SANDBOX_REQUIREDoff, restart, and add repositories withcode.repo.addusing a platform admin's token.Tests
New and changed unit tests, each naming the rule it proves:
tests/unit/test_code_repo_self_service.py: withLOOM_CODE_SELF_SERVICE_PLATFORM_ADMIN_ONLYa member getsAUTH_INSUFFICIENT, with the setting named, from each of the three ops, before the sandbox probe and before any remote job, and nothing is registered. A platform admin runs all three. A scoped token, a trusted caller acting for a subject and an org admin are refused. With auth off (LOOM_AUTH_REQUIRED=false, andsingle-user) a call without a principal runs the three ops. With auth on and MCP inopenmode, an MCP call that sends no bearer getsAUTH_INSUFFICIENTfrom each of the three tools, before the sandbox probe and any remote job. WithLOOM_CODE_SELF_SERVICE_GIT_UNSANDBOXEDand no sandbox the three ops pass, the registry rows are written, and each call still probes off the event loop. With auth off the handler has no caller to refuse on that path either: the add reaches the remote the request names and registers the entry, which is the case the load check closes.tests/unit/test_repo_job_sandbox.py: the waiver keeps a self-registered network entry in the ingest pass and lets a history read through, while a compiler tier and the build tier keep their skips, an entry on a local mirror behaves as without the setting, and the required sandbox still refuses every entry. The load refusals: without the platform-admin rule, with auth off, withsingle-user, with MCPopenand with the required sandbox; the pair loads with auth on, and with MCPdiscovery_only. The health warning keeps its severity and fix and changes its sentence.tests/unit/test_code_compiler_tier_runner.py: with the waiver on and no sandbox, each of the four compiler-tier workers runs nothing for a self-registered network entry and names the new reason.tests/unit/test_mirrors.py: without the sandbox a history read starts no clone of such an entry, and starts it with the waiver.What ran, and what it showed:
LOOM_ENV_FILE= .venv/bin/python -m pytest -q tests/unit/test_code_repo_self_service.py tests/unit/test_code_repo_remote_branches.py tests/unit/test_repo_job_sandbox.py tests/unit/test_code_compiler_tier_runner.py tests/unit/test_mirrors.py tests/unit/test_health_error_text.py: 215 passed, 1 skipped (test_the_relay_is_given_the_live_idle_timeout, Linux only).make lintandmake typecheckpass.ruff format --check, Biome, Prettier and Taplo pass;shfmtwas not installed on the development host, and no shell file changed.pytest tests/unit -q -n autoon the development host (macOS), run on the first commit, before the two later fixes for calls without a principal and their tests: 38,686 passed; 1,222 failed and 13 errors. 1,234 of those are the same test ids that fail there on the base commit: the code-parse child process exits 1 on that host, and the localclickhousebinary refuses a setting the SQL-backed tests send. The other one is a linear-time timing test that failed on a loaded machine and passes when run again. No failing test is in a file this change touches.pytest bench -q: 251 passed. CI's run is the reference.LOOM_TEST_REQUIRE_SANDBOX=1 .venv/bin/python -m pytest tests/unit/test_repo_job_sandbox.py tests/unit/test_repo_job_sandbox_hostile.py -q), which this diff owes because it touchescompiler_tier.pyandtests/unit/test_repo_job_sandbox.py. They need a Linux host where bubblewrap can create namespaces, so CI'srepository-job sandbox (real bubblewrap)job is their first run. The integration suite and the Docker smoke jobs also run in CI.run_job's existing fallback, whichtest_a_required_sandbox_refuses_the_job_instead_of_running_it_plaincovers; the new tests prove which callers reach it.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. Checked: the order of the handler's checks against the transport gate for each of the three ops; that the compiler-tier pass and
loom code scip-fullcallunsandboxed_skipunchanged; every documentation sentence against the code path it names; the regenerated diff, which holds the two settings and nothing else.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed. (make lintandmake typecheckpass; the format checks pass butshfmt, which was not installed;make test-unitand the integration suite: see Tests.)docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py). (The configuration reference, the status table, the settings schema, the settings template and the defaults snapshot change; no op changed.)main; no merged migration is edited. (No migration.)hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version. (No plugin file changed.)npm --prefix frontend run build) and its tests pass, iffrontend/changed. (Unchanged.)docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code