# Agent Tool Security Least Privilege

> Implement least-privilege tool gating and injection containment for secure multi-agent systems.

Agent Tool Security Least Privilege is a paid AI agent skill on Agensi by Mohamed Mostafa Metawea, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $12.99 (one-time purchase)
- Creator: [Mohamed Mostafa Metawea](https://www.agensi.io/creators/mohamed-mostafa-metawea)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Version: 1.0
- Last updated: 2026-12-01
- Security: scan passed (2026-11-30); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/agent-tool-security-least-privilege
- Tags: ai-agents, security, prompt-engineering, api

## About this skill

Secure a tool-calling agent at the permission layer: least-privilege tool lists per role, a privileged set that can never be granted, untrusted-content wrapping for emails and web results, and limits on what injected text can cause. It comes from a small Python reference app (AI Office) and was checked against that code and its tests.

### What it does
- Gives each role only the tools it needs; other calls are refused and logged.
- Keeps a privileged set of tools that cannot be granted to an agent.
- Wraps emails and web content as untrusted data and says so in the system prompt.
- Limits what content can cause, for example search results can change text an agent writes but not which tools it may use.
- Adds server-side hygiene such as a request body size limit (64 KB in the reference app).

### How it works
Each rule is written out with the reasoning and what the reference tests do and do not prove.

### Frameworks & tools
Plain Python with the standard library. A written playbook, not an installable package.

### Use cases
- Hardening an agent that reads email or browses the web.
- Reviewing which tools each agent role really needs.

### Known limitations
It contains agents at the tool boundary. It does not stop a model from being fooled into writing bad text, and it does not sanitize what the model reads.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Agent Tool Security Least Privilege skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What specific security problems does this skill solve for multi-agent systems?

This skill prevents agents from escalating their own permissions or following malicious commands hidden in external data. It solves the problem of soft defenses where system prompts fail to stop sophisticated injection attacks when processing emails or web results.

### What specific security outputs and formats are included in this skill?

You receive a code-verified architecture that defines grantable versus privileged tool sets and implements runtime permission checks. It also includes methods for tagging untrusted data and structural limits that prevent agents from performing unauthorized actions like composing emails to arbitrary addresses.

### What software or accounts are required to use this security architecture?

To use this skill, you only need an AI agent capable of tool calling and a runtime environment that can implement permission checks. The skill uses standard security patterns like bearer token authentication and server-side headers like nosniff and no-store.

### What are the known limitations of this security model?

This skill assumes a human reviewer will actually inspect payloads that are held for approval. While it successfully contains agents at the tool boundary, it does not sanitize content that a human ultimately chooses to approve or prevent models from writing misleading summaries.

### How should I instruct my agent to use this skill?

You can ask your agent to apply least-privilege tool gating to your system or to implement untrusted data wrapping for search results. You can also direct it to configure the privileged tool set to ensure specific capabilities can never be granted via automated flows.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
