Set up Cerbere AG
Cerbere AG sits between your agents and the actions they take. This page covers the install, the configuration, and the two ways to connect an agent: the Python SDK or the MCP server. Every section has a button that copies it as plain text you can paste into an LLM.
Installation
You need Python 3.11+ and pip. There are two ways in, depending on whether a collector already runs for you.
SDK only
Use this when a Cerbere collector already exists, hosted or self-hosted.
pip install cerbere-agOptional extras, installed the same way:
pip install "cerbere-ag[signing]" # verify signed policy decisions (Ed25519)
pip install "cerbere-ag[pii]" # advanced PII detection via Presidio
pip install "cerbere-ag[redis]" # distributed rate limiting / LLM Judge cache
pip install "cerbere-ag[ml]" # local ML classifier (torch + transformers)Self-hosted collector
git clone https://github.com/chrismsmr-celcom/agentguard.git
cd agentguard
pip install -r requirements.txt
gunicorn wsgi:app --bind 0.0.0.0:8080The collector listens on http://localhost:8080. Check that it answers:
curl http://localhost:8080/api/metricsDocker
cp env.example .env
python -c "import secrets; print('ag-' + secrets.token_urlsafe(32))" # put the key in .env
docker compose up -dQuick start
Create the client once, then wrap your LLM calls and tool calls with decorators. Cerbere checks each call before it runs and records the decision.
from agentguard import AgentGuard
guard = AgentGuard(
collector_url="http://localhost:8080",
api_key="ag-your-key",
agent_id="my-agent",
max_budget=10.0,
block_on_high=True,
use_ml=True,
use_llm_judge=True,
)Protect an LLM call
@guard.guard_llm_call
def call_openai(messages):
return client.chat.completions.create(
model="gpt-4o",
messages=messages,
)Protect a tool call
@guard.guard_tool_call
def send_email(to, subject, body):
return email_service.send(to, subject, body)Configuration
The collector reads its settings from environment variables. These are the ones you will use most.
| Variable | What it does |
|---|---|
| AGENTGUARD_API_KEY | Collector authentication key |
| AGENTGUARD_DB_TYPE | sqlite or postgres |
| DATABASE_URL | Connection string when using postgres |
| AGENTGUARD_USE_ML | Enable the local ML classifier |
| AGENTGUARD_MODEL_PATH | Path to the ML model |
| AGENTGUARD_ML_THRESHOLD | ML decision threshold, for example 0.80 |
| AGENTGUARD_USE_LLM_JUDGE | Enable the LLM Judge for ambiguous cases |
| DEEPSEEK_API_KEY | Key for the model the LLM Judge calls |
| AGENTGUARD_JUDGE_MODEL | Judge model name, for example deepseek-chat |
| AGENTGUARD_BLOCK_ON_AMBIGUOUS | Block when the judge is unsure |
| AGENTGUARD_RATE_LIMIT | Request limit, for example 300 per minute |
| AGENTGUARD_SPAN_RATE_LIMIT | Span ingestion limit, for example 150 per minute |
| AGENTGUARD_LOG_LEVEL | Log verbosity, for example INFO |
MCP server
If your agent runs on a client that supports the Model Context Protocol (Claude, Cursor and others), use the MCP server instead of wiring the SDK by hand.
pip install cerbere-ag-mcpConnect Claude Code to the hosted server
claude mcp add cerbereag --transport sse https://app.cerbereag.site/mcp/sseClaude Desktop and Cursor configuration snippets, plus the list of exposed tools, are in README_MCP.md.
Dashboard
The collector serves a dashboard with agent traces, policy decisions, the human approval queue and daily activity. Self-hosted, open your collector URL. For the hosted version, sign in at app.cerbereag.site.
Support and source
- Source code for the SDK and collector: github.com/chrismsmr-celcom/agentguard
- Report a bug or ask a question by opening an issue on that repository.
