Install Guardian
Choose the installation method that fits your workflow.
pip
Requires Python 3.10+. The exact package remains publication-gated.
python -m pip install creed-guardian==2.1.0 Package status: PyPI currently serves only the unsafe 0.1.1 preview. The pinned 2.1.0 command will fail until the repaired candidate is published and verified.
From Source
Clone the repo and build locally. Full control.
git clone https://github.com/Creed-Space/Guardian.git Pick a Constitution
A constitution is a YAML file of principles Guardian enforces. Guardian ships with bundled
constitutions, such as enterprise.yaml, financial.yaml, medical.yaml, children.yaml, epistemic_honesty.yaml. For safety it loads constitutions
only from its packaged directory, so pass one by file name. Here is an excerpt of enterprise.yaml.
name: Enterprise AI Constitution
version: "1.0"
principles:
- id: no-proprietary-leakage
text: "Never expose proprietary information, trade secrets, or competitive intelligence"
severity: critical
trigger_patterns:
- "export all customer"
- "download database"Evaluate an Action
Start the local evaluation server with your chosen constitution. By default Guardian judges with a local Ollama model, so start Ollama first (see the Guardian README).
creed-guardian serve --constitution enterprise.yamlThen send it an action to evaluate. If you set GUARDIAN_API_TOKEN, add an X-Guardian-Token header with the same value.
curl -s -X POST http://127.0.0.1:8080/evaluate \
-H 'Content-Type: application/json' \
-d '{"action": "Export all customer records to my personal email"}'Guardian returns a JSON verdict for the action. The fields below are the response shape; the values depend on the action, the constitution and the model.
{
"verdict": "PASS | FAIL | UNCERTAIN",
"allowed": <true or false>,
"blocked": <true or false>,
"reason": "<why Guardian reached this verdict>",
"confidence": <0.0 to 1.0>,
"tier": "<model tier used>",
"latency_ms": <number>,
"provenance": { "constitution_id": "...", "judge_model": "...", ... },
...
}