Skip to main content

conduct-cli

Official CLI for Conduct AI — install AI agents, manage projects, run end-to-end tests, and enforce team AI policies with ConductGuard.

Runs on Linux, macOS, and Windows. Python 3.9–3.12.

Conduct CLI demo — whoami, switch workspaces with Guard policy sync, and run an agent

Install

pip install conduct-cli

Quick start

# Authenticate (one-time)
conduct login \
  --server https://api.conductai.ai \
  --token cond_agt_xxx \
  --workspace <workspace-id>

# Browse available agents
conduct playbooks

# Create a project and install all agents in one shot
conduct install-all --project DevOps --repo owner/repo

# List installed agents
conduct agents

# Run a test trigger on any agent
conduct test "PR Reviewer"
conduct test --all

Commands

Command Description
conduct login Save connection config to ~/.conduct/config.json
conduct projects List all projects
conduct create project <name> Create a project
conduct delete project <name> Delete a project and all its agents
conduct reset project <name> Delete all agents in a project (clean slate)
conduct playbooks Browse available playbooks
conduct playbooks <slug> Show required inputs for a playbook
conduct install <slug> Install one agent from a playbook
conduct install-all Install all 12 playbooks into a project
conduct agents List all installed agents
conduct test <name> Fire test trigger on an agent and stream results
conduct test --all Test every playbook-based agent

Authentication

Generate an agent token from Settings → Agents → Issue token in the Conduct AI dashboard. Tokens start with cond_agt_ and are stored as SHA-256 hashes — the plaintext is shown only once.

conduct login --server https://api.conductai.ai --token cond_agt_xxx --workspace <id>

Install all agents

# Installs all 12 playbooks into a project, pointed at your GitHub repo
conduct install-all --project DevOps --repo myorg/myrepo

If the project doesn't exist it's created automatically. Use --input key=value to override any playbook input.

Test agents

# Test a single agent (fires synthetic test payload, streams run events)
conduct test "Autopilot Quick"

# Test all playbook-based agents in sequence
conduct test --all

Exit code is 0 if all pass, 1 if any fail — works in CI.


ConductGuard

ConductGuard is AI tool fleet management — your security team sets policies once and they're enforced automatically across every developer's Claude Code, Cursor, and Windsurf session.

How it works

Admin configures policies and budgets in the Guard dashboard
    └─ developers are workspace members automatically — no invite step needed

Developer runs: conduct guard sync
    ├─ pulls latest policy to ~/.conduct/policy.json
    ├─ writes PreToolUse hook → ~/.conduct/hook.py
    ├─ registers hook → ~/.claude/settings.json
    └─ registers conductguard-mcp → ~/.claude/settings.json (mcpServers) + Codex

Every Claude Code tool call:
    ├─ PreToolUse hook fires (hook.py) → checks policy → block / warn / audit
    └─ Event posted async to ConductGuard API → visible in Activity feed

Developer setup

pip install conduct-cli

# Authenticate (already done if you use Conduct)
conduct login --server https://api.conductai.ai --api-key <api-key>

# Sync Guard — installs hook + MCP, pulls policies
conduct guard sync

That's it. Policy enforcement is active from the next tool call.

Guard commands

Command Description
conduct guard sync Pull latest policy, write hook to ~/.conduct/hook.py, register hook + MCP
conduct guard status Show today's spend, session count, and violations
conduct guard audit [--since 7d] Print recent guard events in a table
conduct verify [--evidence FILE] [--strict] [--format json] Map guard events to OWASP Agentic Top 10; exit 1 in CI if blocked events (--strict)
conduct guard discover Scan local environment for AI agents; report Guard coverage %
conduct guard discover --register Register discovered agents under Guard

Advisory mode

When advisory mode is enabled by your security admin, all policy violations are logged as "audited" instead of blocked — the developer sees a note but the tool call proceeds. The hook still posts every event to the audit log.

To check if advisory mode is active:

conduct guard sync   # shows "· advisory" badge if active
conduct guard status

conduct verify

# Map last 24h of guard events to OWASP Agentic Top 10
conduct verify

# Use a saved evidence file
conduct verify --evidence ./conduct-evidence.json

# CI mode — exit 1 if any blocked events
conduct verify --strict

# JSON output for downstream tooling
conduct verify --format json

OWASP mapping: no-rm-rf → A04 Excessive Agency, no-sudo → A09 Privilege Escalation, policy_signature_invalid → A07 Insufficient Monitoring, etc. All 10 categories covered.

How the PreToolUse hook works

When you run conduct guard sync, the CLI writes a Python script to ~/.conduct/hook.py and registers it as a PreToolUse hook in ~/.claude/settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": ".*",
        "hooks": [{ "type": "command", "command": "python3 ~/.conduct/hook.py" }]
      }
    ]
  }
}

Before every tool call, Claude Code runs the hook. The hook:

  1. Reads tool_name and tool_input from stdin (JSON)
  2. Loads ~/.conduct/policy.json (the team ruleset)
  3. Matches the call against each rule (match_tool, match_pattern, match_path_pattern)
  4. Takes the rule's action:
    • block — prints the policy message, exits with code 2 (Claude Code aborts the tool call)
    • warn — prints the message, exits 0 (tool call proceeds, developer is notified)
    • audit — posts an event silently, exits 0
  5. Posts an audit event to POST /guard/events asynchronously (fire-and-forget, never slows the tool call)

How conductguard-mcp works

conduct guard sync also registers an MCP server entry in ~/.claude/settings.json:

{
  "mcpServers": {
    "conductguard": {
      "command": "conductguard-mcp",
      "args": ["--team", "<team-id>", "--token", "<member-token>"]
    }
  }
}

Claude Code starts conductguard-mcp as a subprocess on launch and keeps it running. It communicates via JSON-RPC 2.0 over stdin/stdout (MCP stdio transport).

The MCP server exposes three tools that Claude can call proactively:

Tool Description
guard_status Returns team name, your email, number of active rules, and policy version
guard_check Checks whether a specific tool + input would be blocked before Claude acts
guard_sync Fetches the latest policy from the ConductGuard API and saves it locally

guard_check example — Claude can self-check before a sensitive action:

guard_check(tool_name="bash", tool_input={"command": "rm -rf /tmp/build"})
→ ALLOWED — no policy rule matches 'bash'.

guard_check(tool_name="bash", tool_input={"command": "curl http://internal-api/secrets"})
→ BLOCKED — External network calls to internal endpoints are not permitted. [rule: no-internal-curl]

guard_sync example — after your security team pushes new rules:

guard_sync()
→ Policy synced — 12 rule(s) active (version: 2026-05-31T14:22:00Z).

Policy file format

Policy is stored at ~/.conduct/policy.json and synced from the server:

{
  "team_id": "uuid",
  "version": "2026-05-31T14:22:00Z",
  "rules": [
    {
      "rule_id": "no-rm-rf",
      "match_tool": "bash",
      "match_pattern": "rm\\s+-rf",
      "match_path_pattern": null,
      "action": "block",
      "message": "Recursive deletes are not permitted. Use trash or targeted rm."
    },
    {
      "rule_id": "audit-prod-writes",
      "match_tool": "edit,write",
      "match_path_pattern": "/prod/",
      "match_pattern": null,
      "action": "warn",
      "message": "Writing to prod directory — make sure this is intentional."
    }
  ]
}

Keeping policy up to date

Run conduct guard sync after your security team updates rules in the ConductGuard dashboard. The sync command pulls the latest policy, rewrites the hook, and re-registers the MCP entry in any newly detected AI tool configs.

Sync also migrates the Codex Conduct provider to CONDUCT_GATEWAY_TOKEN, separate from provider-specific OPENAI_API_KEY overrides. The managed shell environment refreshes this credential on every sync. On macOS, sync also updates the current login session's app-launch environment for newly launched desktop apps. Run sync again after a new macOS login before opening Codex from the Dock.

Fully quit and reopen Codex after syncing. For terminal launches, open a new shell or source ~/.conduct/env first (~/.conduct/env.ps1 in PowerShell). Sync cannot change the environment of an already-running process. --no-codex-proxy leaves the Codex provider and desktop launch environment unchanged. This is client configuration, not protection against a user deliberately bypassing the Gateway.

Reported Model Usage

After upgrading the CLI, run conduct guard sync and restart Claude Code, Codex, and Copilot CLI so their hook registrations are reloaded. Upgrading the package alone does not update already-installed hooks.

Flight Recorder records available model usage in separate session_usage events, not on every Bash/Edit/Read action. Codex cumulative counters and Claude message usage are collected incrementally and deduplicated; cache and reasoning tokens are counted once. Copilot reports persisted shutdown counters, so current session tokens may remain unavailable until shutdown. Missing telemetry is not zero, and these reports are not Gateway receipts or provider invoices.

The first collection establishes a baseline rather than importing historical usage into the active workspace. Start/stop/end hooks and later tool actions recover delayed transcript writes. Unsupported or missing transcript formats remain unavailable; no token counts are inferred from tool output.

Deploy the API supporting multi-client /guard/events/session-usage reports before releasing this CLI change. Production verification requires one fresh session per client after sync; existing tool rows are not retroactively filled.

Copilot CLI

On macOS, Linux, and Windows, conduct guard sync detects the copilot executable or its configuration directory independently of the VS Code extension. It creates or updates the Conduct MCP entry and installs managed hooks at ~/.copilot/hooks/conduct-guard.json (or $COPILOT_HOME/hooks/conduct-guard.json). Other MCP servers and hook files are preserved. Restart Copilot after syncing.

Pre-tool hooks use the shared Guard policy engine; blocked calls return a Copilot deny decision. Allowed calls retain Copilot's own permission checks. Post-tool hooks record success or failure as separate audit events linked by session ID; they do not infer model token counts. This does not configure or replace the GitHub-hosted model provider, and does not imply Gateway spend coverage.

The adapter returns a deny decision if its Guard subprocess exceeds 20 seconds, before Copilot's configured 30-second hook timeout. Approval checks exceeding that bound are denied and must be retried. Copilot's outer hook timeout is itself fail-open; user hooks can also be disabled. These are not tamper-proof enterprise policy hooks. Use a current Copilot CLI release supporting user hooks and the exec/args command-hook format.

# Add to a daily cron or run manually after policy changes
conduct guard sync

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "conduct": {
      "command": "conduct-mcp",
      "args": []
    },
    "conductguard": {
      "command": "conductguard-mcp",
      "args": ["--team", "<workspace-id>", "--token", "<member-token>"]
    }
  }
}

Run conduct login first — conduct-mcp reads credentials from ~/.conduct/config.json. Get your agent token from Settings → Agents → Issue token in the Conduct AI dashboard.


VS Code + GitHub Copilot

Install from the MCP registry directly in VS Code:

code --add-mcp '{"name":"conduct","command":"conduct-mcp","args":[]}'
code --add-mcp '{"name":"conductguard","command":"conductguard-mcp","args":["--team","<workspace-id>","--token","<member-token>"]}'

Or add to .vscode/mcp.json in your repo:

{
  "servers": {
    "conduct": {
      "type": "stdio",
      "command": "conduct-mcp",
      "args": []
    },
    "conductguard": {
      "type": "stdio",
      "command": "conductguard-mcp",
      "args": ["--team", "<workspace-id>", "--token", "<member-token>"]
    }
  }
}

Once wired, GitHub Copilot can list your agents, trigger workflows, and check Guard policies — the same tools available in Claude Code and Cursor.

Prerequisites: pip install conduct-cli + conduct login


Metadata

Release files for conduct-cli 0.14.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for conduct-cli 0.14.17
File Size Uploaded
conduct_cli-0.14.17.tar.gz 242.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for conduct-cli 0.14.17
File Interpreter ABI Platform
conduct_cli-0.14.17-py3-none-any.whl Python 3 none any Details

Total release size: 436.6 kB

Release files / conduct_cli-0.14.17.tar.gz

Download URL conduct_cli-0.14.17.tar.gz
Size 242.1 kB
Tags Source
SHA-256 checksum
How to use checksums
085ed87f98799ac4dc211d80185c0eb871d39ee13cedb76ff4dffec8d74a0c62
BLAKE2b-256 checksum
How to use checksums
860dd82ad2ef48e33313b70e62da19bf92568139f3bd6f7e48858f27030ed1de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release files / conduct_cli-0.14.17-py3-none-any.whl

Download URL conduct_cli-0.14.17-py3-none-any.whl
Size 194.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
908cb2a3a71f6b11d871577c6bc6a46cc57773a87b35ac6b71ae28fcb4117cad
BLAKE2b-256 checksum
How to use checksums
ae047b95001d60392158552d2493a6076e95d52ef946171f00ee5cc2f9e03e8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.14.17 This release

2 release files

0.14.9

2 release files

0.14.8

2 release files

0.14.7

2 release files

0.14.6

2 release files

0.14.5

2 release files

0.14.4

2 release files

0.14.3

2 release files

0.14.2

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.9.16

2 release files

0.9.15

2 release files

0.9.14

2 release files

0.9.13

2 release files

0.9.12

2 release files

0.9.11

2 release files

0.9.10

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.0

2 release files

0.8.9

2 release files

0.8.8

2 release files

0.8.7

2 release files

0.8.6

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.48

2 release files

0.7.47

2 release files

0.7.46

2 release files

0.7.45

2 release files

0.7.44

2 release files

0.7.43

2 release files

0.7.42

2 release files

0.7.41

2 release files

0.7.40

2 release files

0.7.39

2 release files

0.7.38

2 release files

0.7.37

2 release files

0.7.36

2 release files

0.7.35

2 release files

0.7.34

2 release files

0.7.33

2 release files

0.7.31

2 release files

0.7.30

2 release files

0.7.29

2 release files

0.7.28

2 release files

0.7.27

2 release files

0.7.26

2 release files

0.7.25

2 release files

0.7.24

2 release files

0.7.23

2 release files

0.7.22

2 release files

0.7.21

2 release files

0.7.20

2 release files

0.7.19

2 release files

0.7.17

2 release files

0.7.16

2 release files

0.7.11

2 release files

0.7.9

2 release files

0.7.8

2 release files

0.7.7

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.28

2 release files

0.6.27

2 release files

0.6.26

2 release files

0.6.25

2 release files

0.6.24

2 release files

0.6.23

2 release files

0.6.22

2 release files

0.6.21

2 release files

0.6.20

2 release files

0.6.19

2 release files

0.6.18

2 release files

0.6.17

2 release files

0.6.16

2 release files

0.6.15

2 release files

0.6.14

2 release files

0.6.12

2 release files

0.6.11

2 release files

0.6.10

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.0

2 release files

0.4.99

2 release files

0.4.98

2 release files

0.4.97

2 release files

0.4.96

2 release files

0.4.95

2 release files

0.4.94

2 release files

0.4.93

2 release files

0.4.92

2 release files

0.4.91

2 release files

0.4.90

2 release files

0.4.89

2 release files

0.4.88

2 release files

0.4.87

2 release files

0.4.86

2 release files

0.4.85

2 release files

0.4.84

2 release files

0.4.83

2 release files

0.4.82

2 release files

0.4.81

2 release files

0.4.80

2 release files

0.4.79

2 release files

0.4.78

2 release files

0.4.77

2 release files

0.4.76

2 release files

0.4.75

2 release files

0.4.74

2 release files

0.4.73

2 release files

0.4.72

2 release files

0.4.71

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page