Skip to content
Python

Merge pull request #680 from andrewyng/issue/ope-196-headless-run

Rohit Prasadc54597913f9c
diff --cc coworker/permissions.py
index 820e8941,3ff9045f..39eb24b3
--- a/coworker/permissions.py
+++ b/coworker/permissions.py
@@@ -494,29 -470,8 +535,29 @@@ class PermissionEngine
human_only=True, # deferred-execution files: a human sees every one (§ floor)
)
+ # THE ALLOWED-SITES WALL (OPE-219). Like the folder wall, no mode removes it: in
+ # Bypass a site that is not on the list is refused outright, with no card (owner
+ # ruling 2026-10-02); in the asking modes it reaches a person, never the reviewer,
+ # who may not widen the user's list. A site on the list runs without a card.
+ walled_site = ""
+ on_site_wall = False
+ if is_egress and self.sandbox_sites is not None:
+ host = self.egress_host(tool_name, arguments)
+ if host and self._site_allowed(host):
+ on_site_wall = True
+ else:
+ walled_site = host or "this site"
+ if self.mode is Mode.BYPASS_APPROVALS:
+ return Decision(
+ False,
+ f"{walled_site} is not on this machine's allowed sites, so the sandbox "
+ "setting blocks it. The user can add it in Settings > Sandbox > Choose sites.",
+ needs_user=False,
+ site=walled_site,
+ )
+
# Full access.
- if self.mode is Mode.BYPASS_APPROVALS:
+ if self.mode in BYPASS_MODES:
return Decision(True, "full access")
# interactive / custom / auto-approve: allowlists.