Repository navigation
feat(harness): support path-scoped filesystem permissions - #3588
NewPeople-star wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
262746d to
4b2e869
Compare
|
For guarding file modifications and operations — |
|
Thanks for pointing me to #3657. I reviewed the merged interceptor implementation: it receives the final preset-merged arguments before local tool execution and supports policy denial, so applications can implement the AGENTS.md / skills/** protection motivating this PR there. I agree this is a better fit than adding another path-matching extension to the permission engine. Closing this PR in favor of that extension point. Thanks for the review! |
AgentScope-Java Version
2.1.0-SNAPSHOT
Description
Applications currently have to disable file-writing tools entirely to prevent agents from changing workspace definitions. This adds the path-scoped permission rules proposed in #3317, so an application can deny
write_file/edit_fileonAGENTS.mdorskills/**while retaining ordinary file access. No rules are installed by default.ToolRuleMatcherfor annotated tools and pass the invocation context through permission matching, while preserving existing two-argumentToolBase.matchRuleoverrides.*,?, and whole-segment**, using the execution workspace/namespace mapping. Cover UNC paths and lexical absolute-path aliases; reject unresolved parent-relative and Windows drive-relative paths when path rules apply.This is a lexical policy for named tools, not a filesystem isolation boundary. It does not protect against symlinks, case aliases, shell access, or direct application writes.
Fixes #3317
Validation
mvn -B -T1 verifywas attempted and stopped at two existing Windows symbolic-link privilege errors inDangerousPathBypassTest.mvn -B -T1 -pl agentscope-harness -am spotless:apply verify -Dmaven.test.failure.ignore=trueto collect all results: 4,457 test executions, 4,428 passed, 3 failed/errored, and 26 skipped. The remaining failure isLocalFilesystemPersonalAssistantExampleTest.localFilesystem_filesPersistAcrossCalls. All three failures were reproduced on the unchanged base commitc2ff087; the Harness failure reproduces in the full suite but passes in isolation. The ignore flag was only used to continue validation, not to treat failed tests as passing.git diff --checkpassed.Checklist
mvn spotless:applymvn test) — existing failures documented above