docs: add Aegis to third-party capabilities#4888
Conversation
acb4d42 to
4ccb564
Compare
|
|
||
| ### Governance & Safety | ||
|
|
||
| * [`agent-aegis`](https://github.com/Acacian/aegis) -- Auto-instruments Pydantic AI agents with governance guardrails: prompt injection detection, PII masking, policy-as-code (YAML), and audit trail. Setup: `aegis.auto_instrument()`. |
There was a problem hiding this comment.
🚩 Package name in link text does not match GitHub repo name
All existing third-party capability entries use a link text that matches the GitHub repository name (e.g., pydantic-ai-shields → vstorm-co/pydantic-ai-shields, pydantic-ai-skills → DougTrajano/pydantic-ai-skills). The new entry uses agent-aegis as the link text but links to https://github.com/Acacian/aegis where the repo is named aegis, not agent-aegis. This could be intentional if the PyPI package name is agent-aegis while the repo is aegis, but it's a departure from the pattern of other entries and could confuse users trying to find the package on GitHub vs PyPI. Worth verifying whether the pip-installable name is indeed agent-aegis.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
@Acacian It doesn't look like those features are actually exposed as Pydantic AI capabilities? |
|
@DouweM Good point — you're right, the previous version used monkey-patching ( I've updated this: Aegis now ships from pydantic_ai import Agent
from aegis.contrib.pydantic_ai import AegisCapability
from aegis.guardrails import GuardrailEngine, InjectionGuardrail
engine = GuardrailEngine()
engine.add(InjectionGuardrail())
agent = Agent(
"openai:gpt-4o-mini",
capabilities=[AegisCapability(engine)],
)Also supports |
Implements pydantic_ai.capabilities.AbstractCapability so Aegis guardrails run as a first-class Pydantic AI capability via before_model_request / after_model_request lifecycle hooks — no monkey-patching required. Addresses pydantic/pydantic-ai#4888 reviewer feedback. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
|
||
| ### Governance & Safety | ||
|
|
||
| * [`agent-aegis`](https://pypi.org/project/agent-aegis/) ([source](https://github.com/Acacian/aegis)) -- `AegisCapability` implements `AbstractCapability` to enforce governance guardrails (prompt injection detection, PII masking, policy-as-code) via `before_model_request` / `after_model_request` lifecycle hooks. Setup: `Agent(..., capabilities=[AegisCapability(engine)])`. |
There was a problem hiding this comment.
🚩 Third-party package legitimacy not verified
The listing references agent-aegis on PyPI and links to https://github.com/Acacian/aegis as the source. The description claims it implements AbstractCapability with before_model_request / after_model_request hooks. Since this is a third-party package listing, the maintainers may want to verify that the package actually implements AbstractCapability as claimed (rather than, e.g., monkey-patching or using the older auto_instrument() pattern referenced in an earlier commit a96aef92). The commit history shows the description was updated from aegis.auto_instrument() to AegisCapability(engine), suggesting the package API may have recently changed.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
@DouweM Just checking if the updated implementation addresses your concern — Aegis now exposes AegisCapability as a proper AbstractCapability subclass rather than relying on monkey-patching. Happy to adjust further if needed. |
Implements pydantic_ai.capabilities.AbstractCapability so Aegis guardrails run as a first-class Pydantic AI capability via before_model_request / after_model_request lifecycle hooks — no monkey-patching required. Addresses pydantic/pydantic-ai#4888 reviewer feedback. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
@Acacian Please move this to the right section in the docs. |
516109a to
394906e
Compare
|
@Kludex Thanks for the review! Moved Aegis under the existing "Guardrails & Safety" section and rebased on latest main. |
Implements pydantic_ai.capabilities.AbstractCapability so Aegis guardrails run as a first-class Pydantic AI capability via before_model_request / after_model_request lifecycle hooks — no monkey-patching required. Addresses pydantic/pydantic-ai#4888 reviewer feedback. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Implements pydantic_ai.capabilities.AbstractCapability so Aegis guardrails run as a first-class Pydantic AI capability via before_model_request / after_model_request lifecycle hooks — no monkey-patching required. Addresses pydantic/pydantic-ai#4888 reviewer feedback. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
This PR is stale, and will be closed in 7 days if no reply is received. |
| Capabilities for cost control, input/output filtering, and tool permissions help keep agents safe and within budget: | ||
|
|
||
| * [`pydantic-ai-shields`](https://github.com/vstorm-co/pydantic-ai-shields) - Ready-to-use guardrail capabilities: `CostTracking` (tracks token usage and USD cost per run, raises `BudgetExceededError` on budget overrun); `ToolGuard` (block or require approval for specific tools); `InputGuard` and `OutputGuard` (custom sync or async validation functions); `PromptInjection`, `PiiDetector`, `SecretRedaction`, `BlockedKeywords`, and `NoRefusals` content shields. | ||
| * [`agent-aegis`](https://pypi.org/project/agent-aegis/) ([source](https://github.com/Acacian/aegis)) - `AegisCapability` implements [`AbstractCapability`][pydantic_ai.capabilities.AbstractCapability] to enforce governance guardrails (prompt injection detection, PII masking, policy-as-code) via lifecycle hooks. Setup: [`Agent`][pydantic_ai.Agent]`(..., capabilities=[AegisCapability(engine)])`. |
There was a problem hiding this comment.
It's not clear where AegisCapability should even be imported from; can you link to a Pydantic AI specific page in your docs/repo? If there isn't one with full examples, it doesn't warrant a mention here -- sorry.
There was a problem hiding this comment.
Updated the entry and the aegis repo to address your feedback:
- Import path is now shown inline:
from aegis.contrib.pydantic_ai - Linked to the Pydantic AI integration guide with full runnable examples (native
AbstractCapabilityusage) - Dropped the
auto_instrumentmention to keep it focused on the capability interface
Also added pydantic-ai as an optional dependency and integration tests with TestModel on the aegis side.
…antic-ai Add import path, full example, and comparison table for the native AbstractCapability approach alongside the existing auto_instrument docs. Addresses pydantic/pydantic-ai#4888 review feedback. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add agent-aegis to the Governance & Safety section of third-party capabilities. AegisCapability wraps a guardrail engine into capability lifecycle hooks, providing prompt injection detection, PII masking, toxicity filtering, and YAML policy-as-code rules. Co-Authored-By: Claude Opus 4.6 <[email protected]>
6ed34fd to
2685920
Compare
|
@DouweM Gentle ping — I addressed your feedback on 4/22 (inline import path, linked full integration guide with examples). Could you take another look when you get a chance? Happy to make further changes if needed. Thanks! |
Summary
Add
agent-aegisto the "Governance & Safety" subsection of third-party capabilities.What it adds
One bullet in the existing list —
AegisCapability(from aegis.contrib.pydantic_ai) is a nativeAbstractCapabilitythat wraps a guardrail engine intobefore_model_request/after_model_requesthooks. Features exposed through the capability:GuardrailEngine.from_pack()on_block="raise"/"warn"and per-agentcheck_input/check_outputcontrolImport:
from aegis.contrib.pydantic_ai import AegisCapability