ScaleDock agent permissions
Agents act for users, so every agent surface needs to know who the user is, which agent is acting, what the user delegated, and when a human must confirm. This skill wires the agent protocols into a ScaleDock product with PermDock deciding each step, and keeps an audit trail that answers "who did what, on whose behalf". The spec skills carry the rules of each protocol.
Follow the workflow below step by step. Only wire the surfaces the product has; each step names the input that switches it on.
Inputs (fill in, or ask before starting)
- Agent runtimes: AI SDK, Claude Agent SDK, OpenAI Agents SDK, Eve, MCP (then also
scaledock-mcp-server). - Agent-facing surfaces: A2A agent (yes or no), WebMCP tools in the web app (yes or no), AG-UI chat UI (yes or no), agent-generated UI with A2UI or MCP Apps (yes or no), agent payments with AP2 or x402 (yes or no), agent checkout with UCP or ACP (yes or no), bot traffic over plain HTTP (Web Bot Auth, yes or no), crawler and AI-use rules for the site's content (yes or no), generated media that needs Content Credentials (yes or no).
- Delegation: what the user hands the agent (scopes,
authorization_details) and for how long. - Approval store and approvers: who may confirm destructive or money-moving actions, and whether they confirm on a separate device (CIBA).
- Audit and risk: where decision events go (OpenTelemetry, a SIEM in OCSF, both), whether the EU AI Act applies, and whether the product runs an AI risk program (NIST AI RMF).
Skills to install
npx skills add ScaleDockHQ/scaledock-skills --skill owasp-agentic --skill opentelemetry-genai
npx skills add ScaleDockHQ/scaledock-skills --skill a2a --skill webmcp --skill ag-ui --skill ap2 --skill web-bot-auth # the surfaces you selected
npx skills add ScaleDockHQ/scaledock-skills --skill ocsf --skill eu-ai-act --skill openfeature --skill cedar # when they apply
npx skills add ScaleDockHQ/scaledock-skills --skill privacy-pass --skill webdriver --skill prompt-api
npx skills add ScaleDockHQ/PermDock
Optional installs, per surface (npx skills add ScaleDockHQ/scaledock-skills --skill <name>):
- MCP:
mcp(base protocol for MCP servers and clients) andmcp-apps(interactiveui://views on tools), withscaledock-mcp-server. - Agent UI:
a2ui(declarative agent-generated UI drawn from a trusted component catalog), next toag-ui. - Payments and checkout:
x402(HTTP 402 payments),ucp(Universal Commerce Protocol) andagentic-commerce-protocol(ACP agent checkout with delegated payment tokens), next toap2. - Approvals:
ciba(the approver confirms on a separate authentication device). - Bot traffic and content:
robots-txt(crawler rules),aipref(Content-Usage preferences for AI training and use) andc2pa(Content Credentials on media agents generate), next toweb-bot-auth. - Threat model and governance:
owasp-llm(LLM application risks),mitre-atlas(AI threat tactics and techniques) andnist-ai-rmf(AI risk program), next toowasp-agenticandeu-ai-act.
Invariants
- The spec skills win on protocol details. Agent Cards follow
a2a; MCP messages followmcp; page tools followwebmcp; UI events followag-ui; generated UI followsa2uiormcp-apps; mandates followap2; payments and checkouts followx402,ucpandagentic-commerce-protocol; request signatures followweb-bot-auth; span names followopentelemetry-genai. - Principal and actor are separate. The user is the principal, the agent is the actor. Both come from verified transport auth or the host session, never from a task body, tool argument or model output.
- Delegation is explicit. An agent gets only what the user delegated, intersected with what the user may do. An actor with no delegation is denied everything.
- Destructive and money-moving actions wait for a human. Grants on delete, publish, pay, approve, refund and access changes carry
approval, the requester cannot approve their own request, and AP2 mandates, x402 payment payloads and UCP or ACP payment tokens never replace that approval. - Every decision is recorded. Each tool call produces a decision event with principal, actor, permission, outcome and reason, nested under the GenAI
execute_toolspan. - Flags select, they never grant. OpenFeature may pick which declared role or plan applies; a flag never turns a denial into a grant.
- One policy language in the app. PermDock policies are the source of truth. Cedar sits next to them only where an external gateway already evaluates Cedar; both use deny-overrides-permit, so keep the two in step rather than translating one into the other.
Workflow
- Set the inputs and threat-model. Walk the
owasp-agenticchecklist for each selected surface, focusing on tool misuse and identity and privilege abuse. Addowasp-llmfor the model-facing risks (prompt injection, output handling) and tag threats withmitre-atlastechniques when the product keeps a threat model. ✓ Every surface has a named principal source, actor source and delegation. - Tool calls. For each runtime, use the matching PermDock adapter (
permdock/ai-sdk,permdock/claude-agent,permdock/openai,permdock/eve,permdock/mcp) withsubject,actor,delegationand one permission per tool. Followwire-permdock. ->references/stack.md✓ A tool the user has not delegated is denied, and a destructive tool returnsapproval-required. - Agent-facing surfaces. A2A: generate the Agent Card and extended card with
permdock/a2aand protect each skill. WebMCP: register only snapshot-allowed tools withpermdock/webmcp. AG-UI: surfaceapproval-requiredas the protocol's human-in-the-loop events. A2UI or MCP Apps: render only catalog components orui://views, and send every action they trigger through the same PermDock decision. AP2, x402, UCP and ACP: treat mandates, payment payloads and checkout tokens as evidence attached to an approval, not as the approval. Web Bot Auth: enablewebBotAuthon the HTTP adapter so a verified signer becomes the actor. Content: publishrobots-txtrules andaiprefContent-Usage statements for crawlers, and attachc2paContent Credentials to media agents generate. ✓ Each selected surface passes its spec skill's Verify list. - Approvals. Mount
approvalsHandlerfrompermdock/approvalswith a durable store, pass the store to every adapter, and resume with thePermDock-Approvalheader. When the approver confirms on a separate device, run that confirmation ascibadescribes and attach the result to the approval. ✓ An approval resumes only the exact call it was issued for, by a distinct approver. - Audit trail. Instrument with
instrumentfrompermdock/otelso decisions nest underexecute_toolspans; export decision events as OCSF when a SIEM needs them. If the EU AI Act applies, map the logging and human-oversight obligations ineu-ai-actto these events; with an AI risk program, map them to thenist-ai-rmfsubcategories they evidence. ✓ For any tool call you can answer who asked, which agent acted, what was decided and who approved. - Test and audit. Add scenario tests for delegation, denial and approval with
permdock/testing, then runaudit-permissionsfromScaleDockHQ/PermDock(it reports OWASP ASI02 and ASI03 per adapter). ✓ Tests pass and the audit has no blocker.
Verify before done
- No agent surface reads a subject, tenant or actor from model-controlled input.
- Every agent adapter sets
delegation, and it lists scopes, not the principal's whole role. - Every destructive or money-moving tool returns
approval-required, and self-approval is refused. - Every selected spec skill's Verify list passes.
- Decision events carry principal, actor, permission, outcome and reason, and
pnpm verifypasses.
Reference index
references/stack.md: each spec mapped to the PermDock adapter and the audit trail.