Skip to content

Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.

fix(crsproxy): fix scrutiny round 2 blocking issues

mission-worker38882802ca5d
diff --git a/claude-ops/scripts/crsproxy-reauth/bu_profile_reauth.py b/claude-ops/scripts/crsproxy-reauth/bu_profile_reauth.py
index ac523b6d..a7ab25fc 100644
--- a/claude-ops/scripts/crsproxy-reauth/bu_profile_reauth.py
+++ b/claude-ops/scripts/crsproxy-reauth/bu_profile_reauth.py
@@ -11,7 +11,7 @@ and emits a human checkpoint if hCaptcha is detected.
Usage:
sudo -u crsproxy /opt/crsproxy/venv/bin/python /opt/crsproxy/bu_profile_reauth.py \\
- -provider claude -email [email protected] -profile-id <BU_PROFILE_ID>
+ -provider claude -email [email protected] -profile-id <BU_PROFILE_ID>
"""
import argparse
diff --git a/claude-ops/scripts/crsproxy-reauth/bu_reauth.py b/claude-ops/scripts/crsproxy-reauth/bu_reauth.py
index b279f9e4..beff3122 100644
--- a/claude-ops/scripts/crsproxy-reauth/bu_reauth.py
+++ b/claude-ops/scripts/crsproxy-reauth/bu_reauth.py
@@ -29,35 +29,35 @@ Features:
Usage:
# Full reauth for a Claude account
sudo -u crsproxy /opt/crsproxy/venv/bin/python /opt/crsproxy/bu_reauth.py \\
- -provider claude -email [email protected] -gog-account [email protected]
+ -provider claude -email [email protected] -gog-account [email protected]
# Dry run (validates setup, no browser runs)
sudo -u crsproxy /opt/crsproxy/venv/bin/python /opt/crsproxy/bu_reauth.py \\
- -provider claude -email [email protected] -dry-run
+ -provider claude -email [email protected] -dry-run
# xAI reauth
sudo -u crsproxy /opt/crsproxy/venv/bin/python /opt/crsproxy/bu_reauth.py \\
- -provider xai -email <WORK_EMAIL> -gog-account <WORK_EMAIL>
+ -provider xai -email [email protected] -gog-account [email protected]
# Codex reauth
sudo -u crsproxy /opt/crsproxy/venv/bin/python /opt/crsproxy/bu_reauth.py \\
- -provider codex -email <WORK_EMAIL> -gog-account <WORK_EMAIL>
+ -provider codex -email [email protected] -gog-account [email protected]
# Validate an existing auth file (no reauth, no browser)
sudo -u crsproxy /opt/crsproxy/venv/bin/python /opt/crsproxy/bu_reauth.py \\
- -provider claude -email [email protected] -validate-only
+ -provider claude -email [email protected] -validate-only
# Validate and activate if valid
sudo -u crsproxy /opt/crsproxy/venv/bin/python /opt/crsproxy/bu_reauth.py \\
- -provider claude -email [email protected] -validate-only -activate
+ -provider claude -email [email protected] -validate-only -activate
# Validate metadata only (skip canary request)
sudo -u crsproxy /opt/crsproxy/venv/bin/python /opt/crsproxy/bu_reauth.py \\
- -provider claude -email [email protected] -validate-only -skip-canary
+ -provider claude -email [email protected] -validate-only -skip-canary
# Resume from a hCaptcha checkpoint (after Sam solved the captcha)
sudo -u crsproxy /opt/crsproxy/venv/bin/python /opt/crsproxy/bu_reauth.py \\
- -provider claude -email [email protected] -checkpoint-resume
+ -provider claude -email [email protected] -checkpoint-resume
# When hCaptcha is detected, the script emits the live_view_url and waits.
# After solving the captcha in the browser, create the trigger file:
@@ -903,10 +903,11 @@ def detect_captcha(run_result: dict, client: BrowserUseClient) -> bool:
result_raw = str(run_result.get("result", "") or "")
result_text = result_raw.lower()
# Browser Use tasks report exact 'CAPTCHA' (uppercase) as a sentinel
- # when they encounter a real captcha challenge. Use a word-boundary
- # regex on the original (non-lowercased) text so that 'captcha' in
- # sentences like "No captcha needed" does NOT trigger a false positive.
- if re.search(r'\bCAPTCHA\b', result_raw):
+ # when they encounter a real captcha challenge. Use EXACT whole-result
+ # matching (after stripping whitespace) so that phrases like
+ # "No CAPTCHA needed" do NOT trigger a false positive. A word-boundary
+ # regex would still match "CAPTCHA" inside "No CAPTCHA needed".
+ if result_raw.strip() == "CAPTCHA":
return True
# "captcha" in a sentence is not enough — look for specific indicators
captcha_indicators = [
diff --git a/claude-ops/scripts/crsproxy-reauth/test_checkpoint.py b/claude-ops/scripts/crsproxy-reauth/test_checkpoint.py
index 7062aca6..ebd92ce0 100644
--- a/claude-ops/scripts/crsproxy-reauth/test_checkpoint.py
+++ b/claude-ops/scripts/crsproxy-reauth/test_checkpoint.py
@@ -37,8 +37,8 @@ def test_sanitize_url():
def test_safe_email():
"""safe_email redacts the local part of an email."""
- result = bu_reauth.safe_email("[email protected]")
- assert result == "i***@auroracapital.nl", f"Expected redacted email, got {result}"
+ result = bu_reauth.safe_email("[email protected]")
+ assert result == "u***@example.com", f"Expected redacted email, got {result}"
result = bu_reauth.safe_email("[email protected]")
assert result == "***@b.com", f"Expected redacted email, got {result}"
print("PASS: safe_email redacts the local part of an email")
@@ -80,9 +80,11 @@ def test_detect_captcha_exact_sentinel():
"""detect_captcha returns True for exact 'CAPTCHA' sentinel (uppercase).
Browser Use tasks report 'CAPTCHA' (uppercase) as a sentinel when they
- encounter a real captcha challenge. This must be detected via word-boundary
- matching on the original (non-lowercased) text, while lowercase 'captcha'
- in a sentence must NOT trigger a false positive.
+ encounter a real captcha challenge. This must be detected via EXACT
+ whole-result matching (after stripping whitespace), while 'CAPTCHA'
+ appearing inside a longer phrase like "No CAPTCHA needed" must NOT
+ trigger a false positive. Lowercase phrase indicators (e.g.
+ "captcha challenge") remain a secondary check.
"""
client = MagicMock()
client.get_run_events.return_value = []
@@ -91,17 +93,29 @@ def test_detect_captcha_exact_sentinel():
result = bu_reauth.detect_captcha({"result": "CAPTCHA"}, client)
assert result is True, "Expected True for exact 'CAPTCHA' sentinel"
- # 'CAPTCHA' within a sentence — still detected (word boundary match)
+ # Exact 'CAPTCHA' with surrounding whitespace — must be detected
+ result = bu_reauth.detect_captcha({"result": " CAPTCHA "}, client)
+ assert result is True, "Expected True for whitespace-padded 'CAPTCHA'"
+
+ # 'CAPTCHA' within a sentence is NOT an exact match, but "captcha
+ # challenge" is a lowercase phrase indicator so it is still detected.
result = bu_reauth.detect_captcha(
{"result": "I encountered a CAPTCHA challenge on the page"}, client)
- assert result is True, "Expected True for 'CAPTCHA' in text"
+ assert result is True, "Expected True for 'captcha challenge' indicator"
+
+ # Regression: "No CAPTCHA needed" must NOT trigger (false positive).
+ # The exact-match check rejects it (whole result != "CAPTCHA") and no
+ # lowercase phrase indicator matches "no captcha needed".
+ result = bu_reauth.detect_captcha(
+ {"result": "No CAPTCHA needed"}, client)
+ assert result is False, "Expected False for 'No CAPTCHA needed'"
# Negative: lowercase 'captcha' in a sentence must NOT match
result = bu_reauth.detect_captcha(
{"result": "The page loaded successfully. No captcha needed."},
client)
assert result is False, "Expected False for lowercase 'captcha' in sentence"
- print("PASS: detect_captcha exact 'CAPTCHA' sentinel works with word boundary")
+ print("PASS: detect_captcha exact 'CAPTCHA' sentinel works with exact match")
def test_checkpoint_file_write_read():
diff --git a/scripts/crsproxy-reauth/aurora_reauth_direct.py b/scripts/crsproxy-reauth/aurora_reauth_direct.py
index c4a44553..5d089fe4 100644
--- a/scripts/crsproxy-reauth/aurora_reauth_direct.py
+++ b/scripts/crsproxy-reauth/aurora_reauth_direct.py
@@ -50,9 +50,9 @@ from bu_reauth import (
from bu_reauth import poll_gmail_for_code
PROVIDER = "claude"
-PROFILE_ID = "8774a731-f0e0-4506-971a-885a00f7dabc"
-GOG_ACCOUNT = os.environ.get("GMAIL_TARGET_INBOX", "<PERSONAL_EMAIL>")
+EMAIL = os.environ.get("REAUTH_EMAIL", "[email protected]")
+PROFILE_ID = os.environ.get("BU_PROFILE_ID", "<BU_PROFILE_ID>")
+GOG_ACCOUNT = os.environ.get("GMAIL_TARGET_INBOX", "[email protected]")
PORT = 54545
# JS to intercept the callback URL - uses multiple methods
diff --git a/scripts/crsproxy-reauth/bu_profile_reauth.py b/scripts/crsproxy-reauth/bu_profile_reauth.py
index 56e4a454..1f8743b6 100644
--- a/scripts/crsproxy-reauth/bu_profile_reauth.py
+++ b/scripts/crsproxy-reauth/bu_profile_reauth.py
@@ -11,7 +11,7 @@ and emits a human checkpoint if hCaptcha is detected.
Usage:
sudo -u crsproxy /opt/crsproxy/venv/bin/python /opt/crsproxy/bu_profile_reauth.py \\
- -provider claude -email [email protected] -profile-id <BU_PROFILE_ID>
+ -provider claude -email [email protected] -profile-id <BU_PROFILE_ID>
"""
import argparse