[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KVWQ2AVG7XG1183CK5DK13":3,"skill-same:01M6KVWQ2AVG7XG1183CK5DK13":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":6,"updatedAt":52,"install":53,"resources":66},"01M6KVWQ2AVG7XG1183CK5DK13","claude-sdk-permissions",null,"The Claude Agent SDK permission model — allowed_tools, disallowed_tools, the six permission_mode values, and the can_use_tool callback. Read when designing what an agent is allowed to do, when production deploys are surprising users with permission prompts, when you want dynamic per-call gating, or when locking down a deploy that runs unattended.","Folken2\u002Fnuvel","Folken2","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F175213316?v=4","01M6KVPA04RKNPCC04H2G96FAS","Albert Folch","01M6KVPA43VNTA4PXSEB1TCD81",2,"MIT","https:\u002F\u002Fgithub.com\u002FFolken2\u002Fnuvel\u002Fblob\u002Fmain\u002Fnuvel\u002Fbackends\u002Fclaude_agent_sdk\u002Fskills\u002Fclaude-sdk-permissions\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"permissions","claude sdk permissions","sdk","you","to do","gating","down","values","callback","mode","can","tool","with","users","agent sdk","call","do","claude agent sdk","use","model","2026-11-10 10:12:30",false,"---\nname: claude-sdk-permissions\ndescription: The Claude Agent SDK permission model — allowed_tools, disallowed_tools, the six permission_mode values, and the can_use_tool callback. Read when designing what an agent is allowed to do, when production deploys are surprising users with permission prompts, when you want dynamic per-call gating, or when locking down a deploy that runs unattended.\n---\n\n# Permissions in the Claude Agent SDK\n\nThree layers control what Claude can do:\n\n1. **`allowed_tools` \u002F `disallowed_tools`** — static allowlists \u002F blocklists by tool name.\n2. **`permission_mode`** — one of six policies that govern unspecified tools.\n3. **`can_use_tool`** — a callback for dynamic, per-call decisions.\n\nGet this right once and you don't think about it again. Get it wrong and either the agent stalls on prompts you can't answer (server deploys) or runs commands you didn't intend.\n\n## The big mental model\n\n`allowed_tools` is **pre-approval**, not availability. Listing a tool there means \"don't prompt; just run it.\" Tools available to Claude come from the underlying tool surface (built-in tools the SDK exposes, plus any `mcp_servers` you wire). `disallowed_tools` is the only knob that removes availability.\n\nTwo implications:\n\n- A tool not in `allowed_tools` isn't blocked — it just triggers the permission flow set by `permission_mode`.\n- A tool in `allowed_tools` that doesn't actually exist (typo, wrong server prefix) silently does nothing.\n\n## The six permission_mode values\n\n| Mode | Behavior for unapproved tools |\n|------|-------------------------------|\n| `default` | Surface a permission prompt. Right for interactive dev sessions. |\n| `acceptEdits` | Auto-accept file edits (Write, Edit). Other tools still prompt. Right for \"trusted\" coding agents. |\n| `plan` | Refuse to run any tool; Claude can still reason and write text. Right for read-only planning passes. |\n| `bypassPermissions` | Run everything, no prompts. **Dangerous** — only for fully sandboxed environments. |\n| `dontAsk` | Silently deny anything not in `allowed_tools`. Right for unattended server deploys. |\n| `auto` | Heuristic — auto-allow read-only operations, prompt on writes\u002Fdangerous. |\n\n## Production server deploys\n\nTwo safe configurations for a server that runs unattended:\n\n```python\n# Strict — only what you've enumerated runs.\nClaudeAgentOptions(\n    permission_mode=\"dontAsk\",\n    allowed_tools=[\n        \"mcp__tools__lookup_user\",\n        \"mcp__tools__send_email\",\n        \"mcp__fs__read_file\",\n    ],\n    disallowed_tools=[\"Bash\"],   # belt-and-suspenders\n)\n```\n\n```python\n# Looser — accept edits but explicit about destructive surfaces.\nClaudeAgentOptions(\n    permission_mode=\"acceptEdits\",\n    disallowed_tools=[\"Bash\"],\n    allowed_tools=[\"mcp__tools__safe_op\"],\n)\n```\n\nThe second is right when the agent is editing code in a sandbox. The first is right for any agent acting on shared state (DBs, email, user data).\n\n`permission_mode=\"bypassPermissions\"` is rarely the right answer. The only legitimate case: the agent runs in a one-shot Docker container with no persistent state and no network access to anything that matters. If you're tempted to use it because prompts are annoying in dev, switch to `dontAsk` and explicitly list what you trust.\n\n## The can_use_tool callback\n\nFor decisions that can't be expressed as a static list:\n\n```python\nasync def can_use_tool(tool_name: str, tool_input: dict, context):\n    # Block writes outside \u002Fworkspace\n    if tool_name in (\"Write\", \"Edit\"):\n        path = tool_input.get(\"file_path\", \"\")\n        if not path.startswith(\"\u002Fworkspace\u002F\"):\n            return {\"behavior\": \"deny\", \"message\": f\"Outside workspace: {path}\"}\n\n    # Rate-limit expensive tool\n    if tool_name == \"mcp__tools__expensive_query\":\n        if rate_limiter.is_throttled():\n            return {\"behavior\": \"deny\", \"message\": \"Rate limited; try again in 30s\"}\n\n    return {\"behavior\": \"allow\", \"updatedInput\": tool_input}\n\noptions = ClaudeAgentOptions(can_use_tool=can_use_tool)\n```\n\nThe callback can also rewrite the input via `updatedInput` — useful for redaction (strip secrets from arguments before they hit a tool) and normalization (ensure paths are absolute, etc).\n\n`can_use_tool` runs *after* `allowed_tools` would have approved a call. If you want it to gate everything, leave `allowed_tools` empty and let the callback decide.\n\n## Common mistakes\n\n- **Empty `allowed_tools` with `permission_mode=\"default\"` in a server deploy.** Claude prompts on every call; the server has no human to answer; everything stalls. Either populate `allowed_tools` or switch to `dontAsk`.\n- **Forgetting the `mcp__server__` prefix.** `allowed_tools=[\"lookup_user\"]` doesn't pre-approve `mcp__tools__lookup_user`. Use the full name.\n- **Trusting `bypassPermissions` because it's convenient.** Production-grade agents start strict and relax deliberately. Easy to widen access later; hard to recover from `rm -rf` running unattended.\n- **`disallowed_tools` collision with `allowed_tools`.** `disallowed_tools` wins. If you list `Bash` in both, Claude can't call it.\n\n## Picking a default for a new agent\n\n| Context | `permission_mode` | `allowed_tools` |\n|---------|---|---|\n| Interactive CLI with a human | `default` | Just the read-only tools you trust |\n| Coding agent editing a sandbox | `acceptEdits` | Plus `mcp__fs__*` write tools |\n| Background server with known workload | `dontAsk` | Full enumeration of permitted tools |\n| Planning-only review pass | `plan` | (irrelevant — nothing runs) |\n\nFor nuvel-scaffolded server agents, the default is `acceptEdits` — change it to `dontAsk` once you know exactly which tools the agent should call.\n","# Permissions in the Claude Agent SDK\n\nThree layers control what Claude can do:\n\n1. **`allowed_tools` \u002F `disallowed_tools`** — static allowlists \u002F blocklists by tool name.\n2. **`permission_mode`** — one of six policies that govern unspecified tools.\n3. **`can_use_tool`** — a callback for dynamic, per-call decisions.\n\nGet this right once and you don't think about it again. Get it wrong and either the agent stalls on prompts you can't answer (server deploys) or runs commands you didn't intend.\n\n## The big mental model\n\n`allowed_tools` is **pre-approval**, not availability. Listing a tool there means \"don't prompt; just run it.\" Tools available to Claude come from the underlying tool surface (built-in tools the SDK exposes, plus any `mcp_servers` you wire). `disallowed_tools` is the only knob that removes availability.\n\nTwo implications:\n\n- A tool not in `allowed_tools` isn't blocked — it just triggers the permission flow set by `permission_mode`.\n- A tool in `allowed_tools` that doesn't actually exist (typo, wrong server prefix) silently does nothing.\n\n## The six permission_mode values\n\n| Mode | Behavior for unapproved tools |\n|------|-------------------------------|\n| `default` | Surface a permission prompt. Right for interactive dev sessions. |\n| `acceptEdits` | Auto-accept file edits (Write, Edit). Other tools still prompt. Right for \"trusted\" coding agents. |\n| `plan` | Refuse to run any tool; Claude can still reason and write text. Right for read-only planning passes. |\n| `bypassPermissions` | Run everything, no prompts. **Dangerous** — only for fully sandboxed environments. |\n| `dontAsk` | Silently deny anything not in `allowed_tools`. Right for unattended server deploys. |\n| `auto` | Heuristic — auto-allow read-only operations, prompt on writes\u002Fdangerous. |\n\n## Production server deploys\n\nTwo safe configurations for a server that runs unattended:\n\n```python\n# Strict — only what you've enumerated runs.\nClaudeAgentOptions(\n    permission_mode=\"dontAsk\",\n    allowed_tools=[\n        \"mcp__tools__lookup_user\",\n        \"mcp__tools__send_email\",\n        \"mcp__fs__read_file\",\n    ],\n    disallowed_tools=[\"Bash\"],   # belt-and-suspenders\n)\n```\n\n```python\n# Looser — accept edits but explicit about destructive surfaces.\nClaudeAgentOptions(\n    permission_mode=\"acceptEdits\",\n    disallowed_tools=[\"Bash\"],\n    allowed_tools=[\"mcp__tools__safe_op\"],\n)\n```\n\nThe second is right when the agent is editing code in a sandbox. The first is right for any agent acting on shared state (DBs, email, user data).\n\n`permission_mode=\"bypassPermissions\"` is rarely the right answer. The only legitimate case: the agent runs in a one-shot Docker container with no persistent state and no network access to anything that matters. If you're tempted to use it because prompts are annoying in dev, switch to `dontAsk` and explicitly list what you trust.\n\n## The can_use_tool callback\n\nFor decisions that can't be expressed as a static list:\n\n```python\nasync def can_use_tool(tool_name: str, tool_input: dict, context):\n    # Block writes outside \u002Fworkspace\n    if tool_name in (\"Write\", \"Edit\"):\n        path = tool_input.get(\"file_path\", \"\")\n        if not path.startswith(\"\u002Fworkspace\u002F\"):\n            return {\"behavior\": \"deny\", \"message\": f\"Outside workspace: {path}\"}\n\n    # Rate-limit expensive tool\n    if tool_name == \"mcp__tools__expensive_query\":\n        if rate_limiter.is_throttled():\n            return {\"behavior\": \"deny\", \"message\": \"Rate limited; try again in 30s\"}\n\n    return {\"behavior\": \"allow\", \"updatedInput\": tool_input}\n\noptions = ClaudeAgentOptions(can_use_tool=can_use_tool)\n```\n\nThe callback can also rewrite the input via `updatedInput` — useful for redaction (strip secrets from arguments before they hit a tool) and normalization (ensure paths are absolute, etc).\n\n`can_use_tool` runs *after* `allowed_tools` would have approved a call. If you want it to gate everything, leave `allowed_tools` empty and let the callback decide.\n\n## Common mistakes\n\n- **Empty `allowed_tools` with `permission_mode=\"default\"` in a server deploy.** Claude prompts on every call; the server has no human to answer; everything stalls. Either populate `allowed_tools` or switch to `dontAsk`.\n- **Forgetting the `mcp__server__` prefix.** `allowed_tools=[\"lookup_user\"]` doesn't pre-approve `mcp__tools__lookup_user`. Use the full name.\n- **Trusting `bypassPermissions` because it's convenient.** Production-grade agents start strict and relax deliberately. Easy to widen access later; hard to recover from `rm -rf` running unattended.\n- **`disallowed_tools` collision with `allowed_tools`.** `disallowed_tools` wins. If you list `Bash` in both, Claude can't call it.\n\n## Picking a default for a new agent\n\n| Context | `permission_mode` | `allowed_tools` |\n|---------|---|---|\n| Interactive CLI with a human | `default` | Just the read-only tools you trust |\n| Coding agent editing a sandbox | `acceptEdits` | Plus `mcp__fs__*` write tools |\n| Background server with known workload | `dontAsk` | Full enumeration of permitted tools |\n| Planning-only review pass | `plan` | (irrelevant — nothing runs) |\n\nFor nuvel-scaffolded server agents, the default is `acceptEdits` — change it to `dontAsk` once you know exactly which tools the agent should call.\n",{"name":5,"description":7},"main","41d246dd855999c6bc4be528bc8d0d1b10ac8c47","nuvel\u002Fbackends\u002Fclaude_agent_sdk\u002Fskills\u002Fclaude-sdk-permissions",1,"https:\u002F\u002Fgithub.com\u002FFolken2\u002Fnuvel","https:\u002F\u002Ffolken2.github.io\u002Fnuvel\u002F","https:\u002F\u002Fgithub.com\u002FFolken2","folch.ai","2026-11-05 22:40:38",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add Folken2\u002Fnuvel --skill claude-sdk-permissions",{"tool":59,"command":60},"bunx","bunx skills add Folken2\u002Fnuvel --skill claude-sdk-permissions",{"tool":62,"command":63},"pnpm","pnpm dlx skills add Folken2\u002Fnuvel --skill claude-sdk-permissions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FFolken2\u002Fnuvel\u002Fblob\u002Fmain\u002Fnuvel\u002Fbackends\u002Fclaude_agent_sdk\u002Fskills\u002Fclaude-sdk-permissions\u002FSKILL.md",true,[],[68,77,89,110,127,142],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":39},"01M6KVZNJQ7AVMVBS205404CS7","greet","Greet a user warmly by name.","https:\u002F\u002Fgithub.com\u002FFolken2\u002Fnuvel\u002Fblob\u002Fmain\u002Ftests\u002Ftest_agent_plugins\u002Ffixtures\u002Fvalid-full\u002Fskills\u002Fgreet\u002FSKILL.md",[],[70,75,76],"user","name",{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":39},"01M6KVZHYK2C9S5GRM3PZAFDXG","hello","A simple hello skill that survives a broken mcp.json.","https:\u002F\u002Fgithub.com\u002FFolken2\u002Fnuvel\u002Fblob\u002Fmain\u002Ftests\u002Ftest_agent_plugins\u002Ffixtures\u002Fbad-mcp\u002Fskills\u002Fhello\u002FSKILL.md",[],[79,84,85,86,87,88],"MCP","hello skill","json","broken","simple",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":39},"01M6KVZC94REQZ852EJ99ZXATK","grok-workflows","Prompt templates and workflows for using xAI GrokBot with Nuvel — code, design, research, and automated pipelines.","https:\u002F\u002Fgithub.com\u002FFolken2\u002Fnuvel\u002Fblob\u002Fmain\u002Fplugins\u002Fgrokbot-plugin\u002Fskills\u002Fgrok-workflows\u002FSKILL.md",[],[96,97,98,99,100,101,102,103,104,105,106,107,31,108,109],"workflows","grok","grok workflows","design","research","prompt","prompt templates","code","templates","xai","grokbot","pipelines","for","nuvel",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":39},"01M6KVZ7BA5MJ1N614MTP2JXCQ","grok-setup","Configure xAI GrokBot with Nuvel API integration and project context for Nuvel-aligned development.","https:\u002F\u002Fgithub.com\u002FFolken2\u002Fnuvel\u002Fblob\u002Fmain\u002Fplugins\u002Fgrokbot-plugin\u002Fskills\u002Fgrok-setup\u002FSKILL.md",[],[97,117,118,108,31,119,109,120,121,122,106,123,124,125,105,126],"grok setup","setup","project","project context","api integration","configure","development","integration","api","context",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":39},"01M6KVZ3WYQ6V6XVCRE77WT2WY","cursor-setup","Configure Cursor IDE with Nuvel rules, MCP server integration, and project settings for OrgMemory-aware development.","https:\u002F\u002Fgithub.com\u002FFolken2\u002Fnuvel\u002Fblob\u002Fmain\u002Fplugins\u002Fcursor-plugin\u002Fskills\u002Fcursor-setup\u002FSKILL.md",[],[134,135,118,124,84,136,123,137,138,122,139,140,119,31,108,141,109],"cursor","cursor setup","mcp server","server","ide","Rules","settings","project settings",{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":148,"publishedAt":39},"01M6KVZ0GGSJM4AC8PK7G53H85","cursor-review","Use Cursor IDE with Nuvel OrgMemory to review changes — diff analysis, standards checking, and pre-commit review.","https:\u002F\u002Fgithub.com\u002FFolken2\u002Fnuvel\u002Fblob\u002Fmain\u002Fplugins\u002Fcursor-plugin\u002Fskills\u002Fcursor-review\u002FSKILL.md",[],[149,134,150,151,152,153,154,138,37,155,156,31,157,158,109],"cursor review","review","commit","review changes","pre-commit","analysis","diff","standards","changes","diff analysis"]