io.github.Al-Adnane/kasbah-mcp

السجل الرسمي الذكاء الاصطناعي والوكلاء

Governance layer for agentic AI — signed, verifiable receipts for every agent action.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

NPM package @yobekasbah/mcp-server
Claude Code
claude mcp add kasbah-mcp -e 'KASBAH_API_KEY=<your kasbah_api_key>' -e 'KASBAH_API=https://kasbah-api.fly.dev' -- npx -y @yobekasbah/mcp-server@3.0.1
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "kasbah-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@yobekasbah/mcp-server@3.0.1"
            ],
            "env": {
                "KASBAH_API_KEY": "<your kasbah_api_key>",
                "KASBAH_API": "https://kasbah-api.fly.dev"
            }
        }
    }
}

متغيرات البيئة

  • KASBAH_API_KEY سري Kasbah API key — get a free one via POST https://kasbah-api.fly.dev/v1/auth/signup
  • KASBAH_API Kasbah gateway base URL (defaults to http://127.0.0.1:8788 for local dev)

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

Kasbah Core

Deterministic policy control for autonomous systems.

Kasbah Core is a minimal control plane that sits between AI agents and execution: it evaluates intent, enforces tool gates, and writes an append-only audit log.

This repo ships a runnable prototype for security engineers and CTOs.


Quick start (2 commands)

docker compose up --build


---

## 🔐 Minimal real API example (no demo, no UI)

This is a real Kasbah-Core runtime flow.
No simulation. No frontend. No policy-only logic.

STEP 1 — Ask Kasbah if an action is allowed

curl -s http://localhost:8002/api/rtp/decide \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer DEV_KEY" \
  -d '{
    "agent_id": "support-bot",
    "tool_name": "db.query",
    "signals": {
      "consistency": 0.95,
      "context": 0.90
    }
  }'

Example response:

{
  "decision": "ALLOW",
  "ticket": {
    "jti": "5a3bde1e887e000116e8943663b5088d",
    "expires_at": 1770307384
  }
}

STEP 2 — Execute the action using the issued ticket

curl -s http://localhost:8002/api/rtp/consume \
  -H "Content-Type: application/json" \
  -d '{
    "ticket": "5a3bde1e887e000116e8943663b5088d",
    "tool_name": "db.query",
    "usage": { "tokens": 120 }
  }'

Response:

{ "status": "ALLOWED" }

STEP 3 — Replay the same ticket (blocked by Kasbah)

curl -s http://localhost:8002/api/rtp/consume \
  -H "Content-Type: application/json" \
  -d '{
    "ticket": "5a3bde1e887e000116e8943663b5088d",
    "tool_name": "db.query"
  }'

Response:

{
  "status": "DENIED",
  "reason": "replay_detected"
}

This denial is stateful and irreversible.
Tickets are single-use, tool-bound, time-bound, and verified at runtime.


---

## 🔐 Minimal real API example (no demo, no UI)

This is a real Kasbah-Core runtime flow.
No simulation. No frontend. No policy-only logic.

STEP 1 — Ask Kasbah if an action is allowed

curl -s http://localhost:8002/api/rtp/decide \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer DEV_KEY" \
  -d '{
    "agent_id": "support-bot",
    "tool_name": "db.query",
    "signals": {
      "consistency": 0.95,
      "context": 0.90
    }
  }'

Example response:

{
  "decision": "ALLOW",
  "ticket": {
    "jti": "5a3bde1e887e000116e8943663b5088d",
    "expires_at": 1770307384
  }
}

STEP 2 — Execute the action using the issued ticket

curl -s http://localhost:8002/api/rtp/consume \
  -H "Content-Type: application/json" \
  -d '{
    "ticket": "5a3bde1e887e000116e8943663b5088d",
    "tool_name": "db.query",
    "usage": { "tokens": 120 }
  }'

Response:

{ "status": "ALLOWED" }

STEP 3 — Replay the same ticket (blocked by Kasbah)

curl -s http://localhost:8002/api/rtp/consume \
  -H "Content-Type: application/json" \
  -d '{
    "ticket": "5a3bde1e887e000116e8943663b5088d",
    "tool_name": "db.query"
  }'

Response:

{
  "status": "DENIED",
  "reason": "replay_detected"
}

This denial is stateful and irreversible.
Tickets are single-use, tool-bound, time-bound, and verified at runtime.


## Moats / Security posture
See `docs/MOATS_REGISTRY.md` for the authoritative list of implemented moats, evidence, and explicit non-goals.

الأسئلة الشائعة

ما هو io.github.Al-Adnane/kasbah-mcp؟

Governance layer for agentic AI — signed, verifiable receipts for every agent action.

كيف أثبّت io.github.Al-Adnane/kasbah-mcp؟

يعمل على جهازك. في Claude Code: claude mcp add kasbah-mcp -e 'KASBAH_API_KEY=<your kasbah_api_key>' -e 'KASBAH_API=https://kasbah-api.fly.dev' -- npx -y @yobekasbah/mcp-server@3.0.1. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج io.github.Al-Adnane/kasbah-mcp إلى مفتاح API؟

نعم. يتطلب KASBAH_API_KEY، وتضبطها في إعداداته.

هل io.github.Al-Adnane/kasbah-mcp مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون io.github.Al-Adnane/kasbah-mcp؟

ينشره Al-Adnane. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.