最小権限のツールアクセス
各ツールに本当に必要な権限だけを付与します。
「最小権限のツールアクセス」はCoddyKit上の無料MCP Academyレッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはMCP Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 MCP Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
The Principle
Least privilege means each tool gets only the permissions its job requires, and nothing more. If a tool is tricked, the blast radius stays small. 🔒
Narrow the Scope
A tool that reads one report folder should not be able to touch the whole disk. Give it the smallest scope that still gets the work done, then stop there.
Read vs Write
Split read and write into separate tools when you can. A read-only tool that gets injected can leak data, but it cannot quietly change or delete anything.
Scope Credentials, Not Just Tools
Privilege also lives in the token your server holds. Use a database role or API key scoped to exactly the operations needed, so a slip cannot reach unscoped resources.
A Read-Only Tool
This tool can only look up an order, never modify one. The function body defines the ceiling on what the model can do through it.
@mcp.tool()
def get_order(order_id: int) -> str:
"Read one order by id."
return db.fetch_order(order_id)Avoid the God Tool
One run_anything tool that executes arbitrary code or SQL hands the model total control. Prefer many narrow tools with fixed, predictable behavior instead.
Allowlists Over Blocklists
Decide what is permitted, not what is forbidden. An allowlist of safe operations is far easier to reason about than trying to enumerate every dangerous one.
Constrain the Filesystem
If a tool reads files, pin it to one base directory and reject paths that escape it. A bounded root stops a tool from wandering into system files.
Separate Tools by Sensitivity
Keep low-risk lookups apart from high-risk actions. You can then apply stricter checks and confirmation to only the sensitive tools that truly need them.
Per-User Authorization
The server, not the model, decides who may do what. Check the caller's identity before acting so a tool cannot reach data outside that user's permissions.
Default Deny
Start every new tool from the assumption that it can do nothing, then grant exactly what it needs. A default-deny stance keeps accidental power from creeping in.
Quick Check
Pick the design that best follows least privilege.
Recap
Give each tool the smallest scope, split read from write, scope your credentials, and default to deny. Least privilege keeps any single mistake contained. ✅
よくある質問
「最小権限のツールアクセス」レッスンは無料ですか?
はい。「最小権限のツールアクセス」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、MCP Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 MCP Academyコースには全4レッスンが含まれています。
「最小権限のツールアクセス」で何を学びますか?
各ツールに本当に必要な権限だけを付与します。 ブラウザで直接実行するハンズオンコードでMCP Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
MCP Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのMCP Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。
「最小権限のツールアクセス」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このMCP Academyレッスンでコードを書いて実行できますか?
はい。すべてのMCP Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- MCP特有の脅威
- 最小権限のツールアクセス
- すべてを検証してサニタイズする
- 破壊的な操作を保護する