Skip to content

docs: add Aegis guardrail provider#24752

Closed
Acacian wants to merge 2 commits intoBerriAI:mainfrom
Acacian:docs/aegis-guardrail
Closed

docs: add Aegis guardrail provider#24752
Acacian wants to merge 2 commits intoBerriAI:mainfrom
Acacian:docs/aegis-guardrail

Conversation

@Acacian
Copy link
Copy Markdown

@Acacian Acacian commented Mar 29, 2026

Summary

  • Add Aegis guardrail provider documentation
    (docs/my-website/docs/proxy/guardrails/aegis.md)
  • Add sidebar entry in sidebars.js

What is Aegis?

Aegis is an open-source governance runtime for AI agents
that provides:

  • Prompt injection detection (107 patterns)
  • PII masking (email, phone, SSN)
  • Policy-as-code (YAML-based)
  • Audit trail

PyPI: https://pypi.org/project/agent-aegis/

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Mar 29, 2026 3:05pm

Request Review

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 29, 2026

CLA assistant check
All committers have signed the CLA.

@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq Bot commented Mar 29, 2026

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing Acacian:docs/aegis-guardrail (6e7ff28) with main (5812053)

Open in CodSpeed

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 29, 2026

Greptile Summary

This is a documentation-only PR that adds a new page for the Aegis open-source guardrail library and a corresponding sidebar entry. The previous version of this PR was revised to address a prior review comment about guardrail: aegis not being registered in LiteLLM's guardrail registry; the current approach correctly drops that config in favour of Aegis's own auto-instrumentation mechanism (monkey-patching litellm.completion/acompletion).

Key observations:

  • No code changes — entirely documentation and sidebar wiring.
  • Integration model is fundamentally different from every other provider in the guardrails/ section. All other listed guardrails integrate via the LiteLLM guardrail registry and config.yaml; Aegis patches litellm at the Python module level instead. This distinction is partially explained in the doc but the downstream implication — that per-request guardrail selection (\"guardrails\": [\"aegis\"]) is not supported — is not mentioned.
  • The LiteLLM Proxy AEGIS_INSTRUMENT=1 usage section is accurate but lacks an explanation of the startup hook mechanism, which users will need if they try to debug why instrumentation doesn't appear to take effect.
  • No test, security, or backward-compatibility concerns apply (docs only).

Confidence Score: 5/5

Safe to merge — documentation only, no code changes, and the prior critical issue has been resolved

All remaining findings are P2 style suggestions (missing explanatory caveats). The previous P0/P1 concern about a non-functional guardrail: aegis config entry has been addressed by replacing that approach with auto-instrumentation. No runtime behaviour of LiteLLM is affected.

docs/my-website/docs/proxy/guardrails/aegis.md — proxy instrumentation and global-activation caveats could be clearer

Important Files Changed

Filename Overview
docs/my-website/docs/proxy/guardrails/aegis.md Adds Aegis guardrail documentation using auto-instrumentation (monkey-patching) rather than LiteLLM's native guardrail registry — fundamentally different from every other provider in this section; missing caveats about global vs. per-request activation and proxy startup hook mechanism
docs/my-website/sidebars.js Adds proxy/guardrails/aegis entry at the top of the third-party guardrail list; no issues

Sequence Diagram

sequenceDiagram
    participant U as User Code / Proxy
    participant A as Aegis (monkey-patch)
    participant L as litellm.completion (original)
    participant LLM as LLM Provider

    Note over U,A: Startup — aegis.auto_instrument() called
    A->>L: wraps litellm.completion & acompletion

    U->>A: litellm.completion(model, messages)
    A->>A: run guardrails (injection, PII, policy)
    alt Blocked
        A-->>U: raise AegisGuardrailError
    else Allowed
        A->>L: forward call (original completion)
        L->>LLM: API request
        LLM-->>L: response
        L-->>A: response
        A->>A: post-call audit logging
        A-->>U: response
    end
Loading

Reviews (3): Last reviewed commit: "docs: fix non-functional start_proxy.py ..." | Re-trigger Greptile

Comment on lines +29 to +38
guardrails:
- guardrail_name: "aegis-guard"
litellm_params:
guardrail: aegis
mode: "pre_call"
- guardrail_name: "aegis-monitor"
litellm_params:
guardrail: aegis
mode: "pre_call"
on_flagged: "monitor" # Log violations but don't block
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 No backend implementation for guardrail: aegis

The documentation instructs users to configure guardrail: aegis, but this value is not registered anywhere in the LiteLLM codebase. Using this configuration will immediately raise a runtime ValueError rather than working as documented.

The lookup chain in litellm/proxy/guardrails/guardrail_registry.py is:

  1. Check guardrail_initializer_registry (built from SupportedGuardrailIntegrations enum + auto-discovered guardrail_hooks/*/)
  2. Check if guardrail_type contains "." (custom module path)
  3. Otherwise → raise ValueError(f"Unsupported guardrail: {guardrail_type}")

"aegis" is absent from both SupportedGuardrailIntegrations (litellm/types/guardrails.py) and the litellm/proxy/guardrails/guardrail_hooks/ directory. Every user who follows this guide will receive:

ValueError: Unsupported guardrail: aegis

The integration code (a guardrail_hooks/aegis/ module registered under SupportedGuardrailIntegrations.AEGIS) must be merged into LiteLLM before this documentation can be published. If the intent is to use the custom guardrail path (guardrail: aegis_module.AegisGuardrail), the documentation should instead reflect that pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the start_proxy.py code block that was a no-op (called
auto_instrument() then exited without starting the proxy) and promote
the environment variable approach as the sole proxy usage pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants