[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H06KJS0EHFAC5V32EFYN0T":3,"skill-same:01M6H06KJS0EHFAC5V32EFYN0T":74},{"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":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M6H06KJS0EHFAC5V32EFYN0T","scope-per-tool-permissions-least-privilege",null,"Use when granting an agent access to tools, files, or network. Give each tool the narrowest scope that completes its job, and revoke the rest.","jiayaoqijia\u002Fcryptoskill","jiayaoqijia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1453879?v=4","01M6GMYTX7Q7S504VC6E756ENR","YQ","01M6GMYV1QKJ1CC75MTTGT9PR0",81,"MIT","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-scope-per-tool-permissions-least-privilege\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-scope-per-tool-permissions-least-privilege\u002FSKILL.md",[],[20,21,22,23,24,25,26,27,28,29,30,31],"permissions","tool","scope","scope per tool permissions least privilege","least privilege","network","REST","Tools","access","use","files","when","2026-11-10 10:12:30",false,"---\nname: scope-per-tool-permissions-least-privilege\ndescription: Use when granting an agent access to tools, files, or network. Give each tool the narrowest scope that completes its job, and revoke the rest.\n---\n\n# Scope per-tool permissions to least privilege\n\nAn agent inherits whatever the process allows, so a write bug becomes a write-anywhere bug. Grant permissions per tool, scoped to the exact resource, and keep the default deny.\n\n## Procedure\n\n1. Enumerate the run's tools and, for each, the single resource it needs: `db_read -> customers (SELECT)`, `file_write -> out\u002Freport.csv`.\n2. Write the grant list explicitly; anything absent is denied. Default-deny, allow by exception.\n3. Scope filesystem access to a subtree and a mode: `out\u002F:rw`, `src\u002F:ro`. Never grant `\u002F` or `$HOME`.\n4. Scope database access to schema verbs: `SELECT` for readers, `INSERT` on one table for writers — never `ALL` or `GRANT`.\n5. Scope network egress to named hosts when the tool only needs a few: `api.internal:443`, not `0.0.0.0\u002F0`.\n6. Give each tool its own credential with the least role, not a shared admin token that every tool can borrow.\n7. Re-derive the grant list per run from the brief; do not copy last run's permissions wholesale.\n8. Audit weekly: list grants actually exercised from the action log and remove the ones never used.\n9. Treat a permission error as a design signal, not an obstacle to widen away — decide whether the step should exist.\n\n## Pitfalls\n\n- Granting `sudo` or a root token \"so the agent is not blocked\", which removes every other control at once.\n- Sharing one credential across tools, so an audit cannot tell which tool did what.\n- Scoping to a directory but forgetting mode, giving read-only tasks the ability to delete.\n- Copying a previous run's broader grants because re-deriving them is tedious.\n- Leaving a grant in place after the tool is retired, accumulating latent access.\n- Widening a scope to fix one denied call instead of fixing the call's resource target.\n\n## Verification\n\n```bash\npython3 tools\u002Faudit_grants.py runs\u002Fgrants.json notes\u002Faction.log\n# fails on any exercised path outside the declared scope, and lists unused grants for removal\n```\n\nReport each tool, its declared scope, and any access the run attempted outside it.\n","# Scope per-tool permissions to least privilege\n\nAn agent inherits whatever the process allows, so a write bug becomes a write-anywhere bug. Grant permissions per tool, scoped to the exact resource, and keep the default deny.\n\n## Procedure\n\n1. Enumerate the run's tools and, for each, the single resource it needs: `db_read -> customers (SELECT)`, `file_write -> out\u002Freport.csv`.\n2. Write the grant list explicitly; anything absent is denied. Default-deny, allow by exception.\n3. Scope filesystem access to a subtree and a mode: `out\u002F:rw`, `src\u002F:ro`. Never grant `\u002F` or `$HOME`.\n4. Scope database access to schema verbs: `SELECT` for readers, `INSERT` on one table for writers — never `ALL` or `GRANT`.\n5. Scope network egress to named hosts when the tool only needs a few: `api.internal:443`, not `0.0.0.0\u002F0`.\n6. Give each tool its own credential with the least role, not a shared admin token that every tool can borrow.\n7. Re-derive the grant list per run from the brief; do not copy last run's permissions wholesale.\n8. Audit weekly: list grants actually exercised from the action log and remove the ones never used.\n9. Treat a permission error as a design signal, not an obstacle to widen away — decide whether the step should exist.\n\n## Pitfalls\n\n- Granting `sudo` or a root token \"so the agent is not blocked\", which removes every other control at once.\n- Sharing one credential across tools, so an audit cannot tell which tool did what.\n- Scoping to a directory but forgetting mode, giving read-only tasks the ability to delete.\n- Copying a previous run's broader grants because re-deriving them is tedious.\n- Leaving a grant in place after the tool is retired, accumulating latent access.\n- Widening a scope to fix one denied call instead of fixing the call's resource target.\n\n## Verification\n\n```bash\npython3 tools\u002Faudit_grants.py runs\u002Fgrants.json notes\u002Faction.log\n# fails on any exercised path outside the declared scope, and lists unused grants for removal\n```\n\nReport each tool, its declared scope, and any access the run attempted outside it.\n",{"name":5,"description":7},"main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fpayments\u002F0xklen-scope-per-tool-permissions-least-privilege",17,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia","https:\u002F\u002Feth2030.com","Hardcore infra. Building @alt-research and applied cryptography.","2026-11-12 02:28:42",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill scope-per-tool-permissions-least-privilege",{"tool":52,"command":53},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill scope-per-tool-permissions-least-privilege",{"tool":55,"command":56},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill scope-per-tool-permissions-least-privilege","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-scope-per-tool-permissions-least-privilege\u002FSKILL.md",true,[60,64,70],{"path":61,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":16},"LICENSE","许可证",1063,{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"SOURCE.md","REFERENCE","参考文档",368,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-scope-per-tool-permissions-least-privilege\u002FSOURCE.md",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"TRUST.auto.yaml",2197,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-scope-per-tool-permissions-least-privilege\u002FTRUST.auto.yaml",[75,102,125,142,155,165],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":79,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":32},"01M712C436EQYE43342Q4E7GG1","recipe-performance","Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold\u002Fwarm\u002Fbackground-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout\u002Fpaint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FSKILL.md",[],[83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,25,101],"performance","recipe performance","recipe","mm","sentry","harness","app","deterministic","recipes","flow","cold","critical","analysis","tasks","react","browser","layout","screen","metamask",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":106,"licenseFileUrl":107,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":32},"01M70XT2F8A5CQZ81JBP98KSW3","mexc-spot-websocket","MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FSKILL.md",[],[111,112,113,114,115,116,117,118,119,120,121,122,123,124],"mexc spot websocket","spot","websocket","api","workflows","public","listen","streams","depth","keys","for","api keys","maintenance","protobuf",{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":106,"licenseFileUrl":129,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":32},"01M70XT0MBXN3WZY1BKN0CPNKR","mexc-spot-rest","MEXC Spot REST workflows for public data, signed account requests, orders, wallet\u002Fadmin actions, and secure signing without exposing API keys.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FSKILL.md",[],[133,112,26,134,135,136,137,122,121,120,138,139,140,116,141,115,114],"mexc spot rest","admin","signing","Wallet","requests","actions","secure","data","orders",{"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":106,"licenseFileUrl":146,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":32},"01M70XSYSVZ2N0N91XCAR2CAK0","mexc-futures-websocket","MEXC Futures WebSocket workflows for public streams, private account\u002Forder\u002Fposition streams, ping\u002Fpong, subscriptions, and depth maintenance.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FSKILL.md",[],[150,151,113,152,153,123,121,154,119,118,116,115],"mexc futures websocket","futures","position","ping","subscriptions",{"skillNo":156,"name":157,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":158,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":32},"01M6H0ZWHVE5W04WG2DKQE2SQC","0xklen-version-and-refresh-sanctions-lists","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FSKILL.md",[],[162,163,164],"refresh","0xklen version and refresh sanctions lists","version",{"skillNo":166,"name":167,"nameZh":6,"description":168,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":169,"sourceHtmlUrl":170,"categories":171,"keywords":172,"publishedAt":32},"01M6H0Z28Q3R8J0S799GJQWXM3","verify-tests-cover-changed-lines","Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FSKILL.md",[],[173,174,175,176,177,178,179,29,180,181,182],"tests","cover","verify tests cover changed lines","verify","coverage","pr","exercise","patch","code","share"]