- Home
- Skills
- Agents & Orchestration
- Agent Permission Kit
More screenshots
Works with the AI Agents you already use
Agent Permission Kit
Allow, deny or require human approval for every AI agent tool call and MCP tool, fail-closed.
Free
Agent Permission Kit
Example session with this skill installed
I need to add a permission layer to my MCP server. Some tools like `db.delete` should be admin-only, and `payments.send` needs human approval if it's over $100. Every other tool should be blocked until I decide. Use agent-permission-kit.
- Read your context and instructions
- Compiled the agent permission kit
I inventoried the tools in `src/server.ts` and put one fail-closed policy in front of all of them. ## Policy | Tool | Effect | Rule | |---|---|---| | `db.query` | read | allow | | `db.delete` | destructive | admins only | | `payments.send` | money | up to $100 allowed; above $100 needs a human | | any other tool | — | denied until it gets a rule | ## `src/tool-policy.ts` ```ts import { createGuard } from "agent-permission-kit"; type Ctx = { role: "member" | "admin"; userId: string }; export const guard = createGuard<Record<string, unknown>, Ctx>({ rules: { "db.query": "allow", "db.delete": ({ context }) => context?.role === "admin" ? "allow" : { decision: "deny", reason: "Only admins can delete records" }, "payments.send": ({ input }) => (input as { amount: number }).amount > 100 ? { decision: "require_approval", reason: "Payments above $100 need a human" } : "allow", }, onApprovalRequired: async (req) => { const ok = await askOnSlack(`Send $${(req.input as { amount: number }).amount}?`, req.signal); return ok ? { approved: true, approvedBy: ok.userId } : { approved: false }; }, onAudit: (event) => logger.info(event, `tool ${event.type}: ${event.tool}`), }); ``` ## `src/server.ts` ```ts import { guardMcpServer } from "agent-permission-kit/mcp"; const server = new McpServer({ name: "billing", version: "1.0.0" }); guardMcpServer(server, guard, { context: (extra) => ({ role: roleFrom(extra.authInfo), userId: userFrom(extra.authInfo) }), }); // every registerTool below is now guarded; unknown tools are denied ``` ## `test/tool-policy.test.ts` ```ts import { expectDecisions } from "agent-permission-kit/testing"; await expectDecisions(guard, [ ["db.query", {}, "allow", member], ["db.delete", { id: 1 }, "deny", member], ["db.delete", { id: 1 }, "allow", admin], ["payments.send", { amount: 40 }, "allow", member], ["payments.send", { amount: 250 }, "require_approval", member], ["shell.exec", {}, "deny", admin], ]); ``` ## Next steps 1. Replace `askOnSlack` with your approval channel, and authenticate who approves. 2. Add a coverage test: every registered tool must have a rule, so new tools fail CI until someone decides. 3. Make sure `info`-level logs reach production, so allowed calls are audited too.
Connects securely to your tools. The creator never sees your data.
About this skill
AI agents now call tools that write to databases, send emails and move money, and the model chooses the arguments. This skill teaches your agent to put **one policy table in front of every tool call**, using the open-source [agent-permission-kit](https://github.com/Truta446/agent-permission-kit) library (MIT, zero dependencies). ## What your agent will do 1. **Inventory your tools**: find every tool definition, classify it (read, write, destructive, money, external send) and surface any authorization already buried inside handlers. 2. **Write the policy table**: `allow`, `deny` or `require_approval` per tool, with conditional rules on the input and the caller's role. Unknown tools are denied by default. 3. **Wire it in** wherever tools execute: MCP servers (official TypeScript SDK v1 and v2), Vercel AI SDK, OpenAI Agents JS, Claude Agent SDK, or a custom agent loop. 4. **Set up human approval**: an approval callback, or preview-then-confirm for stateless servers. 5. **Audit every call** without logging sensitive arguments. 6. **Add tests**: a coverage test that fails CI when a new tool has no rule, and a decision table pinned per role. ## Why it's safe by default - Fails closed: a policy that throws, times out or returns garbage denies. Only `{ approved: true }` approves. - The handler receives a frozen copy of the exact arguments that were authorized, so they can't change between check and execution. - Replayed tool-call ids are refused, and a polluted `Object.prototype` can't grant access. ## Good fit when - your agent or MCP server exposes tools with side effects; - you need role-based rules (viewer / editor / admin) for agent actions; - you want new tools blocked until someone decides who may use them. Requires Node.js 22+ and TypeScript or JavaScript.
Not a sandbox: allowed tools still run with your app's full privileges, and calls that bypass the guard (code calling tools directly) aren't covered. Your app must authenticate users and approvers and pass the role as context. Human approval waits in memory within one call (default 5 minutes), so stateless servers should use the preview-then-confirm pattern. guardMcpServer must be installed before tools are registered. Tool names are limited to letters, digits and _ - . / :.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 28 days ago
- Free with an Agensi account
Requires
Permissions
Allowed Hosts
File Scopes
Reads your source to find tool definitions, installs agent-permission-kit from npm, and writes a policy file, the wiring and tests. It never calls external services and stores no credentials.