CLI and MCP server for Pretorin Compliance API
Project description
Compliance tools for developers. Integrate with AI agents or your CI pipeline.
Beta — Pretorin is currently in closed beta. Framework/control browsing works for everyone. Platform write features (evidence, narratives, monitoring) require a beta code. Sign up for early access.
Pretorin CLI gives developers and AI agents direct access to compliance data, implementation context, and evidence workflows.
Two Usage Modes
- Pretorin-hosted model mode: run
pretorin agent runand route model calls through Pretorin/v1endpoints. - Bring-your-own-agent mode: run
pretorin mcp-serveand connect the MCP server to your existing AI tool (Claude Code, Codex CLI, Cursor, etc.).
Quick Start
uv tool install pretorin
pretorin login
Run the walkthrough:
bash scripts/demo-walkthrough.sh
Hosted Model Workflow (Recommended)
Use this flow when you want pretorin agent run to go through Pretorin-hosted model endpoints.
- Authenticate with your Pretorin API key:
pretorin login
- Optional: point model traffic to a custom/self-hosted Pretorin endpoint:
pretorin config set model_api_base_url https://platform.pretorin.com/v1
- Verify runtime setup:
pretorin agent doctor
pretorin agent install
- Run an agent task:
pretorin agent run "Assess AC-2 implementation gaps for my system"
Key behavior:
- Preferred setup is
pretorin loginwith no shell-levelOPENAI_API_KEYoverride. - Model key precedence is:
OPENAI_API_KEY->config.api_key->config.openai_api_key. - If
OPENAI_API_KEYis set in your shell, it overrides stored login credentials.
Add to Your AI Tool
Use this flow when you already have an AI agent/tool and want Pretorin as an MCP capability provider.
1. Claude Code
claude mcp add --transport stdio pretorin -- pretorin mcp-serve
Team setup via .mcp.json:
{
"mcpServers": {
"pretorin": {
"type": "stdio",
"command": "pretorin",
"args": ["mcp-serve"]
}
}
}
2. Codex CLI
Add to ~/.codex/config.toml:
[mcp_servers.pretorin]
command = "pretorin"
args = ["mcp-serve"]
For Claude Desktop, Cursor, and Windsurf setup, see docs/MCP.md.
Core Commands
| Command | Purpose |
|---|---|
pretorin frameworks list |
List available frameworks |
pretorin frameworks control <framework> <control> |
Get control details and guidance |
pretorin context set |
Set active system/framework context |
pretorin evidence create |
Create local evidence file |
pretorin evidence push |
Push local evidence to Pretorin |
pretorin evidence search |
Search platform evidence |
pretorin evidence upsert <ctrl> <fw> |
Find-or-create evidence and link it |
pretorin narrative get <ctrl> <fw> |
Get current control narrative |
pretorin narrative push <ctrl> <fw> <sys> <file> |
Push a narrative file |
pretorin notes list <ctrl> <fw> |
List control notes |
pretorin notes add <ctrl> <fw> --content ... |
Add control note |
pretorin monitoring push |
Push a monitoring event |
pretorin agent run "<task>" |
Run Codex-powered compliance task |
pretorin review run --control-id <id> --path <dir> |
Review local code for control coverage |
pretorin mcp-serve |
Start MCP server |
Artifact Authoring Rules
- Narrative and evidence markdown must be human-readable for auditors: no markdown headings, use lists/tables/code blocks/links.
- Markdown image embeds are temporarily disabled until platform-side file upload support is available.
Configuration
Credentials are stored at ~/.pretorin/config.json.
| Variable | Description |
|---|---|
PRETORIN_API_KEY |
API key for platform access (overrides stored config) |
PRETORIN_PLATFORM_API_BASE_URL |
Platform REST API base URL (/api/v1/public) |
PRETORIN_API_BASE_URL |
Backward-compatible alias for PRETORIN_PLATFORM_API_BASE_URL |
PRETORIN_MODEL_API_BASE_URL |
Model API base URL used by agent/harness flows (default: https://platform.pretorin.com/v1) |
OPENAI_API_KEY |
Optional model key override for agent runtime |
Documentation
- CLI reference: docs/CLI.md
- MCP integration guide: docs/MCP.md
- Contributing: CONTRIBUTING.md
Development
git clone https://github.com/pretorin-ai/pretorin-cli.git
cd pretorin-cli
uv pip install -e ".[dev]"
pytest
ruff check src/pretorin
ruff format --check src/pretorin
License
MIT License. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pretorin-0.6.0.tar.gz.
File metadata
- Download URL: pretorin-0.6.0.tar.gz
- Upload date:
- Size: 461.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc5e600e98d754972bd9ae80461ae06fae68c188806a41f3d014e4155bfbd8b6
|
|
| MD5 |
5580de2eb7cbebf9ec25a15b70f3793e
|
|
| BLAKE2b-256 |
57a9b4cc79768d3f621af401241a70ea5f470141b838934b0cf593643aadb9ed
|
Provenance
The following attestation bundles were made for pretorin-0.6.0.tar.gz:
Publisher:
publish.yml on pretorin-ai/pretorin-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pretorin-0.6.0.tar.gz -
Subject digest:
bc5e600e98d754972bd9ae80461ae06fae68c188806a41f3d014e4155bfbd8b6 - Sigstore transparency entry: 1045663468
- Sigstore integration time:
-
Permalink:
pretorin-ai/pretorin-cli@63150cf36143540d137bbe677fb55bdbf82ee1f0 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/pretorin-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@63150cf36143540d137bbe677fb55bdbf82ee1f0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pretorin-0.6.0-py3-none-any.whl.
File metadata
- Download URL: pretorin-0.6.0-py3-none-any.whl
- Upload date:
- Size: 91.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c435ae287443a95511a6bf717336de3920cd3a0863c6af47caea8b3e3013d199
|
|
| MD5 |
aeae591126d86dbbe1b665002796a3f5
|
|
| BLAKE2b-256 |
5434a570a0bc3a1ecb276a1a879fd522e2b6fbe8377654db0b7893b215dd7dc9
|
Provenance
The following attestation bundles were made for pretorin-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on pretorin-ai/pretorin-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pretorin-0.6.0-py3-none-any.whl -
Subject digest:
c435ae287443a95511a6bf717336de3920cd3a0863c6af47caea8b3e3013d199 - Sigstore transparency entry: 1045663537
- Sigstore integration time:
-
Permalink:
pretorin-ai/pretorin-cli@63150cf36143540d137bbe677fb55bdbf82ee1f0 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/pretorin-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@63150cf36143540d137bbe677fb55bdbf82ee1f0 -
Trigger Event:
release
-
Statement type: