Requires 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.
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.
approval-required is the third outcome: the subject may do it, but a person other than the requester confirms each call. An approval never grants something the subject could not do, and a deny still wins (approval security). Set up the policy and factory first with the permdock-wire skill (npx skills add ScaleDockHQ/PermDock --skill permdock-wire).
assurance(), one named user, or a relation on the row such as the expense's manager), how many approvers (quorum), whether several groups sign in order, how long an ask may wait, and who steps in when nobody answers.memoryApprovalStore), the app's database, or PermDock Cloud.mode: "confirm", and requireDistinctApprover on the handler refuses it even then. A delegate is held to the same rule, and so is the delegator. One hop, and until is required.decide, and consume spends the approval once.can returns false for approval-required. Only decide, assert and the adapters see the third outcome.ttl can shorten the store's window, never extend it.relation() or manager() approver is matched only through facts the approvals handler reads from the app's RelationSource at verdict time, never from a request body.waiter.wake(token) only ends a wait; the run decides again through resumeApproval, which reads the store.meta. risk and effects label or gate a call in the host; only the grant's approval asks a person.Mark the grants. Add approval: 'human' (anyone authenticated but the requester) or approval: { by } with the same selectors as to:
allow(permissions.payout.release, {
approval: {
by: roles.finance,
quorum: 2,
ttl: 1800, // seconds: 30 minutes
escalation: { after: 14_400, to: roles.owner }, // 4 hours
},
});
For sign-off in order, use combine: 'sequential' with stages: [{ by, quorum? }] (or combine: 'all' for any order); one person signs one stage. user('u_cfo') names one person, and relation(permissions.expense, 'manager') names whoever holds the relation on the row.
Add mode: "confirm" only where the user confirms their own agent's call and no money, deletion or access change sits behind it.
✓ permdock doctor reports no PD017 (sensitive verb without approval), and every PD024 (mode: "confirm") is deliberate.
Bind content when it matters. Declare version: 'updatedAt' (or a revision counter) on the resource() and add staleOn: 'resource-change' to the approval, so a changed row resumes as stale-approval and asks again.
✓ definePolicy accepts the grant (it throws when the resource has no version or the action is a collection action).
Split workflow verbs. Model prepare, approve, pay, settle and submit as separate leaves. Put the approval on approve / pay, and use exclusiveWith on role() so a preparer cannot also hold the approver role.
✓ permdock doctor reports no PD018 (exclusive roles held together).
Label risk. Give each approval-gated operation in defineOperations a meta with title, risk (low, medium, high, critical) and effects (read, write, delete, send, spend, external), so prompts and the host's UI show what the call does (operations). -> references/delivery-and-waiters.md
✓ defineOperations builds the map without throwing, and every risk: 'high' or 'critical' operation's permission has an approval grant.
Store and handler. Create one ApprovalStore, pass it as store to every adapter, and mount approvalsHandler(store, { subject }) for approvers (GET /:id, POST /:id/approve and /reject with If-Match); add relations and permissions when a grant uses relation() approvers. -> references/stores-and-resume.md
✓ A second authenticated user can approve; the actor and the requester get 403, and a stale If-Match gets 412.
Rules as data (optional). Pass approvalPolicies (an ApprovalPolicySource, memoryApprovalPolicySource in process) to createPermDock for approval rules organisations configure. -> references/stores-and-resume.md
✓ testApprovalPolicySource from permdock/testing passes on the source.
Notify approvers. Build the prompt with approvalPrompt(request, { operation }) and send it with createPermDock from permdock/delivery: approvalEmail from permdock/resend for email, a chat message with approval (rendered as approvalCard) plus approvalActions from permdock/chat-sdk for chat (delivery). -> references/delivery-and-waiters.md
✓ The DeliveryReport shows sent for each eligible approver and none for the requester; the message holds no token and no approve link.
Surface and resume. Map the outcome to each runtime's approval hook and resume with the token: the PermDock-Approval header over HTTP, the runtime's own resume for agents. -> references/stores-and-resume.md
✓ The approved call runs once; a second resume is denied with approval-consumed.
Wait in background runs. Pass a waiter to createPermDock from permdock/workflow (pollingApprovalWaiter({ store, interval }), or workflowSdkWaiter from permdock/workflow-sdk) and call awaitApproval, or openApproval and resumeApproval as steps. The approver's endpoint calls waiter.wake(token) after resolveApproval (automations). -> references/delivery-and-waiters.md
✓ A wake before any verdict leaves the run denied with reason approval; a wake after approval lets it proceed once.
Test. Add a scenario test per approval grant: the ask, an approval by an eligible user, a refused self-approval, and the single resume (scenario testing). Run testApprovalStore on a custom store.
✓ The tests pass.
approval, or a deny on the same leaf.mode: "confirm" (PD024) is a deliberate self-confirmation with nothing irreversible behind it.exclusiveWith, and PD018 is clean.memoryApprovalStore on serverless or across replicas.decide.ApprovalStore passes testApprovalStore from permdock/testing.relation() or manager() approvers have a handler with relations, and nothing fills verdict.relations from client input.approvalUrl is https and opens a page behind sign-in.deliver from server-loaded principals, never from the request body, and the requester is not among them.approvalActions (or resolveAction), never a handler that trusts the button value alone.waiter.wake(token) after resolveApproval, and no run reads a verdict from a wake, hook payload or queue message.meta.risk or meta.effects.approvalsHandler routes and preconditions, custom stores, relation approvers, approval policies as data, the token and its CloudEvents, resume details and denial causes, the runtime surfaces table.approvalPrompt with permdock/delivery, approvalEmail, approvalCard and approvalActions, ApprovalWaiter, pollingApprovalWaiter, workflowSdkWaiter, cloudApprovalWaiter.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
8 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-agentsGuards 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./permdock:permdock-approvalsfrom PermDock
npx claudepluginhub scaledockhq/permdock --plugin permdock