More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Agent Permission Kit

    1

    Allow, deny or require human approval for every AI agent tool call and MCP tool, fail-closed.

    Free

    1 useSecurity scanned
    Agent Permission Kit

    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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Npmjs
    Node.js 22+
    npm or pnpm
    agent-permission-kit

    Permissions

    Terminal / Shell
    Network Access
    Write Files
    Read Files

    Allowed Hosts

    npmjs.com

    File Scopes

    src/**
    test/**
    package.json

    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.

    Listed28 days ago

    What's inside

    Frequently Asked Questions

    A system prompt is a request the model can ignore or be tricked out of (prompt injection). This kit enforces the policy in your code, before the tool runs: denied or unapproved calls never execute, whatever the model says. It also fails closed: errors, timeouts and malformed answers deny.

    The kit is built for Node.js 22+ and includes native integrations for the Model Context Protocol (MCP) SDK, Vercel AI SDK, OpenAI Agents JS, and Claude Agent SDK.

    Yes. Mark a tool (or a condition, like amounts over $100) as require_approval and connect your approval channel (Slack, an admin UI). Only an explicit approval runs the tool; a rejection, an error or a timeout (5 minutes by default) denies. For stateless servers, the skill sets up a preview-then-confirm flow instead.

    Step-by-step instructions your agent follows (inventory your tools, write the policy table, wire it in, set up approvals and audit, add tests) plus an API reference with ready-to-adapt snippets for MCP, Vercel AI SDK, OpenAI Agents JS and Claude Agent SDK. The library itself, agent-permission-kit, is free and open source (MIT) on npm; the agent installs it for you.

    Rules decide on a context your server provides (the authenticated user's role or permissions, from the session or token), never on values the model puts in the tool arguments. So the model can't grant itself access by changing arguments. The skill wires the context from your existing authentication.

    It's denied. Unknown tools fail closed, just like a policy that throws or times out, and the model gets a readable "not executed" reason instead of a result. You can make the default "require_approval" instead of "deny", but never "allow". The skill also adds a test so a new tool without a rule fails CI.

    New in Agents & Orchestration