conduct-cli 0.8.2__tar.gz → 0.8.4__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.8.2 → conduct_cli-0.8.4}/PKG-INFO +1 -1
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/pyproject.toml +2 -2
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/guard.py +5 -18
- conduct_cli-0.8.4/src/conduct_cli/guard_policy.md +16 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli.egg-info/SOURCES.txt +1 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/README.md +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/setup.cfg +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/setup.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/hooks/__init__.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/hooks/base.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/hooks/posttooluse.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/hooks/precompact.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/hooks/pretooluse.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/hooks/session_parser.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/hooks/session_report_push.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/hooks/session_start.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/hooks/stop.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/log_util.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/main.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/mcp_server.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/memory.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/paxel.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli/tool_groups.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/src/conduct_cli.egg-info/top_level.txt +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_advisory_and_hook.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_api_client.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_bash_operator_signature.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_blast_radius.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_cmd_run.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_command_word_matcher.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_drain_daemon_health.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_guard_policy.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_guard_savings.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_hook_dispatch.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_instruction_files.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_journal_drain.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_log_util.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_proxy_coverage.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_proxy_env.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_signed_policy.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_switch.py +0 -0
- {conduct_cli-0.8.2 → conduct_cli-0.8.4}/tests/test_token_lifecycle.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "conduct-cli"
|
|
7
|
-
version = "0.8.
|
|
7
|
+
version = "0.8.4"
|
|
8
8
|
description = "CLI for Conduct AI — secure, govern, install agents, manage projects, run tests"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -44,4 +44,4 @@ where = ["src"]
|
|
|
44
44
|
include = ["conduct_cli*"]
|
|
45
45
|
|
|
46
46
|
[tool.setuptools.package-data]
|
|
47
|
-
conduct_cli = ["paxel.py"]
|
|
47
|
+
conduct_cli = ["paxel.py", "guard_policy.md"]
|
|
@@ -481,7 +481,6 @@ def _patch_copilot_mcp(agent_token: str, api_url: str) -> None:
|
|
|
481
481
|
"type": "http",
|
|
482
482
|
"url": f"{api_url}/guard/mcp",
|
|
483
483
|
"headers": {"Authorization": f"Bearer {agent_token}"},
|
|
484
|
-
"tools": ["**"],
|
|
485
484
|
}
|
|
486
485
|
booster_entry = {"command": "booster", "args": ["serve"]} if shutil.which("booster") else None
|
|
487
486
|
|
|
@@ -522,21 +521,7 @@ def _write_mcp_file(
|
|
|
522
521
|
cfg_path.write_text(json.dumps(cfg, indent=2))
|
|
523
522
|
|
|
524
523
|
|
|
525
|
-
_GUARD_RULES_TEXT = (
|
|
526
|
-
"## ConductGuard — AI Governance Policy\n\n"
|
|
527
|
-
"A ConductGuard MCP server is connected to this session (server name: `conduct-guard`).\n"
|
|
528
|
-
"All Guard policies are enforced through it. You MUST follow these rules:\n\n"
|
|
529
|
-
"Before executing any shell command, file write, network request, API call, or code change:\n"
|
|
530
|
-
"1. Call the `guard_check` tool from the `conduct-guard` MCP server with the action and parameters.\n"
|
|
531
|
-
"2. If the response is BLOCKED: stop immediately and explain the policy rule to the user. Do not proceed.\n"
|
|
532
|
-
"3. If the response is WARNING: proceed but surface the warning message to the user.\n"
|
|
533
|
-
"4. If the response is ALLOWED: proceed normally.\n\n"
|
|
534
|
-
"Always-on rules (no guard_check needed, enforce unconditionally):\n"
|
|
535
|
-
"- Never write credentials, API keys, tokens, or secrets to any file or output.\n"
|
|
536
|
-
"- Never send PII (emails, names, payment data) to external endpoints.\n\n"
|
|
537
|
-
"Use `guard_status` (conduct-guard MCP) to show the user their current policy and team info.\n"
|
|
538
|
-
"Use `guard_activity` at the start of every session with a one-line summary of what you are doing."
|
|
539
|
-
)
|
|
524
|
+
_GUARD_RULES_TEXT = (Path(__file__).parent / "guard_policy.md").read_text().rstrip()
|
|
540
525
|
|
|
541
526
|
|
|
542
527
|
def _patch_cursor_global_rules() -> None:
|
|
@@ -609,14 +594,16 @@ def _patch_tool_instruction_files(agent_token: str, api_url: str, dry_run: bool
|
|
|
609
594
|
(repo_root / ".cursorrules" if repo_root else None, Path.home() / ".cursor" / "rules" / "conduct.md", ".cursorrules"),
|
|
610
595
|
(repo_root / ".windsurfrules" if repo_root else None, Path.home() / ".windsurf"/ "rules" / "conduct.md", ".windsurfrules"),
|
|
611
596
|
]
|
|
612
|
-
|
|
597
|
+
# Tolerate legacy marker variants (e.g. ", do not edit this block") so re-sync
|
|
598
|
+
# replaces old blocks in place instead of appending a second one.
|
|
599
|
+
pattern = _re.compile(r"<!-- ConductGuard[^\n]*-->.*?<!-- /ConductGuard -->", _re.DOTALL)
|
|
613
600
|
|
|
614
601
|
for repo_path, global_path, label in targets:
|
|
615
602
|
path = repo_path if (repo_path and repo_path.exists()) else global_path
|
|
616
603
|
if not path.exists() and repo_path:
|
|
617
604
|
path = repo_path
|
|
618
605
|
existing = path.read_text() if path.exists() else ""
|
|
619
|
-
if
|
|
606
|
+
if pattern.search(existing):
|
|
620
607
|
updated = pattern.sub(guard_block, existing)
|
|
621
608
|
if dry_run:
|
|
622
609
|
if updated == existing:
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
At the start of every conversation:
|
|
2
|
+
- Call `guard_activity` once with a one-line summary of the user's request.
|
|
3
|
+
|
|
4
|
+
Before every shell command, file write, network request, API call, or code change:
|
|
5
|
+
- Call `guard_check` with the proposed action and parameters.
|
|
6
|
+
- If BLOCKED: stop and explain the policy rule.
|
|
7
|
+
- If WARNING: proceed and surface the warning.
|
|
8
|
+
- If ALLOWED: proceed normally.
|
|
9
|
+
|
|
10
|
+
Example:
|
|
11
|
+
1. User asks to fix a bug → call `guard_activity` once.
|
|
12
|
+
2. Before reading files or running tests → call `guard_check`.
|
|
13
|
+
3. Before editing code → call `guard_check` again.
|
|
14
|
+
|
|
15
|
+
Never write secrets to files or output.
|
|
16
|
+
Never send PII to external endpoints.
|
|
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
|
|
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
|