fix(file-safety): extend cross-profile guard to cover top-level profile state files#35902
Open
uzunkuyruk wants to merge 2 commits into
Open
fix(file-safety): extend cross-profile guard to cover top-level profile state files#35902uzunkuyruk wants to merge 2 commits into
uzunkuyruk wants to merge 2 commits into
Conversation
Contributor
|
One issue that looks worth fixing before merge.
Original code (on main): if parts[0] in PROFILE_SCOPED_AREAS:
target_profile = "default"
area = parts[0]
elif parts[0] == "profiles" and len(parts) >= 3 and parts[2] in PROFILE_SCOPED_AREAS:
target_profile = parts[1]
area = parts[2]
else:
return None # ← catch-all for unrecognized pathsAfter this PR: if parts[0] in PROFILE_SCOPED_AREAS:
...
elif parts[0] == "profiles" and ...:
...
elif parts[0] in PROFILE_STATE_FILES: # new
...
elif parts[0] == "profiles" and ...: # new
...
# ← no else — falls throughIf Suggested fix: add |
…le state files (SOUL.md, config.yaml, .env, auth.json)
5 tasks
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.
What does this PR do?
classify_cross_profile_targetguarded profile-scoped directories (skills,plugins,cron,memories) but not top-level profile state files (SOUL.md,config.yaml,.env,auth.json).This meant an agent running under one profile could silently write to another profile's
SOUL.mdorconfig.yamlwithout triggering the cross-profile warning — the exact failure mode reported in #32049 (Docker sandbox mirror writes).Fix:
PROFILE_STATE_FILES = ("SOUL.md", "config.yaml", ".env", "auth.json")constantclassify_cross_profile_targetto detect cross-profile writes targeting these files at both<root>/SOUL.md(default profile) and<root>/profiles/<name>/SOUL.md(named profile) pathsType of Change
References
Fixes #32049
Checklist