{"id":47936050,"url":"https://github.com/sherifkozman/the-red-council","last_synced_at":"2026-04-04T07:42:54.251Z","repository":{"id":336356805,"uuid":"1126119455","full_name":"sherifkozman/the-red-council","owner":"sherifkozman","description":"LLM Adversarial Security Arena — Jailbreak → Detect → Defend → Verify","archived":false,"fork":false,"pushed_at":"2026-04-01T22:42:50.000Z","size":4697,"stargazers_count":13,"open_issues_count":17,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T07:42:51.446Z","etag":null,"topics":["adversarial-testing","gemini","langchain","llm","red-team","security"],"latest_commit_sha":null,"homepage":"https://theredcouncil.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sherifkozman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-01T06:40:29.000Z","updated_at":"2026-04-02T01:08:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sherifkozman/the-red-council","commit_stats":null,"previous_names":["sherifkozman/the-red-council"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sherifkozman/the-red-council","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherifkozman%2Fthe-red-council","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherifkozman%2Fthe-red-council/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherifkozman%2Fthe-red-council/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherifkozman%2Fthe-red-council/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sherifkozman","download_url":"https://codeload.github.com/sherifkozman/the-red-council/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherifkozman%2Fthe-red-council/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31392186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adversarial-testing","gemini","langchain","llm","red-team","security"],"created_at":"2026-04-04T07:42:53.220Z","updated_at":"2026-04-04T07:42:54.240Z","avatar_url":"https://github.com/sherifkozman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/images/logo.jpg\" alt=\"The Red Council\" width=\"600\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eAI Red Team \u0026 Security — Attack. Assess. Patch.\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#\"\u003e\u003cimg src=\"https://img.shields.io/badge/tests-31%20passed-green\" alt=\"Tests\"\u003e\u003c/a\u003e\n  \u003ca href=\"#\"\u003e\u003cimg src=\"https://img.shields.io/badge/coverage-75%25-green\" alt=\"Coverage\"\u003e\u003c/a\u003e\n  \u003ca href=\"#\"\u003e\u003cimg src=\"https://img.shields.io/badge/python-3.11+-blue\" alt=\"Python\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## What is The Red Council?\n\nThe Red Council is an automated adversarial testing platform for Large Language Models. It implements a closed-loop security workflow that identifies vulnerabilities, generates automated defenses, and verifies their effectiveness in real-time.\n\nIt leverages **Gemini 3 Pro** for attack generation, judging, and defense.\n\n### Core Loop\n1.  **Attack**: Red Team agent generates adversarial prompts using a Knowledge Base of 165+ curated artifacts.\n2.  **Judge**: Impartial evaluator scores the target's response for security breaches (secret leakage, policy violations).\n3.  **Defend**: If a breach is detected, the Blue Team agent automatically hardens the target's system prompt.\n4.  **Verify**: The orchestrator re-runs the attack against the hardened model to prove the fix works.\n\n## Key Features\n\n- **Multi-Agent Adversarial Flow**: Orchestrated via LangGraph.\n- **Real-time Battle UI**: Live attack visualization using Next.js 14 and Tailwind.\n- **RAG-Enhanced Attacks**: Knowledge Base curated from HarmBench and PyRIT datasets.\n- **Production API**: Hardened FastAPI backend with SSE streaming.\n- **Universal Configuration**: Support for any LLM endpoint (OpenAI, Anthropic, Vertex, Local).\n- **OpenClaw Integration**: Test OpenClaw agents as a skill ([docs](docs/tutorials/openclaw-integration.md)).\n\n## Quickstart\n\n### Prerequisites\n- Python 3.11+\n- Node.js 18+ (for frontend)\n- Google Cloud credentials (for Vertex AI access)\n\n### Installation\n\n```bash\n# 1. Clone\ngit clone https://github.com/sherifkozman/the-red-council.git\ncd the-red-council\n\n# 2. Setup Backend\npython -m venv venv\nsource venv/bin/activate\n\n# Basic installation (core functionality)\npip install -e .\n\n# Or with framework integrations:\npip install -e \".[langchain]\"      # LangChain integration\npip install -e \".[langgraph]\"      # LangGraph integration\npip install -e \".[mcp]\"            # MCP protocol integration\npip install -e \".[all-frameworks]\" # All framework integrations\n\n# Development dependencies (for contributing)\npip install -e \".[dev]\"\n\n# Seed the knowledge base\npython -m scripts.seed_kb\n\n# 3. Setup Frontend\ncd frontend\npnpm install\n```\n\n### Installation Options\n\nThe Red Council supports optional dependencies for framework integrations:\n\n| Extra | Install Command | Description |\n|-------|-----------------|-------------|\n| Core | `pip install -e .` | Core functionality, UI, and API |\n| langchain | `pip install -e \".[langchain]\"` | LangChain agent integration |\n| langgraph | `pip install -e \".[langgraph]\"` | LangGraph workflow integration |\n| mcp | `pip install -e \".[mcp]\"` | MCP protocol integration |\n| all-frameworks | `pip install -e \".[all-frameworks]\"` | All framework integrations |\n| dev | `pip install -e \".[dev]\"` | Development tools (pytest, ruff, mypy) |\n\n**Note:** Framework extras are optional. The core package works without any framework integration installed.\n\n### Running the Arena\n\n```bash\n# Terminal 1: API Backend\nuvicorn src.api.main:app --port 8000\n\n# Terminal 2: Tactical UI\ncd frontend \u0026\u0026 pnpm dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) to start your first campaign.\n\n## Agent Security Testing (v0.5.0)\n\nThe Red Council v0.5.0 extends beyond pure LLM testing to support **AI Agent Security Testing** using the **OWASP Agentic Top 10** vulnerability framework.\n\n### Agent Testing Features\n\n- **InstrumentedAgent SDK**: Wrap any agent to capture tool calls, memory access, and actions\n- **OWASP Agentic Top 10**: Test for all 10 agent-specific vulnerabilities (ASI01-ASI10)\n- **Framework Integrations**: Native support for LangChain, LangGraph, and MCP protocol\n- **Security Reports**: Detailed vulnerability findings with remediation guidance\n\n### Quick Example\n\n```python\nfrom src.agents.instrumented import InstrumentedAgent\nfrom src.core.agent_schemas import AgentInstrumentationConfig\nfrom src.agents.agent_judge import AgentJudge, AgentJudgeConfig\n\n# 1. Configure instrumentation\nconfig = AgentInstrumentationConfig(\n    enable_tool_interception=True,\n    enable_memory_monitoring=True,\n    divergence_threshold=0.5,\n)\n\n# 2. Wrap your agent\ninstrumented = InstrumentedAgent(my_agent, \"test-agent\", config)\n\n# 3. Run your agent (events are automatically captured)\nwith instrumented:\n    result = instrumented.wrap_tool_call(\"search\", search_func, query=\"test\")\n\n# 4. Evaluate for security vulnerabilities\njudge = AgentJudge()\nscore = judge.evaluate_agent(instrumented.events)\n\nprint(f\"Risk Score: {score.overall_agent_risk}/10\")\nfor violation in score.owasp_violations:\n    if violation.detected:\n        print(f\"  {violation.owasp_category}: {violation.evidence}\")\n```\n\n### Framework Integrations\n\n```python\n# LangChain\nfrom src.integrations import LangChainAgentWrapper\nwrapped = LangChainAgentWrapper.from_agent_executor(my_executor, config)\n\n# LangGraph\nfrom src.integrations import LangGraphAgentWrapper\nwrapped = LangGraphAgentWrapper.from_state_graph(my_graph, config)\n\n# MCP Protocol\nfrom src.integrations import MCPAgentWrapper\nwrapped = await MCPAgentWrapper.from_stdio_server([\"python\", \"server.py\"], config)\n```\n\n### API Endpoints\n\nAgent testing is available via REST API:\n\n```bash\n# Create a testing session\ncurl -X POST http://localhost:8000/api/v1/agent/session \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"context\": \"Agent under test\"}'\n\n# Submit events\ncurl -X POST http://localhost:8000/api/v1/agent/session/{session_id}/events \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"events\": [{\"event_type\": \"tool_call\", \"tool_name\": \"search\", ...}]}'\n\n# Run evaluation\ncurl -X POST http://localhost:8000/api/v1/agent/session/{session_id}/evaluate\n\n# Get security report\ncurl http://localhost:8000/api/v1/agent/session/{session_id}/report\n```\n\nSee [Agent Testing Guide](docs/agent-testing-guide.md) for comprehensive documentation.\n\n## Documentation\n\n- [Quickstart Guide](docs/quickstart.md)\n- [Agent Testing Guide](docs/agent-testing-guide.md) *(New in v0.5.0)*\n- [OpenClaw Integration](docs/tutorials/openclaw-integration.md)\n- [Architecture \u0026 Design](docs/architecture.md)\n- [API Reference](docs/api-reference.md)\n- [Configuration Guide](docs/configuration.md)\n- [Roadmap](ROADMAP.md)\n\n## License\n\nMIT - See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherifkozman%2Fthe-red-council","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsherifkozman%2Fthe-red-council","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherifkozman%2Fthe-red-council/lists"}