docs

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-ag

Optional 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:8080

The collector listens on http://localhost:8080. Check that it answers:

curl http://localhost:8080/api/metrics

Docker

cp env.example .env
python -c "import secrets; print('ag-' + secrets.token_urlsafe(32))"   # put the key in .env
docker compose up -d

Quick 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.

VariableWhat it does
AGENTGUARD_API_KEYCollector authentication key
AGENTGUARD_DB_TYPEsqlite or postgres
DATABASE_URLConnection string when using postgres
AGENTGUARD_USE_MLEnable the local ML classifier
AGENTGUARD_MODEL_PATHPath to the ML model
AGENTGUARD_ML_THRESHOLDML decision threshold, for example 0.80
AGENTGUARD_USE_LLM_JUDGEEnable the LLM Judge for ambiguous cases
DEEPSEEK_API_KEYKey for the model the LLM Judge calls
AGENTGUARD_JUDGE_MODELJudge model name, for example deepseek-chat
AGENTGUARD_BLOCK_ON_AMBIGUOUSBlock when the judge is unsure
AGENTGUARD_RATE_LIMITRequest limit, for example 300 per minute
AGENTGUARD_SPAN_RATE_LIMITSpan ingestion limit, for example 150 per minute
AGENTGUARD_LOG_LEVELLog 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-mcp

Connect Claude Code to the hosted server

claude mcp add cerbereag --transport sse https://app.cerbereag.site/mcp/sse

Claude 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