conduct-cli 0.4.57__tar.gz → 0.4.58__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.4.57 → conduct_cli-0.4.58}/PKG-INFO +1 -1
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/pyproject.toml +1 -1
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/src/conduct_cli/guard.py +10 -2
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/src/conduct_cli/main.py +2 -2
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/src/conduct_cli.egg-info/PKG-INFO +1 -1
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/README.md +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/setup.cfg +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/setup.py +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/src/conduct_cli/__init__.py +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/src/conduct_cli/api.py +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/src/conduct_cli/guardmcp.py +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/src/conduct_cli/mcp_server.py +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/src/conduct_cli.egg-info/entry_points.txt +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/src/conduct_cli.egg-info/requires.txt +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/src/conduct_cli.egg-info/top_level.txt +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/tests/test_guard_policy.py +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/tests/test_guard_savings.py +0 -0
- {conduct_cli-0.4.57 → conduct_cli-0.4.58}/tests/test_switch.py +0 -0
|
@@ -241,7 +241,7 @@ def _post_usage(session_id, tool_name, tokens_input, tokens_output, duration_ms)
|
|
|
241
241
|
)
|
|
242
242
|
|
|
243
243
|
|
|
244
|
-
def _maybe_emit_security_finding(tool_response, session_id, tool_name):
|
|
244
|
+
def _maybe_emit_security_finding(tool_response, session_id, tool_name, tool_input=None):
|
|
245
245
|
"""Classify tool_response for security findings; POST to /security-findings if flag ON. Never raises."""
|
|
246
246
|
try:
|
|
247
247
|
cfg = json.loads(CONFIG_PATH.read_text()) if CONFIG_PATH.exists() else {}
|
|
@@ -298,6 +298,12 @@ def _maybe_emit_security_finding(tool_response, session_id, tool_name):
|
|
|
298
298
|
if not finding_type:
|
|
299
299
|
return
|
|
300
300
|
|
|
301
|
+
ti = tool_input or {}
|
|
302
|
+
file_path = (
|
|
303
|
+
ti.get("file_path") or ti.get("path") or
|
|
304
|
+
(ti.get("command", "")[:120] if tool_name in ("bash", "terminal") else None)
|
|
305
|
+
) or None
|
|
306
|
+
|
|
301
307
|
payload = json.dumps({
|
|
302
308
|
"tool": _detect_ai_tool(),
|
|
303
309
|
"severity": severity,
|
|
@@ -305,6 +311,7 @@ def _maybe_emit_security_finding(tool_response, session_id, tool_name):
|
|
|
305
311
|
"description": description,
|
|
306
312
|
"source_run_id": session_id,
|
|
307
313
|
"reporter_email": cfg.get("user_email") or "",
|
|
314
|
+
"file": file_path,
|
|
308
315
|
})
|
|
309
316
|
script = (
|
|
310
317
|
"import urllib.request\\n"
|
|
@@ -489,7 +496,8 @@ def post_usage_main():
|
|
|
489
496
|
|
|
490
497
|
# Security classifier runs regardless of transcript_path — scan every tool response
|
|
491
498
|
tool_response = data.get("tool_response") or data.get("output") or ""
|
|
492
|
-
|
|
499
|
+
tool_input = data.get("tool_input") or {}
|
|
500
|
+
_maybe_emit_security_finding(str(tool_response), session_id, tool_name, tool_input)
|
|
493
501
|
|
|
494
502
|
sys.exit(0)
|
|
495
503
|
|
|
@@ -2217,7 +2217,7 @@ def cmd_run(args):
|
|
|
2217
2217
|
# ── conduct sync / test-guard / test-security ────────────────────────────────
|
|
2218
2218
|
|
|
2219
2219
|
def cmd_sync(args):
|
|
2220
|
-
"""
|
|
2220
|
+
"""Sync Guard policies (and Security Loop policies if installed)."""
|
|
2221
2221
|
import conduct_cli.guard as _g
|
|
2222
2222
|
print(f"\n{BOLD}▶ conduct sync{RESET}\n")
|
|
2223
2223
|
_g.cmd_guard_sync(args)
|
|
@@ -2533,7 +2533,7 @@ def main():
|
|
|
2533
2533
|
mcp_sub.add_parser("install", help="Register conduct-mcp in Claude Code and Codex")
|
|
2534
2534
|
|
|
2535
2535
|
# conduct sync
|
|
2536
|
-
sub.add_parser("sync", help="Sync Guard policies
|
|
2536
|
+
sub.add_parser("sync", help="Sync Guard policies (and Security Loop policies if installed)")
|
|
2537
2537
|
|
|
2538
2538
|
# conduct test-guard / test-security
|
|
2539
2539
|
sub.add_parser("test-guard", help="Fire a synthetic event per guard policy rule and show decisions")
|
|
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
|