Skip to content
Python

Merge pull request #645 from djpentz/feat/task-tool-grants

Rohit Prasad70de3a05e318
diff --cc coworker/permissions.py
index e6efe7ea,c95eade6..734f95aa
--- a/coworker/permissions.py
+++ b/coworker/permissions.py
@@@ -334,9 -271,33 +334,29 @@@ def standing_rule_candidate
if classify(tool_name, metadata, overrides) is not RiskClass.EXTERNAL:
return None
- arg = target_arg_for(tool_name)
- if arg is None:
- return None
- value = str((arguments or {}).get(arg) or "").strip()
- return value or None
+ return standing_target_for(tool_name, arguments or {})
+ def standing_tool_candidate(
+ tool_name: str,
+ metadata: Any = None,
+ overrides: Optional[RiskOverrides] = None,
+ ) -> bool:
+ """Whether this tool may earn a task-scoped standing rule with NO target binding.
+
+ Egress only. The reasoning is the strictness table itself: egress (1) ranks below
+ external (2), and an external call already earns a standing rule when it names a
+ target. Refusing the lower class outright meant a routine could be trusted forever
+ to message a chat, but never to read a web page — so a daily sweep asked the same
+ question every morning and "Always" had nothing to bind to.
+
+ Write-local and exec stay out, as they do for target-bound rules: shell asks
+ forever. External stays target-bound — the target IS the safety there, and a
+ blanket "send anything anywhere" is a different proposition entirely.
+ """
+ return classify(tool_name, metadata, overrides) is RiskClass.EGRESS
+
+
@dataclass
class PermissionEngine:
workspace_root: Path