conduct-cli 0.6.14__tar.gz → 0.6.15__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/PKG-INFO +1 -1
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/pyproject.toml +1 -1
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli/guard.py +43 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/README.md +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/setup.cfg +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/setup.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli/hook_precompact_template.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli/hook_session_start_template.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli/hook_stop_template.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli/hook_template.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli/log_util.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli/main.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli/mcp_server.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli/memory.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli/paxel.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/src/conduct_cli.egg-info/top_level.txt +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/tests/test_bash_operator_signature.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/tests/test_command_word_matcher.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/tests/test_guard_policy.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/tests/test_guard_savings.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/tests/test_hook_syntax.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/tests/test_journal_drain.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/tests/test_log_util.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/tests/test_proxy_env.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/tests/test_signed_policy.py +0 -0
- {conduct_cli-0.6.14 → conduct_cli-0.6.15}/tests/test_switch.py +0 -0
|
@@ -353,6 +353,9 @@ def _register_mcp(workspace_id: str, member_token: str, api_url: str) -> None:
|
|
|
353
353
|
# so all LLM calls route through the Guard proxy (PII blocking, spend limits, audit).
|
|
354
354
|
_patch_claude_desktop_proxy(api_url, member_token)
|
|
355
355
|
|
|
356
|
+
# Cursor global rules — write Guard policies as user rules so they apply across all projects.
|
|
357
|
+
_patch_cursor_global_rules()
|
|
358
|
+
|
|
356
359
|
|
|
357
360
|
def _patch_claude_desktop_proxy(api_url: str, member_token: str) -> None:
|
|
358
361
|
"""Patch Claude Desktop config to route LLM calls through the Guard proxy.
|
|
@@ -383,6 +386,46 @@ def _patch_claude_desktop_proxy(api_url: str, member_token: str) -> None:
|
|
|
383
386
|
print(f" {YELLOW}Restart Claude Desktop for proxy routing to take effect{RESET}")
|
|
384
387
|
|
|
385
388
|
|
|
389
|
+
def _patch_cursor_global_rules() -> None:
|
|
390
|
+
"""Write ConductGuard policy rules into Cursor's global user rules setting.
|
|
391
|
+
|
|
392
|
+
Cursor IDE stores global rules in settings.json under cursor.rules.user —
|
|
393
|
+
a plain text string injected as system context for every conversation.
|
|
394
|
+
This is soft enforcement (prompt-level), not structural like Claude Code hooks,
|
|
395
|
+
but ensures Guard policies are visible to the model across all Cursor projects.
|
|
396
|
+
"""
|
|
397
|
+
GUARD_RULES = (
|
|
398
|
+
"# ConductGuard — team AI policies (managed by conduct guard sync)\n"
|
|
399
|
+
"- ALWAYS call guard_check (via conductguard MCP) before running shell commands, "
|
|
400
|
+
"reading or writing files, accessing external APIs, or modifying code.\n"
|
|
401
|
+
"- NEVER write credentials, API keys, or secrets to files or output.\n"
|
|
402
|
+
"- NEVER send PII (emails, names, SSNs, payment data) to external endpoints.\n"
|
|
403
|
+
"- If guard_check returns BLOCKED: stop and explain the policy rule to the user.\n"
|
|
404
|
+
"- If guard_check returns WARNING: proceed but surface the warning.\n"
|
|
405
|
+
"- These rules are enforced by your team's ConductGuard policy. Do not bypass them."
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
candidates = [
|
|
409
|
+
Path.home() / "Library" / "Application Support" / "Cursor" / "User" / "settings.json",
|
|
410
|
+
Path.home() / ".config" / "Cursor" / "User" / "settings.json",
|
|
411
|
+
Path.home() / "AppData" / "Roaming" / "Cursor" / "User" / "settings.json",
|
|
412
|
+
]
|
|
413
|
+
for settings_path in candidates:
|
|
414
|
+
if not settings_path.exists():
|
|
415
|
+
continue
|
|
416
|
+
try:
|
|
417
|
+
cfg = json.loads(settings_path.read_text())
|
|
418
|
+
except (json.JSONDecodeError, OSError):
|
|
419
|
+
cfg = {}
|
|
420
|
+
existing = cfg.get("cursor.rules.user", "")
|
|
421
|
+
if "ConductGuard" in existing:
|
|
422
|
+
print(f" {GRAY}Cursor global rules already contain ConductGuard policy{RESET}")
|
|
423
|
+
continue
|
|
424
|
+
cfg["cursor.rules.user"] = (existing + "\n\n" + GUARD_RULES).strip()
|
|
425
|
+
settings_path.write_text(json.dumps(cfg, indent=2))
|
|
426
|
+
print(f" {GREEN}Cursor global rules updated with ConductGuard policy{RESET}")
|
|
427
|
+
|
|
428
|
+
|
|
386
429
|
def _install_codex_hook(hook_path: Path) -> None:
|
|
387
430
|
"""Register PreToolUse and PostToolUse hooks in ~/.codex/hooks.json."""
|
|
388
431
|
codex_hooks = Path.home() / ".codex" / "hooks.json"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|