Repository navigation
fix(guardrails): Codex's override file is an instruction file, ~/.codex runs code, and the pull worker reads a refusal from its body (abilityai/trinity-enterprise#978) - #4792
Open
webmixgamer wants to merge 1 commit into
Conversation
…ex runs code, and the pull worker reads a refusal from its body (Abilityai/trinity-enterprise#978) Review round on the item 2-5 change. - AGENTS.override.md joins INSTRUCTION_FILE_NAMES (all three byte-identical copies). The pinned Codex CLI reads it ahead of AGENTS.md in the same folder, so a person the agent is shared with could replace the standing instructions of the owner's Codex turns through the Files tab. Owner tier at any depth now, and an agent key needs instructions.manage for it. - .codex joins RUNS_CODE_DIRS. Codex has a project .codex/config.toml layer whose MCP servers it starts as commands; Trinity keeps Codex's own state in CODEX_HOME (~/.tmp/codex), so ~/.codex has no platform use. Owner-tier write, never an agent key's. - The agent's pull worker no longer maps a bare 403 to turn_refused: a refusal is read from the typed body only, as on the push and /chat paths (item 3). - A CLAUDE.md inside a skill folder is instructions as well as skills (the any-depth rule); a test row pins it. - /cso --diff report for this PR. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
✅ Nightly unit-suite clean when this PR is merged into |
Contributor
Author
|
The nightly comment above is the known flake in #4138 (same test, 1 of 3 seeds, no subprocess or signal code in this diff). No change made. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #4782, which merged before this review round was pushed. Two of its review notes, plus what the
/cso --diffpass on it found. Same issue, same ruling (instruction file names count at any depth).Codex's
AGENTS.override.mdis an instruction file name. The pinned Codex CLI reads it ahead ofAGENTS.mdin the same folder. It was not inINSTRUCTION_FILE_NAMES, so the share tier could write it, at the top level too, and the owner's next Codex turn (run in the agent home) would load it instead of the owner's instructions. It joins the names in all three byte-identical copies: owner tier to write or delete at any depth, and an agent key needsinstructions.manage.~/.codex/runs code. Codex has a project.codex/config.tomllayer, read from its working directory above its own settings, whose MCP servers it starts as commands. Trinity keeps Codex's own state inCODEX_HOME(~/.tmp/codex, already runtime config), so~/.codexhas no platform use..codexjoinsRUNS_CODE_DIRS: owner-tier write, never an agent key's. Whether Codex applies that layer to an untrusted folder was not established; this holds either way.The agent's pull worker reads a refusal from its body (review note I2 on #4782).
_PULL_STATUS_MAPmapped a bare 403 toturn_refused; item 3 reads a refusal from the typed body only, as the push and/chatpaths now do. The 403 entry is gone, so a bare 403 there isagent_error, as in the async callback's map.A
CLAUDE.mdinside a skill folder is instructions as well as skills (review note I1). Kept as built (the any-depth rule; Claude Code loads it when a turn works in that folder) and pinned by a test row, so writing one takesinstructions.manageas well asskills.manage.Gating
OSS-core: a fix of code that already shipped publicly (the path policy, the pull worker). No private module is edited and the submodule pointer does not move.
Changes
src/backend/services/file_path_policy.py,docker/base-image/agent_server/file_path_policy.py,docker/base-image/hooks/file_path_policy.py.services/pull_worker.py.test_ent978_typed_refusals_and_owner_names.py,test_ent164_self_change_grants.py,test_ent820_files_tier_census.py.feature-flows/file-browser.md,requirements/auth.md,user-docs/agents/agent-files.md, and the/cso --diffreportdocs/security-reports/cso-diff-2026-11-26-978-typed-refusals-and-owner-names.{md,json}.No migration. No change under
src/frontend/orsrc/mcp-server/.docker/base-image/changes: agents pick up the hook copy and the pull worker when recreated on the new image; the backend copy of the policy (the Files routes) applies at once.Test plan
.codex(nested and top level, share and key tiers, folder delete, the census row, the grants rows), 2 for the pull worker's bare and untyped 403 (the typed 403 control stayed green).CLAUDE.mdrow red; file restored byte-identical.devat85dd5d143): the item, grants, census, parity, pull-worker and bug: exception text in HTTPException detail across backend and agent-server routes (py/stack-trace-exposure siblings CodeQL does not flag) #4284 suites, 706 passed.test_ent926_turn_tier_hook.pycannot run on macOS (the hook'sresolve()maps/homeelsewhere); re-run withresolvelexical, 172 of 173 pass, the one left being the symlink case that needsrealpath. CI is the judge.Part of abilityai/trinity-enterprise#978
🤖 Generated with Claude Code