Skip to main content
Glama
TopskiyPavelQwertyGang

MCP Secure Agents

MCP Secure Agents

Практический репозиторий про безопасных AI-агентов: минимальные права, allowlist, валидация, Human-in-the-Loop и sandbox.

Цель: показать, что модель может ошибаться — но система не обязана позволять ей выполнить опасное действие.

Что здесь есть

  • защищённый MCP-agent для анализа уязвимостей;

  • read-only доступ к данным;

  • allowlist разрешённых инструментов;

  • блокировка WRITE / DELETE / shell-команд;

  • валидация входных параметров;

  • Human-in-the-Loop для чувствительных действий;

  • журналирование решений и блокировок;

  • простой policy engine, который легко расширять.

Related MCP server: mcp-audit-server

Главная идея

USER → AGENT → POLICY → TOOL → RESULT
                    ↓
                 BLOCK

Агент может решить, что ему нужен инструмент. Но перед выполнением запрос проходит через политику безопасности.

Демо-сценарий

Пользователь просит:

Проверь уязвимости пакета freerdp3

Агенту разрешено:

READ package info
READ CVE database
CALL allowed API

Если агент попробует сделать:

UPDATE vulnerabilities SET status='fixed';

он получит:

BLOCKED
reason: write_database is not allowed

Это и есть главный security boundary: не просьба в system prompt, а технически enforced policy.

Быстрый старт

Требования

  • Python 3.10+

  • uv или pip

Установка

git clone https://github.com/TopskiyPavelQwertyGang/mcp-secure-agents.git
cd mcp-secure-agents
uv sync

Или:

python -m venv .venv
source .venv/bin/activate
pip install "mcp[cli]" pydantic

Запуск демо policy engine

uv run python demo.py

Запуск MCP server

uv run mcp dev server.py

Структура

.
├── README.md
├── QUICKSTART.md
├── demo.py
├── server.py
├── policy.py
├── validators.py
├── audit.py
├── pyproject.toml
├── policies/
│   └── agent-policy.yaml
├── examples/
│   ├── allowed.json
│   └── blocked.json
└── docs/
    ├── threat-model.md
    └── controls.md

Security controls

1. Allowlist

Только явно разрешённые инструменты доступны агенту.

2. Permissions

Каждый инструмент получает минимально необходимые права.

3. Validation

Параметры tool-call проходят проверку до выполнения.

4. HITL

Чувствительные операции требуют подтверждения человека.

5. Sandbox

Опасные действия должны выполняться в изолированной среде.

Что попробовать руками

  1. Запустите demo.py.

  2. Посмотрите разрешённые действия.

  3. Попробуйте write_database — получите блокировку.

  4. Измените policies/agent-policy.yaml.

  5. Повторите запуск и посмотрите, как меняется поведение агента.

Learning path

  1. mcp-protocol-guide — понять MCP.

  2. mcp-secure-agents — научиться безопасно давать агентам инструменты.

  3. mcp-use-cases — перейти к рабочим сценариям.

Важно

Этот проект — учебный security lab. Не используйте demo-policy как готовую production-защиту без адаптации под вашу инфраструктуру, модель угроз, IAM и процессы аудита.


Prompt ≠ Security Boundary

Безопасность должна обеспечиваться не обещанием модели, а архитектурой системы.

F
license - not found
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A security-hardened MCP server that enables AI models to safely interact with Obsidian vaults through sandboxed file operations and todo tracking. It implements strict validation layers and resource limits to protect the local filesystem from potentially hostile tool calls.
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    This MCP server enables security auditing for MCP configurations and AI agents, including prompt injection testing, data flow tracing, and security policy generation.
    106
    MIT

View all related MCP servers

Related MCP Connectors

  • Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.

  • Scans MCP servers for tool poisoning, prompt injection and supply chain risks.

  • Static MCP manifest and tool-policy security preflight with signed input-redacted receipts

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TopskiyPavelQwertyGang/mcp-secure-agents'

If you have feedback or need assistance with the MCP directory API, please join our Discord server