Concepts

How AI Council works: the six specialized agents, the confidence-weighted voting system, structured debates, and security safeguards.

Agents Overview

AI Council assembles a diverse panel of specialized AI agents.

๐Ÿ‘จโ€๐Ÿ’ป

Senior Developer

Generalist

15+ years of experience. Focuses on maintainability, best practices, readability, testability, and long-term sustainability. Comments on any aspect of the code.

๐Ÿ”’

Security Engineer

Specialist

Identifies security vulnerabilities, authentication issues, SQL injection, XSS, CSRF, and other security concerns. Abstains when code has no security implications.

โšก

Performance Engineer

Specialist

Analyzes algorithmic complexity (O(n), O(log n)), memory usage, caching opportunities, and optimization potential. Abstains for code without performance implications.

๐Ÿ›๏ธ

Software Architect

Specialist

Evaluates design patterns, scalability, separation of concerns, system boundaries, and how code fits into the broader system. Abstains for simple changes.

๐Ÿค–

Gemini Thinker

Challenger

Powered by Google Gemini. Challenges assumptions, reframes problems, identifies edge cases, and provides alternative system-level perspectives.

๐Ÿ› ๏ธ

Pragmatist

Generalist

Balances perfectionism with shipping. Considers deadlines, team velocity, and whether the code effectively solves the problem. Sometimes "good enough" is right.

Voting System

Each agent casts a vote with a confidence score. The system uses these to reach a final decision.

Vote Types

APPROVE

Code meets quality standards and can be merged

REVISE

Code needs improvements before merging

REJECT

Code has fundamental issues that must be addressed

ABSTAIN

Agent defers due to low confidence or irrelevant domain

Confidence Scores

Each vote includes a confidence score from 0.0 to 1.0:

  • 0.8-1.0: High confidence - agent is certain about their assessment
  • 0.5-0.8: Moderate confidence - reasonable certainty
  • < 0.5: Low confidence - agent automatically abstains

Abstention Rules

Agents abstain in two scenarios:

  1. Domain Mismatch: Specialist agents (Security, Performance, Architect) abstain when code doesn't match their domain expertise
  2. Low Confidence: Any agent with confidence below 0.5 automatically abstains

Debate System

When Gemini dissents from the majority, AI Council triggers an automated debate to explore the disagreement.

Debate Flow

  1. Detection: System detects Gemini's vote differs from majority
  2. Escalation: Debate is triggered between Gemini and the strongest majority voice
  3. Rebuttal: Majority agent responds to Gemini's concerns
  4. Counter: Gemini provides final response (maintain, partial concede, or full concede)
  5. Judgment: Judge considers the debate when making final decision
Example Debate Output
โšก Debate escalation: Gemini (REJECT) dissents from majority (APPROVE)

1. senior-dev (DEFEND): The null check on line 42 handles the edge case
   Gemini mentioned. The early return pattern is intentional for...

2. gemini (PARTIAL_CONCEDE): I acknowledge the null check, but maintain
   concern about the async race condition that could still occur when...
๐Ÿ’ก
Why Gemini?

Gemini uses a different AI model (Google's) than other agents. This intentional diversity helps catch edge cases and provides truly alternative perspectives that might be missed by a single AI provider.

Security & Sanitization

AI Council applies multiple layers of input and output sanitization to reduce injection and information-leakage risks.

User Input

All user-provided text is sanitized before use in AI prompts:

  • Null bytes and control characters are stripped
  • Shell command-substitution characters (backticks, $() are removed
  • Line endings are normalized and whitespace is collapsed
  • Input is capped at 10,000 characters

Agent Suggestions

Suggestion output from agents is sanitized before display:

  • Control characters and null bytes are stripped
  • Output is capped at 20,000 characters
  • Suggestions are never executed by the tool; they are for human review only

Error Logging

API keys (OPENAI_API_KEY, GEMINI_API_KEY) are automatically redacted from any error messages written to stderr, preventing accidental credential leakage in logs or CI output.

โš ๏ธ
Important

Agent suggestions are AI-generated and not guaranteed correct or safe. Always review and validate suggestions before applying them to your codebase.

Need Help?

Can't find what you're looking for? Here are some resources: