You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Trust a directory subtree instead of a single path? #3078
Trust was introduced in #2924 to address #2923. Decisions are stored per exact directory in trust.json and are non-recursive: every project needs its own entry, either through the language server prompt or phpactor config:trust.
Problem
In a workspace containing several projects (~/Projets/professionnel/*), every project prompts once, and every new clone prompts again. config:trust only ever targets the current project, so there is no way to express "this whole workspace is mine".
Question
Is the per-path model intentional for security reasons, or would an explicit subtree grant be acceptable?
Something like:
phpactor config:trust --trust --subtree # this directory and everything below it
storing a visible marker in trust.json (e.g. a trailing / or /* key), with exact entries taking precedence so a nested false can revoke a subtree.
Alternatives I considered
PHPACTOR_UNCONDITIONAL_TRUST=1: works, but trusts everything in the process, including repositories outside the workspace.
A script that enumerates projects and runs config:trust for each: works today with no core change, but needs to be re-run for every new clone.
Editor-side automation: answers the prompt automatically, but bypasses the review the prompt is meant to enforce.
Note
I opened #3077 implementing wildcard globs for this. I closed it: a glob language (and "longest pattern wins" precedence) is a much bigger change than the problem warrants, and it makes the semantics of a trust decision harder to reason about. This issue is the narrower question.
No code yet — I would rather agree on the shape first. Happy to implement whichever direction you prefer, including "no, keep it per-path".
There is also the fact that Phpactor does not currently support workspace folders - I'm not sure but that may mean that ne phpactor.json can serve many workspace folders if that were implemented and so this problem would be avoided that way.
This is more about UX I concede. Not a real issue.
How often are new sub-projects introduced?
No this much as you suggest it.
What's to stop you cloning a malicious project in the workspace?
And there's nothing stopping you or anybody from this if you'll allow a wider workspace from an upper level of the folder tree. But even when you install dependencies you can be expose to supply chain attacks. Do we want to blacklist this ?
You can also disable trust altogether via. PHPACTOR_UNCONDITIONAL_TRUST.
I saw that and I found that this "all or nothing" way of managing trust is lacking of flexibility in between and so, for those reasons, I was more like opening the discussion on that topic to see what can be done.
If it's a "we won't do it" that's fine too. I mean it's still a contribution 😉.
There is also the fact that Phpactor does not currently support workspace folders - I'm not sure but that may mean that ne phpactor.json can serve many workspace folders if that were implemented and so this problem would be avoided that way.
I don't really get this but IIUC this pull could solve this issue ?
I don't really get this but IIUC this pull could solve this issue ?
that PR is just a brain dump suggesting ways that the LSP workspace feature could be implemented. But it would essentially mean supporting multiple "sub-projects" (workspace folders) in a single LSP session, although I be guess trust would still need to be established somehow and each project would have its own config
although I be guess trust would still need to be established somehow and each project would have its own config
So you mean having a phpactor.json in each workspace ?
This could ease edition and so reduce friction of "searching" for the config file and adding the trusted folder.
Having this at the root of the workspace can IMHO improve UX and so this could be enough to me.
Activity
dantleech commentedon Oct 20, 2026
How big of an issue is this? How often are new sub-projects introduced? What's to stop you cloning a malicious project in the workspace?
You can also disable trust altogether via. PHPACTOR_UNCONDITIONAL_TRUST.
There is also the fact that Phpactor does not currently support workspace folders - I'm not sure but that may mean that ne
phpactor.jsoncan serve many workspace folders if that were implemented and so this problem would be avoided that way.ktherage commentedon Oct 20, 2026
This is more about UX I concede. Not a real issue.
No this much as you suggest it.
And there's nothing stopping you or anybody from this if you'll allow a wider workspace from an upper level of the folder tree. But even when you install dependencies you can be expose to supply chain attacks. Do we want to blacklist this ?
I saw that and I found that this "all or nothing" way of managing trust is lacking of flexibility in between and so, for those reasons, I was more like opening the discussion on that topic to see what can be done.
If it's a "we won't do it" that's fine too. I mean it's still a contribution 😉.
I don't really get this but IIUC this pull could solve this issue ?
dantleech commentedon Oct 20, 2026
that PR is just a brain dump suggesting ways that the LSP workspace feature could be implemented. But it would essentially mean supporting multiple "sub-projects" (workspace folders) in a single LSP session, although I be guess trust would still need to be established somehow and each project would have its own config
ktherage commentedon Oct 21, 2026
So you mean having a
phpactor.jsonin each workspace ?This could ease edition and so reduce friction of "searching" for the config file and adding the trusted folder.
Having this at the root of the workspace can IMHO improve UX and so this could be enough to me.
dantleech commentedon Oct 21, 2026
Not necessarily - it's just a feature that's realting directly to managing multiple "workspaces" so a solution might be found in that work (or not).