Skip to main content
Glama
demolished-lab

Dvarapala

Dvarapala

AIエージェントとMCPサーバーのための権限ゲート+改ざん防止監査ログ。3行で追加できます。

エージェントはツールを実行し、コマンドを走らせ、お金を動かします。何かがうまくいかなかったとき、 答えるべき2つの質問があります:それは許可されるべきだったのか? そして 実行は正確にどこで失敗したのか? Dvarapalaはその両方に答えます — 事前 (ゲーティング)と事後(監査)— 依存関係ゼロで。

import dvarapala

gate = dvarapala.Gate(policy="policy.json", audit="audit.jsonl")

@gate(risk="critical")
def refund(customer_id: str, amount_cents: int):
    ...  # nothing runs unless policy + consent approve; every decision is hash-chained

なぜ

  • Gate(事前): 宣言的ポリシー(allow / warn / confirm / deny)、 ヒューリスティックなリスクスコアリング、同意ラダー(1回 / セッション / 常に)、キルスイッチ、 レートリミッター。

  • Audit(実行中→実行後): 各レコードにSHA-256チェーンを持つ追記専用JSONL。 履歴の編集や削除は検証を壊します:dvarapala verify audit.jsonl

  • 最初から因果関係フィールド: すべてのレコードは run_idstepparent_stepcontext_refsalternatives_consideredstate_delta を保持するため、 「エージェントはなぜそんなことをしたのか?」という帰属を、計装し直すことなく その上に構築できます。

30秒ツアー

gate = dvarapala.Gate(
    policy={
        "rules": [
            {"id": "reads-free",   "match": {"tool": "read_*"}, "effect": "allow"},
            {"id": "refunds-human","match": {"tool": "refund"}, "effect": "confirm"},
            {"id": "no-drop",      "match": {"keywords": ["drop table"]}, "effect": "deny"},
        ]
    },
    audit=".dvara/audit.jsonl",
)

エージェントループ内で呼び出しが どこで 発生するかに注釈を付けます:

with dvarapala.step(run_id="r1", step_no=17,
                    alternatives_considered=["cancel_order"]):
    refund("c1", 5000)     # audited with step=17, alternatives recorded

拒否された呼び出しは dvarapala.DeniedPermissionError)を発生させます — それをキャッチして、 モデルに別のことを再試行させます。

サーフェス

サーフェス

インポート

任意の同期/非同期関数用デコレータ

dvarapala.Gate

HTTPツールエンドポイント用ASGIミドルウェア

from dvarapala.middleware import ASGIGateMiddleware

MCPサーバーツールハンドラ

from dvarapala.mcp import gated_tool

CLI

dvarapala verify audit.jsonl · dvarapala tail -n 20 audit.jsonl

設計ルール

  • 標準ライブラリのみのコア。 依存関係はありません。YAMLポリシーはオプションの追加機能です。

  • 拒否安全なデフォルト。 非対話セッションはプロンプトを表示せずに拒否します。 不明なシェルコマンドはMEDIUMと評価され、破壊的トークンはCRITICALと評価されます。

  • ログは証拠です。 チェーン検証は1コマンドで完了し、サーバーは不要です。

ステータス

v0.1.0(アルファ)。ゲートと監査のコアは安定しています。アダプターと 障害帰属レイヤー(why did step 24 fail because of step 6?)は ロードマップにあります。MITライセンス。コントリビューションを歓迎します。

インストール

pip install dvarapala          # core, stdlib-only
pip install dvarapala[yaml]    # + YAML policy support
pip install dvarapala[dev]     # + pytest/ruff

ライセンス

MIT — LICENSE を参照してください。

-
license - not tested
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Runtime permission, approval, and audit layer for AI agent tool execution.

  • See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.

  • Bitcoin-anchored, tamper-evident audit log for AI agents — record, disclose and verify actions.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/demolished-lab/dvarapala'

If you have feedback or need assistance with the MCP directory API, please join our Discord server