0Pricing
MCP Academy · درس

الوصول إلى الأدوات بأقل الصلاحيات

امنحوا كل أداة الصلاحيات التي تحتاج إليها فعلًا فقط.

الوصول إلى الأدوات بأقل الصلاحيات درس مجاني في MCP Academy على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في 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/7) وفتح باقي دورة MCP Academy، انتقل إلى CoddyKit PRO. تتضمن دورة MCP Academy 4 دروس في المجموع.

ماذا ستتعلم في «الوصول إلى الأدوات بأقل الصلاحيات»؟

امنحوا كل أداة الصلاحيات التي تحتاج إليها فعلًا فقط. تتمرن على MCP Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ MCP Academy؟

لا تُشترط خبرة سابقة. MCP Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.

كم من الوقت يستغرق درس «الوصول إلى الأدوات بأقل الصلاحيات»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس MCP Academy هذا؟

نعم. كل درس في MCP Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. التهديدات الفريدة في MCP
  2. الوصول إلى الأدوات بأقل الصلاحيات
  3. التحقق من كل شيء وتنقيته
  4. حماية الإجراءات المدمّرة
← العودة إلى MCP Academy