Commit 7c72ecd
fix(agentplugins): reject unsafe and conflicting skill selections (#2505)
## Summary
- reject skill selections that are empty, traversal-like, or contain
path separators
- reject duplicate skill names across standalone skills and selected
plugin skills before fetching artifacts
- canonicalize existing and not-yet-created paths during containment
checks so macOS `/var` aliases do not reject valid packages
This keeps Agent Plugin materialization deterministic and prevents one
selected skill from overwriting another. It does not change the Agent
Plugins schema or artifact source formats.
## Testing
- `cd go && go test ./core/v2/agentplugins ./adk/pkg/mcp
./core/v2/translator`
- `cd go && go vet ./core/v2/agentplugins`
- `git diff --check`
## Risk / Notes
- The new validation runs before any artifact is fetched or copied.
- Existing plugin and MCP behavior is unchanged for valid selections.
- The canonical-path handling preserves the existing symlink escape
checks while making containment portable across macOS
temporary-directory aliases.
Signed-off-by: Whxuan0701 <102815982+Whxuan0701@users.noreply.github.com>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Co-authored-by: Whxuan0701 <102815982+Whxuan0701@users.noreply.github.com>
Co-authored-by: Eitan Yarmush <eitan.yarmush@solo.io>1 parent 89123fb commit 7c72ecd
2 files changed
Lines changed: 79 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
71 | 82 | | |
72 | 83 | | |
73 | 84 | | |
| |||
119 | 130 | | |
120 | 131 | | |
121 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
122 | 154 | | |
123 | 155 | | |
124 | 156 | | |
| |||
241 | 273 | | |
242 | 274 | | |
243 | 275 | | |
244 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
245 | 279 | | |
246 | 280 | | |
247 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
248 | 294 | | |
249 | 295 | | |
250 | 296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
0 commit comments