aegis.runtime

Identity proves who an agent is. Aegis decides what it's allowed to do.

A deterministic capability-enforcement layer for AI agents on the Model Context Protocol. Every tool call is evaluated against a spec before it reaches the server, with no LLM anywhere in the enforcement path.

v0.2.0 — pip-installable, 218 tests, public
$ python -m tools.demo_end_to_end
TOOL-CALL SEQUENCE — one agent run

1 SPEC_LOADED  opens run
2 OK          read_text_file  action-items.txt
3 OK          read_text_file  agenda.txt
4 OK          read_text_file  meeting-notes.txt
5 DENIED      read_text_file  project-update.txt
rule-7-value-not-allowed
The injected instruction asked for a fourth file.
The MCP server never saw the request.

How a tool call gets evaluated

1
Request
A user or operator describes the task in plain language.
2
Proposer
An LLM reads the request once, upfront, and drafts a minimum-capability spec. It never sees tool output.
3
Spec
The spec is validated and frozen. From here, nothing widens it.
4
Enforcement
Every tool call is checked against the spec by pure, deterministic code.
5
Tool
Allowed calls reach the MCP server. Denied calls never do.

The enforcement path contains no LLM. The proposer runs once, on trusted input, before execution starts. After that, every decision is computed in microseconds and is provable by reading the code.

Two pieces

REQUIRED

The library

A Python package that wraps any Pydantic AI toolset in one line. Evaluates every tool call against a capability spec, intercepts sensitive ones for human approval, scans responses for leaked secrets, and writes a local audit log.

pip install and nothing else. Works standalone.

OPTIONAL

The control plane

A self-hosted backend that aggregates audit records across agents and makes them queryable. Reconstruct any run, find every refused call, prove which policy version made each decision.

Self-hosted, docker compose up. Never in the enforcement path — if it's unreachable, tool calls are still evaluated and decisions are still correct.

What it does today

Deterministic enforcement
Every MCP tool call is evaluated against a capability spec before it reaches the server. Literal matching only — no globs, no regex, no inferred scope.
LLM-generated specs
A natural-language request becomes a minimum-capability YAML spec, generated once and validated before use.
Human approval on sensitive calls
Operator-defined intercept rules pause a call for sign-off before it proceeds, through a callback you control.
Response inspection
Deterministic scanning for leaked secrets — SSNs, credit cards, private keys, cloud credentials — before a response reaches the agent.
Forensic audit trail
Every decision is logged with the exact policy version and prompt version that produced it. Waivers and denials are greppable by rule.
Central audit aggregation
The optional control plane collects records across agents into Postgres, with a query API and a read-only web view for reconstructing any run.
OTLP export
Audit events flow into your existing observability stack — Datadog, Jaeger, or anything OTLP-compatible.

Where it sits

Identity vendors answer one question: is this agent allowed in. Aegis answers a different one: what is it allowed to do once it's in. These are separate layers, and Aegis doesn't compete with the first one. It picks up where that one leaves off.

Your identity provider — authenticates the agent
↓
Aegis — decides what the authenticated agent may do, per task
↓
MCP server — only sees the calls Aegis allowed through

It works with any identity system, any observability stack, and drops into an existing Pydantic AI agent with one line of code.

Writing

Current status

STAGE
Pre-production. v0.2.0 shipped, public, pip-installable. 218 tests in the library, 317 in the control plane.
BUILT FOR
Platform and security engineers running agents with real tool-calling access — especially where "prove what the agent did" is a requirement rather than a nice-to-have.
TALK TO ME
Building agents with real tool access? I'd like to hear what your team is running into. obengbuo@aegisruntime.dev