crabtrap-llm-proxy
БесплатноБез исполняемых скриптовНе проверенLLM-as-a-judge HTTP/HTTPS proxy that secures AI agents by intercepting and evaluating outbound requests against security policies before they reach external…
от reason-machines★ 99 звёзд на GitHubОб этом скилле
CrabTrap LLM Proxy
Skill by ara.so — Daily 2026 Skills collection.
CrabTrap is a transparent HTTP/HTTPS forward proxy that sits between AI agents and external APIs. Every outbound request is intercepted, checked against deterministic static rules, then evaluated by an LLM judge against a natural-language security policy. Blocked requests return a 403 with a reason; all decisions are logged to PostgreSQL.
Architecture Overview
Agent → CrabTrap Proxy (:8080) → [Static Rules] → [LLM Judge] → External API
↓
Admin UI (:8081)
↓
PostgreSQL
Key concepts:
- Static rules — deterministic prefix/exact/glob URL matching, checked first (no LLM call)
- LLM judge — natural-language policy evaluated only when no static rule matches
- Audit log — every request, decision, and response stored in PostgreSQL
- SSRF protection — blocks RFC 1918, loopback, link-local, and other private ranges
Installation
Docker Compose (Recommended)
# docker-compose.yml
services:
crabtrap:
image: quay.io/brexhq/crabtrap:latest
ports:
- "8080:8080" # proxy
- "8081:8081" # admin UI
environment:
- DATABASE_URL=postgres://crabtrap:password@postgres:5432/crabtrap
- OPENAI_API_KEY=${OPENAI_API_KEY}
volumes:
- ./config/gateway.yaml:/app/config/gateway.yaml
depends_on:
- postgres
postgres:
image: postgres:16
environment:
POSTGRES_USER: crabtrap
POSTGRES_PASSWORD: password
POSTGRES_DB: crabtrap
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
pgdata:
docker compose up -d
# Copy the generated CA certificate (needed for HTTPS interception)
docker compose cp crabtrap:/app/certs/ca.crt ./ca.crt
Initial Setup
# Create an admin user and capture the token
admin_token=$(docker compose exec -it crabtrap ./gateway create-admin-user my-admin \
| tail -n1 | cut -d" " -f2)
# Create an agent user (returns a gateway_auth_token)
token=$(curl -X POST http://localhost:8081/admin/users \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${admin_token}" \
-d '{"id": "[email protected]", "is_admin": false}' \
| jq -r '.channels[] | select(.channel_type == "gateway_auth") | .gateway_auth_token')
echo "Agent proxy token: $token"
# Test the proxy
curl -x "http://${token}:@localhost:8080" \
--cacert ca.crt \
https://httpbin.org/get
Configuration
Full Configuration Reference
# config/gateway.yaml
proxy:
port: 8080
read_timeout: 30s
write_timeout: 30s
idle_timeout: 120s
rate_limit:
requests_per_second: 50
burst: 100
# CIDR ranges allowed even though they're private (e.g. internal APIs)
ssrf_allowlist:
- "10.0.0.0/8" # only if you explicitly need internal access
tls:
ca_cert_path: /app/certs/ca.crt
ca_key_path: /app/certs/ca.key
cert_cache_size: 10000 # per-host cert cache
approval:
mode: llm # "llm" or "passthrough"
timeout: 30s
llm_judge:
provider: openai
model: gpt-4o
fallback_mode: deny # "deny" or "passthrough" when LLM unavailable
circuit_breaker:
failure_threshold: 5
reset_timeout: 10s
database:
url: ${DATABASE_URL} # supports env var expansion
audit:
output: stderr # "stderr", "stdout", or a file path like "/var/log/crabtrap.json"
log_level: info # debug | info | warn | error
Environment Variables
DATABASE_URL=postgres://user:password@host:5432/dbname
OPENAI_API_KEY=sk-... # if using OpenAI as LLM judge
ANTHROPIC_API_KEY=sk-ant-... # if using Anthropic
CLI Commands
# Start the proxy
./gateway serve --config /app/config/gateway.yaml
# Create an admin user (outputs web token on last line)
./gateway create-admin-user <username>
# Run database migrations
./gateway migrate
# Replay audit log entries against a policy (eval mode)
./gateway eval --policy-id <id> --limit 100
Admin API
All admin endpoints require Authorization: Bearer <admin_token>.
User Management
# List all users
curl http://localhost:8081/admin/users \
-H "Authorization: Bearer ${admin_token}"
# Create a user
curl -X POST http://localhost:8081/admin/users \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${admin_token}" \
-d '{
"id": "[email protected]",
"is_admin": false
}'
# Delete a user
curl -X DELETE http://localhost:8081/admin/users/[email protected] \
-H "Authorization: Bearer ${admin_token}"
Static Rules
# List static rules for a user
curl "http://localhost:8081/admin/users/[email protected]/rules" \
-H "Authorization: Bearer ${admin_token}"
# Create an allow rule (prefix match)
curl -X POST "http://localhost:8081/admin/users/[email protected]/rules" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${
Установить crabtrap-llm-proxy в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл crabtrap-llm-proxy?
LLM-as-a-judge HTTP/HTTPS proxy that secures AI agents by intercepting and evaluating outbound requests against security policies before they reach external APIs.
Как установить скилл crabtrap-llm-proxy?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл crabtrap-llm-proxy запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic