Skip to content

Built-in Agent: Aegis — Responsible AI Reviewer #1032

Closed

Description

@bradygaster

Summary

Add Aegis as Squad's third built-in agent alongside Scribe and Ralph. Aegis is a Responsible AI (RAI) reviewer that helps teams "start right, stay right" — reviewing work through an RAI lens for content safety, bias, terminology, and ethical patterns.

Like Scribe (memory) and Ralph (work monitoring), Aegis is a foundational capability that ensures every Squad team has RAI awareness from day one. You can't forget to add it — it's always there.

Philosophy

"Guardrail, not wall." Aegis helps fix issues, not just flag them. It's direct, practical, and empowering — never moralizing, never bureaucratic. Every finding includes WHAT's wrong, WHY it matters, and HOW to fix it.

Why Built-In?

RAI concerns are foundational, not optional. Making Aegis built-in means:

  • Every team has RAI awareness from day one
  • No risk of "we forgot to add a reviewer"
  • Normalizes RAI as standard practice, not a special case
  • Aligns with the "start right, stay right" philosophy

Proposed Design

Identity

  • Name: Aegis (always "Aegis" — exempt from casting, like Scribe and Ralph)
  • Emoji: 🛡️
  • Roster entry: | Aegis | RAI Reviewer | .squad/agents/aegis/charter.md | 🛡️ RAI |

Traffic Light Verdict Model

Verdict Meaning Effect
🟢 Green No issues detected Work proceeds
🟡 Yellow Minor concerns, recommendations provided Advisory — work proceeds with suggestions
🔴 Red Critical RAI violation Work CANNOT ship until fixed — triggers Reviewer Rejection Protocol

When Aegis issues a Red, strict lockout semantics apply: original author is locked out, Aegis recommends a fix agent, and provides real-time guidance during revision (pair mode).

Activation Modes

Trigger Behavior
On-demand ("Aegis, review this") Standard agent spawn with RAI focus
Pre-Ship Review ceremony (auto) Spawned before user-facing artifacts finalize
Reviewer rejection on RAI grounds Spawned to guide the fix agent
PR merge check (auto) Final-pass review before merge

Decision Authority

Aegis is advisory by default with escalation:

  • Runs in background mode by default (like Scribe) — non-blocking
  • Only escalates to blocking gate when a 🔴 Critical issue is found
  • Fast-path bypass for low-risk changes (docs-only, test files, dependency bumps)

Files Owned

.squad/
├── agents/
│   └── aegis/
│       ├── charter.md        # Identity, responsibilities, voice
│       └── history.md        # Learnings across sessions
└── rai/
    ├── policy.md             # Canonical RAI policy (terms, anti-patterns, taxonomy)
    └── audit-trail.md        # Evidence log (append-only)

Check Categories (Phase 1 — High-Signal Only)

Starting narrow with checks that have clear, actionable fixes:

Code Review:

  • 🔴 Hardcoded credentials / API keys / secrets
  • 🔴 SQL injection, command injection, path traversal
  • 🟡 PII exposure in logs or responses
  • 🟡 Bias indicators in algorithms (demographic features, proxy attributes)
  • 🟡 Missing rate limiting on user-facing endpoints

Content Review:

  • 🔴 Harmful content patterns (hate speech, violence, self-harm)
  • 🔴 Deceptive content (ungrounded claims, hallucinated citations)
  • 🟡 Exclusionary language (gendered, ableist, culturally assumptive terms)

Prompt/Charter Review:

  • 🔴 Instructions that bypass safety guidelines
  • 🟡 Insufficient grounding for factual claims
  • 🟡 Privacy/security risks in prompt design

Decision Review:

  • 🟡 Unintended consequences (privacy regressions, accessibility impacts)
  • 🟡 Stakeholder exclusion in design decisions

Project Type Awareness

Aegis calibrates based on what you're building:

Project Type Detection Signal Check Suite
AI/ML project OpenAI SDK, LangChain, model configs Full RAI suite
Web application Express, Next.js, React Security + privacy + content
CLI tool No web framework, command-line focused Credential leaks + minimal
Static site HTML/CSS only, no backend Accessibility + content only
Infrastructure Terraform, Bicep, Docker Credential leaks only

Non-AI projects get minimal mode — high-signal checks without advisory noise.

Risk Mitigations

These were identified through team review and are required for launch:

Risk Mitigation
False positives Track dismissal rate; auto-disable checks with >30% false positive rate
Performance Background mode default; 5-second budget cap; timeout = approve (fail-open)
Scope creep Strict charter; Phase 1 = high-signal only; sunset low-value checks
Boy who cried wolf Every flag must include WHAT/WHY/HOW — no generic advice
Non-AI project noise Project type detection; minimal mode for non-AI
Reviewer conflict RAI is ethics specialist, NOT general QA; runs before human Reviewer
Opt-out pressure Tiered: can't disable Critical, can disable Advisory

Opt-Out Model (Tiered, Not Binary)

  • Can't disable 🔴 Critical checks (credential leaks, hate speech)
  • Can disable 🟡 Advisory checks with justification
  • Temporary opt-down supported (auto re-enables)

Integration Points in squad.agent.md

  • Add Aegis section after Ralph (identity, triggers, ceremonies, files owned)
  • Add casting exemption
  • Add to Init Mode roster proposal
  • Add 🛡️ to role emoji table
  • Add Aegis routing signals to routing table
  • Add .squad/rai/* to Source of Truth hierarchy
  • Update .gitattributes template

New Files

  • templates/aegis-charter.md
  • templates/rai-policy.md (default RAI policy template)
  • Ceremony definitions: Pre-Ship Review + RAI Fix Guidance
  • Aegis spawn prompt template

Implementation Phases

Phase 1: Core

  • Add Aegis to squad.agent.md governance
  • Create charter template + default RAI policy
  • Implement high-signal check suite only
  • Background mode default

Phase 2: Ceremonies

  • Pre-Ship Review auto-trigger
  • RAI Fix Guidance ceremony (pair mode after rejection)
  • Integration with existing Reviewer Rejection Protocol

Phase 3: Intelligence

  • Project type detection and check suite calibration
  • False positive tracking and auto-disable
  • Learn from user dismissals

Phase 4: Expansion

  • Expand check suite based on real-world usage data
  • Community-contributed check patterns
  • Context-aware severity (test files get lower thresholds)

Success Metrics (measure after 3 months)

Metric Target
Adoption >80% of teams run RAI (not opted out)
Signal quality <20% false positive rate
Performance <3 second average review time
Impact >0 critical issues caught that would have shipped

Kill Criteria

Abort if after tuning:

  • False positive rate >40%
  • Average review time >10 seconds
  • 50% of teams opt out within first month

  • Zero critical issues found in first 100 reviews

Context

This came from conversations with RAI experts about making Responsible AI a first-class concern in Squad — not an afterthought. The core insight: RAI should be as automatic as memory (Scribe) and work monitoring (Ralph). Teams shouldn't have to remember to think about RAI — it should be baked in.

The name "Aegis" (protective shield) captures the philosophy: protection that enables, not restricts.


Filed by the Squad team. Three agents collaborated on this proposal: architecture design, RAI pattern extraction, and critical risk review.

Activity

  1. added a commit that references this issue on May 21, 2026
    9886742
  2. added a commit that references this issue on May 26, 2026
    6a01eef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions