Agentshield

data-ai MCP Server

šŸ›”ļø The security firewall for AI agent tools & MCP servers (Claude 5, GPT-5.6, Gemini 3.8, Antigravity, Cursor, Codex, Hermes). Catch command injection, secret theft & toxic flows in <50ms. 100% offline Rust SAST + 1-click auto-fix + SARIF.

VerifiedFresh
data-aidata-ai
2 views19 stars2 forksNOASSERTION

Why This Matters

Discovered via github-topic:mcp and last synced 5d ago.

VerifiedFresh
Source
github-topic:mcp
Stars
19
Last synced
5d ago
Install
Check source

Install

Install instructions not detected yet

Check the source repository for the latest setup steps.

View source instructions
64
Tools
0
Resources
0
Prompts
Standard I/O
Transport

Available Tools (64)

calculate

Math expression evaluator (`2^10 + sqrt(144)`)

OLLAMA_URL

`http://localhost:11434`

AGENTSHIELD_ALLOW_HTTP_WEBHOOK

`false`

State

Transport CB

get_time

Current time in any timezone

LLM_PROVIDER

`ollama`

AGENTSHIELD_ALLOW_PRIVATE_WEBHOOK

`false`

Tool

Primary coverage

PORT

`8080`

AGENTSHIELD_AUTH_TOKEN

(empty)

Both

open

Normal

closed

Coherence

Cosine similarity to prompt via embeddings

Default

Purpose

MCP_URL

(empty)

OTEL_EXPORTER_OTLP_TIMEOUT

`10s`

closed

**failing**

Signal

Method

Component

Source

OPENAI_FALLBACK_MODEL

`gpt-4o-mini`

OTEL_EXPORTER_OTLP_ENDPOINT

(empty)

Repetition

Trigram deduplication — detects looping responses

20

During a chaos scenario: **100 → 41 → 78 → 95**. Judges can watch the number recover in real-time as each component heals. --- ## Cost Savings Tracks estimated token costs per tier and computes savings. ``` Primary (llama3.2): $0.0018 spent Fallback (llama3.2:1b): $0.0004 spent (67% cheaper per token) Cache: $0.0000 spent Saved by cache: $0.0022 (would have cost primary rate) Saved by fallback: $0.0003 (delta vs primary rate) Total saved: $0.0025 (52% savings rate) ``` --- ## Per-Request Resilience Trace Every `Ask()` and `React()` generates a trace showing exactly what happened: ```json GET /trace/tr_a1b2c3d4 { "id": "tr_a1b2c3d4", "prompt": "explain circuit breakers", "total_ms": 1847, "final_tier": "fallback", "steps": [ { "tier": "primary", "latency_ms": 1230, "transport_cb": "closed", "semantic_cb": "failing", "quality_score": 0.18, "quality_signals": ["repetition", "refusal_marker"], "outcome": "semantic_failure" }, { "tier": "fallback", "latency_ms": 617, "transport_cb": "closed", "semantic_cb": "healthy", "quality_score": 0.91, "outcome": "success" } ] } ``` Trace ID is included in every response. Clickable `šŸ“‹ trace` link in the dashboard. --- ## Webhook Notifications Configure a webhook to receive alerts when circuit breaker states change: ```bash POST /config/webhook {"url": "https://your-ops-system/alert"} ``` Payload on state change: ```json { "event": "semantic_cb_failing", "model": "primary", "prev_state": "degraded", "new_state": "failing", "reason": "rolling avg quality 38% < failing threshold 45%", "avg_quality": 0.38, "timestamp": "2026-04-30T14:32:01Z" } ``` --- ## Streaming Quality Gate `GET /chat/stream` streams tokens via SSE with an inline quality gate. If refusal/persona-leak markers are detected in the first 120 tokens, the stream aborts and continues from fallback — automatically. ``` [token1][token2]...[token47] ← from primary ⚔ quality gate triggered at token 47 — switching to fallback [token1][token2]... ← from fallback ``` --- ## Quick Start ### Local Ollama (free, default) ```bash # 1. Install Ollama brew install ollama # 2. Pull models (~4GB total) ollama pull llama3.2 ollama pull llama3.2:1b ollama pull nomic-embed-text # for semantic cache + quality coherence # 3. Start Ollama ollama serve # 4. Run AgentShield OLLAMA_URL=http://localhost:11434 go run . # 5. Open dashboard open http://localhost:8080 ``` ### Hosted OpenAI-compatible backend Any provider speaking the `/v1/chat/completions` contract works — OpenAI, Groq, Together, OpenRouter, vLLM, Mistral, llama.cpp's server. ```bash export LLM_PROVIDER=openai export OPENAI_API_KEY=sk-... export OPENAI_BASE_URL=https://api.openai.com/v1 # or api.groq.com/openai/v1 export OPENAI_PRIMARY_MODEL=gpt-4o-mini export OPENAI_FALLBACK_MODEL=gpt-4o-mini # cheaper model is the safety net # Optional: keep embeddings on local Ollama (free) or run them through OpenAI: # export OPENAI_EMBED_MODEL=text-embedding-3-small go run . ``` ## Configuration

OPENAI_EMBED_MODEL

(empty)

OTEL_EXPORTER_OTLP_INSECURE

`true`

search_docs

Searches embedded resilience knowledge base

OPENAI_API_KEY

—

AGENTSHIELD_TRUSTED_PROXIES

(empty)

check_system

Returns live AgentShield metrics

OPENAI_BASE_URL

`https://api.openai.com/v1`

LOG_LEVEL

`info`

OPENAI_PRIMARY_MODEL

`gpt-4o-mini`

Scenario

Naive useful%

LOG_FORMAT

`text`

Language

Parser

Shell

Regex parser

Area

What AgentShield does

Detection

37 built-in contextual rules plus a declarative YAML custom rule engine (`.agentshield/rules/*.yaml`).

Boundary

AgentShield is not a hosted monitoring service, runtime sandbox, or allowlist marketplace. Experimental runtime guard entrypoints are available behind opt-in feature flags; the stable contract is static scanning plus policy evaluation.

Ecosystem

How AgentShield helps

CrewAI

Supported

CodeQL

General SAST for code vulnerabilities and quality issues

Gitleaks

Hardcoded secrets across Git history and source files

Semgrep

Custom SAST rules, language-specific checks, SCA, and security policy

AgentShield

MCP, agent tools, prompt surfaces, filesystem/network/process capabilities, egress policy, SARIF, and runtime guard experiments

Feature

AgentShield

Yes

No

Regex-oriented

Runtime/cloud-oriented

Framework

Status

Supported

Cursor rule files and related agent guidance surfaces

OpenClaw

Supported

Command

Purpose

Format

Flag

Console

`--format console`

JSON

`--format json`

SARIF

`--format sarif`

HTML

`--format html`

Code

Meaning

0

Scan passed with no findings above threshold

1

Scan failed with findings above threshold

2

Scan error (e.g., invalid config); no supported adapter found is surfaced as scanner error and can be controlled by action `strict` mode

3

Runtime guard blocked or failed closed on invalid runtime input

Python

Regex parser with source/sink patterns

MCP-focused

MCP-focused