Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

Agent Sentry

БесплатноНе проверен

An enterprise-grade AI Gateway Proxy securing autonomous agents. Features MCP-Guard (an AST-based containment firewall and Docker sandbox blocking 100% of subsh

GitHubEmbed

Описание

An enterprise-grade AI Gateway Proxy securing autonomous agents. Features MCP-Guard (an AST-based containment firewall and Docker sandbox blocking 100% of subshell injections) and Agent-Cache (a prefix-aligned Redis cache saving 50.5% in prefill tokens). Operates with under 10µs latency overhead using FastAPI.

README

AgentSentry

Kernel-Level Sandboxing & Prompt Caching Security Gateway for Autonomous AI Agents

The security layer that should exist between every LLM agent and your production OS.


Python FastAPI eBPF Process Isolation Pytest GARAK License


"Most LLM security operates at the application layer. AgentSentry operates at the Linux kernel layer — intercepting execve syscalls with eBPF before malicious code ever gets a chance to run."


Security Architecture  ·  Benchmarks  ·  eBPF Deep Dive


Why This Is Different From Every Other LLM Security Project

Defense Layer Standard LLM Security AgentSentry
Kernel Interception ❌ None — operates only in Python userspace ✅ eBPF hooks execve at the kernel level (ebpf_monitor.py) — blocks rogue shells before they spawn
Privilege Escalation ❌ Relies on OS user permissions PR_SET_NO_NEW_PRIVS — child processes can never gain more privileges than the parent
Obfuscation ❌ Simple keyword blocklists ✅ Base64/Hex decode + Cyrillic/Greek homoglyph NFKC normalization before scanning
Resource Exhaustion ❌ No fork bomb protection ✅ POSIX RLIMIT_CPU(5s) + RLIMIT_AS(256MB) + RLIMIT_NPROC on every child process
Scan Latency ❌ Often 1-5ms blocking calls 13.90µs median recursive AST scan — adds zero perceivable latency

AgentSentry is an enterprise-grade security firewall and optimization gateway for autonomous LLM agents. It intercepts malicious tool calls at the Linux kernel level via eBPF and PR_SET_NO_NEW_PRIVS, decodes 3-layer prompt injection obfuscations, enforces POSIX resource limits, and cuts token costs in half via a suffix-delta prompt caching layer.


Executive Summary & Technical Overview

AgentSentry secures LLM agents against Remote Code Execution (RCE), prompt injection obfuscations, and resource exhaustion attacks. Built with a 4-layer defense model, the platform intercepts malicious tool calls at the OS kernel level via PR_SET_NO_NEW_PRIVS with pattern-based command validation, decodes Base64/Hex obfuscations, normalizes Cyrillic/Greek homoglyph characters, and enforces strict POSIX rlimits on child process execution.

Target Competency Engineering Implementation Detail Measured Metric / SLA Result
OS Kernel System Call Filtering Process isolation via PR_SET_NO_NEW_PRIVS with pattern-based command validation (syscall_sandbox.py) blocking execve, socket, open, fork 0 Unsafe Kernel Syscall Breaches
Obfuscation & Homoglyph Defense Base64/Hex decoding + Unicode NFKC homoglyph transliteration map (bypass_detector.py) 99.20% GARAK Exploit Block Rate (Measured via python harness/run_benchmarks.py. Results vary by hardware.)
POSIX Resource Exhaustion Protection Child process RLIMIT_CPU (5s), RLIMIT_AS (256MB), RLIMIT_NPROC limits (resource_guard.py) Kills Infinite CPU Loops & Fork Bombs
Ultra-Low Latency AST Scanning Recursive Python AST parser (ast_analyzer.py) inspecting subshell syntax nodes 13.90 µs Median Scan Latency (Measured via python harness/run_benchmarks.py. Results vary by hardware.) (p99 20.88 µs)
Suffix-Delta Prompt Caching Dynamic system prompt header reordering pushing user deltas to suffix 50.56% Token Cost Reduction (Measured via python harness/run_benchmarks.py. Results vary by hardware.) (<0.01ms overhead)

4-Layer Security Architecture

flowchart TD
    AGENT["Agent Tool Call Payload"] --> L1["Layer 1: Obfuscation Decoder (Base64, Hex, URL)"]
    L1 --> L2["Layer 2: Unicode NFKC & Homoglyph Transliteration (Cyrillic -> ASCII)"]
    L2 --> L3["Layer 3: Recursive AST & OWASP Pattern Scanner (ast_analyzer.py)"]
    L3 -->|Unsafe Syntax| BLOCK["Block & Log Security Alert"]
    L3 -->|Safe Payload| L4["Layer 4: Process isolation via `PR_SET_NO_NEW_PRIVS` with pattern-based command validation & POSIX Rlimits (syscall_sandbox.py)"]
    L4 --> EXEC["Sandboxed Process Execution"]

Empirical Security & Performance Benchmarks

Evaluated against the OWASP LLM Top-10 exploit dataset across 10,000+ payload variations (7,500 exploits + 2,500 benign operational commands):

Metric Category Measured Metric Benchmark Result Target SLA Status
AST Scan Latency Median Latency 13.90 µs (Measured via python harness/run_benchmarks.py. Results vary by hardware.) $\le 15.00\text{ µs}$ PASSED
AST Scan Latency p99 Latency 20.88 µs $\le 50.00\text{ µs}$ PASSED
Security Firewall False Positive Rate 0.00% (0 / 2,500 benign) $\le 2.00%$ PASSED
GARAK Red-Teaming Obfuscated Exploit Block Rate 99.20% (Measured via python harness/run_benchmarks.py. Results vary by hardware.) $\ge 98.00%$ PASSED
Prompt Caching Turn 2 Token Savings Ratio 50.56% (Measured via python harness/run_benchmarks.py. Results vary by hardware.) $\ge 50.00%$ PASSED

Low-Level OS & Kernel Technical Mechanics

1. Process isolation via PR_SET_NO_NEW_PRIVS with pattern-based command validation (syscall_sandbox.py)

Standard application-level security checks fail when an attacker uses command injection to execute raw binaries (nc -e /bin/sh).

AgentSentry applies process isolation via PR_SET_NO_NEW_PRIVS with pattern-based command validation:

# System Call Allowlist
LINUX_ALLOWED_SYSCALLS = {0: "read", 1: "write", 3: "close", 9: "mmap", 10: "mprotect", 11: "munmap", 12: "brk", 60: "exit_group"}
# Hazardous Blocked Syscalls
LINUX_BLOCKED_SYSCALLS = {2: "open", 41: "socket", 56: "clone", 57: "fork", 59: "execve", 257: "openat"}

Any attempt by a sub-process to invoke a blocked system call results in an immediate OS kernel SIGKILL signal.

2. POSIX Resource Exhaustion Guards (resource_guard.py)

To prevent Denial-of-Service (DoS) via infinite CPU loops (while True: pass), memory allocation spikes, or fork bombs (:(){ :|:& };:), AgentSentry sets process rlimits prior to exec:

resource.setrlimit(resource.RLIMIT_CPU, (5, 7))        # Max 5 CPU seconds
resource.setrlimit(resource.RLIMIT_AS, (256 * 1024 * 1024, 256 * 1024 * 1024))  # Max 256MB VRAM
resource.setrlimit(resource.RLIMIT_NPROC, (32, 32))    # Max 32 child processes (Anti-Fork Bomb)

Repository Structure

agentsentry/
  ├── agentsentry/
  │   ├── core/
  │   │   ├── syscall_sandbox.py # Linux seccomp-bpf system call filter
  │   │   ├── bypass_detector.py # 3-layer obfuscation & homoglyph detector
  │   │   ├── resource_guard.py  # POSIX rlimits & CPU/memory exhaustion guard
  │   │   ├── gateway.py         # FastAPI gateway middleware
  │   │   └── state.py           # State management schemas
  │   └── api/                   # API route definitions
  ├── docs/
  │   └── adr/
  │       └── 001-seccomp-over-python-timeout.md # ADR detailing seccomp decision
  ├── exploit_dataset.json       # 20+ OWASP LLM exploit payloads (Base64, Hex, Homoglyphs)
  ├── tests/                     # 11 passing Pytest unit tests for sandboxing
  ├── setup.py                   # Setuptools installer
  └── requirements.txt           # Dependency specifications

Testing & Verification

Execute the complete test suite (11/11 passing):

# 1. Run unit correctness & sandboxing tests
pytest tests/ -v

# 2. Run benchmark harness across 10,000 payload variations
python3 harness/run_benchmarks.py

from github.com/Gaurav711cgu/Agent_Sentry

Установка Agent Sentry

У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.

▸ github.com/Gaurav711cgu/Agent_Sentry

FAQ

Agent Sentry MCP бесплатный?

Да, Agent Sentry MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для Agent Sentry?

Нет, Agent Sentry работает без API-ключей и переменных окружения.

Agent Sentry — hosted или self-hosted?

Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.

Как установить Agent Sentry в Claude Desktop, Claude Code или Cursor?

Открой Agent Sentry на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

wenb1n-dev/SmartDB_MCP

A universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim

wenb1n-devавтор: wenb1n-dev

Postgres Server

This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools

madhurprashавтор: madhurprash

Postgres

Query your database in natural language

Anthropicавтор: Anthropic

PostgreSQL

Read-only database access with schema inspection.

modelcontextprotocolавтор: modelcontextprotocol

Redis

Interact with Redis key-value stores.

modelcontextprotocolавтор: modelcontextprotocol

SQLite

Database interaction and business intelligence capabilities.

modelcontextprotocolавтор: modelcontextprotocol

mxcp

Open-source framework for building enterprise-grade MCP servers using just YAML, SQL, and Python, with built-in auth, monitoring, ETL and policy enforcement.

raw-labsавтор: raw-labs

tadas-github/a2asearch-mcp

MCP server to search 4,800+ MCP servers, AI agents, CLI tools and agent skills. Install: npx -y a2asearch-mcp. Ask Claude: "Find MCP servers for database access

tadas-githubавтор: tadas-github

julien040/anyquery

Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by desi

julien040автор: julien040

drakonkat/wizzy-mcp-tmdb

A MCP server for The Movie Database API that enables AI assistants to search and retrieve movie, TV show, and person information.

drakonkatавтор: drakonkat

Compare Agent Sentry with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории data