Skip to content
Python

fix: gate github_clone and github_pull behind approval

Shakti Prasad Mohapatraeef28607e3e3
diff --git a/coworker/connectors/tool_defs.py b/coworker/connectors/tool_defs.py
index d8b365eb..d2fe7842 100644
--- a/coworker/connectors/tool_defs.py
+++ b/coworker/connectors/tool_defs.py
@@ -144,14 +144,14 @@ TOOL_DEFS: tuple[ConnectorToolDef, ...] = (
"github",
"github_clone",
"Clone a repo",
- "read",
+ "write",
"Clone a repository into a session folder to explore the code.",
),
ConnectorToolDef(
"github",
"github_pull",
"Update a clone",
- "read",
+ "write",
"Fast-forward an existing clone to the latest commits.",
),
ConnectorToolDef(
diff --git a/tests/test_send_target_resolution.py b/tests/test_send_target_resolution.py
index 645f27a0..d8e6af55 100644
--- a/tests/test_send_target_resolution.py
+++ b/tests/test_send_target_resolution.py
@@ -36,6 +36,10 @@ def test_integration_tools_reads_are_free_writes_gate(tmp_path):
assert (
tools["github_create_issue"].__aisuite_tool_metadata__.requires_approval is True
)
+ # github_clone and github_pull write to disk (clone creates a directory, pull
+ # fast-forwards an existing repo), so they must gate despite being GitHub tools.
+ assert tools["github_clone"].__aisuite_tool_metadata__.requires_approval is True
+ assert tools["github_pull"].__aisuite_tool_metadata__.requires_approval is True
def test_browser_automation_reads_are_free_interactions_gate():