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_id、step、parent_step、context_refs、alternatives_considered、state_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.Denied(PermissionError)を発生させます — それをキャッチして、
モデルに別のことを再試行させます。
サーフェス
サーフェス | インポート |
任意の同期/非同期関数用デコレータ |
|
HTTPツールエンドポイント用ASGIミドルウェア |
|
MCPサーバーツールハンドラ |
|
CLI |
|
設計ルール
標準ライブラリのみのコア。 依存関係はありません。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 を参照してください。
This server cannot be installed
Maintenance
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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