Guards AI agent tool calls, automations and chat commands with PermDock operations, subjects, actors and delegation. Use when declaring defineOperations, wiring operations in permdock/agent, permdock/ai-sdk, permdock/claude-agent, permdock/openai, permdock/eve or permdock/mcp, gating models or filtering tool results, running published automations with permdock/workflow or permdock/workflow-sdk, protecting chat commands and approval buttons with permdock/chat or permdock/chat-sdk, separating the user (principal) from the agent (actor), declaring a delegation option or policy delegations, publishing an A2A Agent Card with permdock/a2a, registering WebMCP tools with permdock/webmcp, verifying Web Bot Auth signers as actors, or when agent calls are denied with no-delegation or not-delegated.
Ships in PermDock. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
An agent call has a principal (the user whose grants are evaluated), an actor (the agent making the call) and a delegation (what the user handed over). The decision is the principal's grants intersected with the delegation (delegation). Agent tools, automations and chat commands read one table from defineOperations (operations). Set up permissions.ts, policy.ts and the factory first with the permdock-wire skill (npx skills add ScaleDockHQ/PermDock --skill permdock-wire).
authInfo.clientId, an Agent Card, a request signature.authorizationDetails, GNAP access) or as standing policy ("members let the Eve agent read and update posts").no-delegation. Delegate explicit scopes, never the principal's whole role.deny or an approval still applies.agent actor with a tools list calls only those tools: any other is denied with agent-tool-not-delegated. An actor with readOnly: true is denied every write with not-delegated.data from parsed input; a collection permission (list, create) on a handler that reads args.id is a bug. meta labels an operation and never decides.allowedOperations, capabilityMiddleware, guardTools, MCP list filtering, the A2A extended card, mayUse and WebMCP registration hide tools; the server still decides each call.getPermDock(ticket); only the run ticket (vnd.permdock.run+jwt) travels between steps.ChatAuthor comes only from a verified platform event and its user id, never an email or display name; an approval button carries the request id, never the token.InvalidSignatureError; it never becomes an anonymous actor.npx skills add ScaleDockHQ/scaledock-skills --skill <name>): mcp-authorization for MCP auth, a2a for Agent Cards, webmcp for page tools, web-bot-auth for signatures, owasp-agentic for the threat checklist.Name the three parts per surface. Write down the principal source, the actor source and the delegation source for each surface from the Inputs. The adapter table on delegation shows what each adapter fills itself (MCP and A2A read token scopes; in-process runtimes take a delegation option). An automation run's actor is automation and its delegation is its operations' permissions; a chat command's principal is the linked author.
✓ Every surface has all three, and none reads from model-controlled input or a trigger payload.
Define the operations. One defineOperations(permissions, { name: { permission, data?, results?, meta? } }) module for the app, with names in MCP tool-name characters and meta: { risk, effects, title } on destructive operations. -> references/operations-automations-chat.md
✓ Every operation names a leaf of the tree, and every instance permission has a data loader that parses its input.
Map the agent tools. Use the runtime's createPermDock with subject, actor, delegation and operations, and pass the returned hook to the runtime. For a runtime with no adapter, use createPermDock from permdock/agent and call decideOperation(name, input, ctx) per call. Add models for a model gate and filterResults on list tools. -> references/runtimes.md, agent contract
✓ Every tool the agent can call is an operation, and an unnamed tool is denied unless unmapped: 'allow' is deliberate.
Delegate. Per call, return { scopes: [permissions.post.update.scope] } (or authorizationDetails) from the delegation option. As standing policy, declare it once on the policy:
definePolicy(permissions, {
roles: [member],
delegations: [
{
from: roles.member,
to: actor("eve"),
permissions: [permissions.post.read, permissions.post.update],
},
],
subject,
});
from takes a role, authenticated(), a plan or assurance(). to is an actor kind, or { kind, id } for one agent. A permission outside the ceiling is denied with not-delegated.
✓ The agent is granted a delegated tool, and denied with not-delegated or no-delegation for anything else.
Gate destructive operations. Put approval: { by } on each destructive or money-moving grant and pass a store to the adapter. Follow the permdock-approvals skill (npx skills add ScaleDockHQ/PermDock --skill permdock-approvals).
✓ A destructive operation returns the runtime's approval outcome instead of running.
Run automations. Publish with decideAutomation(permdock, request) and store the Automation record. Start runs with start(id, { caller, trigger }) from the permdock/workflow factory, call getPermDock(ticket) at the top of every step, and wait with awaitApproval or openApproval plus resumeApproval. On the Workflow SDK use startAutomation, workflowSdkWaiter and authorizeHook from permdock/workflow-sdk. -> references/operations-automations-chat.md
✓ A demoted publisher's next step denies, and a caller without the automation's run permission starts nothing.
Protect chat commands. Use createPermDock from permdock/chat with principals and approvals, wrap each command with protect(operation, handler), and apply buttons with resolveAction. On the Chat SDK, build authors with chatSdkAuthor and render approvalCard with approvalActions. -> references/operations-automations-chat.md
✓ An unlinked author is denied with anonymous, and the requester's own click on an approval card is refused.
Wire the agent-facing surfaces. A2A: serve agentCard() publicly, extendedAgentCard(auth) behind auth, and protectSkill on the task endpoint. WebMCP: registerTools from a snapshot, with the server re-checking. Web Bot Auth: webBotAuth: webBotAuthVerifier({ verify: true, keys }) on the HTTP adapter. -> references/runtimes.md
✓ Each surface passes the Verify list of its spec skill.
Test. Add scenario tests with permdock/testing for one delegated grant, one not-delegated denial and one approval per destructive operation (scenario testing). Run testAgentRuntime against a permdock/agent integration. Then review with the permdock-audit skill, which reports ASI02 and ASI03 per adapter.
✓ The tests pass and the audit has no blocker.
subject, actor, tenant or approval token is read from tool arguments, a task body, a trigger payload or model output.delegation, or a policy delegations entry covers its actor kind.defineOperations map; no adapter keeps its own tool-to-permission table.data loader; no collection permission guards a handler that reads one row.results and go through filterResults.models map gates every model the agent may call, when plans or roles price models.resource to their own URL; Claude Agent mcp__ tools come only from mcpSources.allowedOperations are backed by a server-side check on the same permission.getPermDock(ticket) itself, version changes on every edit, and an approval wait resumes through resumeApproval or awaitApproval, never from the wake-up payload.subjectFromChat or chatSdkAuthor, and approval buttons carry the request id.approval-required, and the permdock-approvals Verify list passes.permdock/terminal.defineOperations, the permdock/agent contract, permdock/workflow and permdock/workflow-sdk, permdock/chat and permdock/chat-sdk.https://permdock.com/docs/adapters/<name>.What SKILL.md sets; muted values are Claude Code's defaults
/permdock:permdock-agentsfrom PermDock
npx claudepluginhub scaledockhq/permdock --plugin permdock8 skills in this plugin
/permdockExplains how PermDock decides and routes to the right PermDock skill. Use first for any work with permdock, typed permissions, roles or access control in a TypeScript app, when a check is denied and the reason is unclear, when reading a Decision, denial reason or doctor code, when looking up current PermDock identifiers through the docs MCP, or when choosing between the permdock-wire, permdock-audit, permdock-agents, permdock-approvals, permdock-tenancy, permdock-data and permdock-credentials skills./permdock-approvalsRequires human approval on PermDock grants, notifies approvers and resumes the approved call. Use when adding approval to a destructive or money-moving action (delete, publish, pay, refund, transfer), choosing approvers with approval by, user(), relation(), manager(), mode confirm or authorize, quorum, ttl, escalation, staleOn or approvalFingerprint, ordering approvers with combine and stages, covering an approver with an ApprovalDelegation, loading approval rules as data with an ApprovalPolicySource, separating preparer and approver with exclusiveWith, labelling operations with risk and effects meta, mounting approvalsHandler with an ApprovalStore, sending approval emails (approvalEmail) or chat cards (approvalCard, approvalActions) from approvalPrompt, parking a background run on an ApprovalWaiter (pollingApprovalWaiter, workflowSdkWaiter), resuming with the PermDock-Approval header, mapping approval-required to an agent runtime, MCP elicitation or AG-UI interrupt, or fixing doctor PD017, PD018 or PD024./permdock-auditReviews an existing PermDock setup or a pull request that changes it. Use when auditing permissions, reviewing a PR that touches permissions.ts, policy.ts or an adapter guard, finding ungranted or unused leaves, missing human approvals on agent tools, closures that should be portable, validate never, untested grants, or mapping an app to OWASP ASI02 and ASI03. Use whenever the user asks to audit, review or harden PermDock./permdock-credentialsResolves PermDock subjects from access tokens, API keys and share links. Use when verifying OAuth or OIDC access tokens with subjectFromJwt or an introspection response with subjectFromIntrospection, issuing personal access tokens, API keys, service accounts or feed keys with decideCredential and resolving them with subjectFromApiKey, setting tenant key rules (maxTtl, kinds, allowNoExpiry) in a SettingsSource, minting guest or share links with signCapability and resolving them with subjectFromCapability, serving a link through RLS with exchangeCapability, or fixing doctor PD029 and on('auth') causes such as invalid-chain./permdock-dataEnforces PermDock permissions in database queries and Postgres row-level security. Use when listing rows with permdock.where() and filter(), compiling conditions with toWhere from permdock/drizzle, permdock/prisma or permdock/kysely, guarding Convex functions with permdock/convex, generating or verifying RLS with permdock rls generate, verify or migrate, modelling folders, sub-teams or reporting lines with parent and relation() through a RelationSource, prefetchRelations or whoCan, or proving query and database parity with testOrmParity and testRlsParity. Also for doctor PD027, PD028, PD031 and PD032./permdock-tenancyModels tenants, memberships, contacts and support sessions in PermDock. Use when declaring named scopes (organizations, workspaces, customers inside an organization), loading memberships through a MembershipSource, putting a role on one scope, keeping an owner per organization with min, max or transferOnly, controlling who hands out which role with assigns and for, checking a membership change with decideRoleChange, letting tenant admins define custom roles with customRoles and validateCustomRole, giving external customer contacts portal access as kind contact principals found through a PrincipalSource and principalByIdentity, letting support staff view the app as a customer with decideSupportSession, signSupportSession and subjectFromSupportSession, or fixing doctor PD023, PD025 or PD026 and denials such as tenant-mismatch, last-holder, not-assignable-by or reason-required.Other plugins' skills for the same job