Skip to main content

AI agent data access control — control what agents can see

Project description

aegis-trust

PyPI version Python versions License: MIT

The trust layer for AI agents. One decorator controls what agents can see.

pip install aegis-trust

30-Second Quickstart

from aegis import shield

@shield(purpose="customer_support", scope=["name", "issue"])
def get_customer(id):
    return {
        "name": "Tanaka Taro",
        "email": "tanaka@example.com",       # hidden
        "card": "4242-****-****-1234",        # hidden
        "issue": "Login problem",
    }

get_customer(1)
# → {"name": "Tanaka Taro", "issue": "Login problem"}

The agent never sees email or card. No config files. No middleware. One line.

Two Filtering Modes

Whitelist — keep only these fields:

@shield(purpose="support", scope=["name", "issue"])

Blacklist — hide these fields, keep everything else:

@shield(purpose="billing", deny_fields=["card", "ssn"])

scope and deny_fields are mutually exclusive. Specifying both raises ValueError.

FastMCP Integration

@shield works with any decorator. Stack it with FastMCP's @mcp.tool():

from fastmcp import FastMCP
from aegis import shield

mcp = FastMCP("customer-service")

@mcp.tool()
@shield(purpose="customer_support", scope=["name", "issue"])
def get_customer(customer_id: str) -> dict:
    """Look up a customer by ID."""
    return db.get(customer_id)

Every MCP tool call now respects purpose-based access control.

How It Works

Your function                    @shield                     AI agent
─────────────                    ───────                     ────────
return {                    ┌─ scope=["name","issue"] ─┐
  "name": "Tanaka",        │                           │    {"name": "Tanaka",
  "email": "t@ex.com", ──→ │  filter by purpose        │ ──→ "issue": "Login"}
  "card": "4242-****",     │                           │
  "issue": "Login",        └───────────────────────────┘
}                               email, card blocked

Aegis Platform

aegis-trust is the open-source entrypoint to the Aegis platform — a trust layer for AI agents.

For production deployments with full audit, policy orchestration, and enterprise controls, contact sales@incierge.com.

API Reference

@shield(purpose, scope=None, *, deny_fields=None, mode=Mode.AUTO)

Decorator that controls data access based on purpose.

  • purpose (str): Why the agent needs this data.
  • scope (list[str]): Whitelist — fields the agent can see.
  • deny_fields (list[str]): Blacklist — fields to hide.
  • mode (Mode): Operating mode (AUTO, LITE, FULL).

sync_policies(policies)

Sync purpose policies to aegis-core (Full mode only).

Types

  • Mode — LITE, FULL, AUTO
  • AccessPolicy — purpose + scope + deny_fields
  • ShieldResult — result wrapper with metadata

Security & Cryptographic Posture

aegis-trust uses OpenTimestamps (OTS) over the Bitcoin blockchain to anchor CI attestation timestamps (AO-004 audit completeness). OTS provides tamper-evident chronology for audit records.

OTS is not a post-quantum cryptography (PQC) substitute. OTS anchors SHA-256 hashes to Bitcoin's proof-of-work chain, which relies on classical cryptographic assumptions. When NIST PQC standards (FIPS 203/204/205) mature, aegis-trust will migrate accordingly. As of v0.6.4, attestation hashes use SHA-3-512 (NIST FIPS 202) as a pre-PQC bridging measure.

For vulnerability reports and security inquiries, contact security@incierge.com.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aegis_trust-0.6.5.2.tar.gz (123.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aegis_trust-0.6.5.2-py3-none-any.whl (92.7 kB view details)

Uploaded Python 3

File details

Details for the file aegis_trust-0.6.5.2.tar.gz.

File metadata

  • Download URL: aegis_trust-0.6.5.2.tar.gz
  • Upload date:
  • Size: 123.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for aegis_trust-0.6.5.2.tar.gz
Algorithm Hash digest
SHA256 4a89d28d5186d839fe6aff6cb0dee2e3c38bd87909bbf595b140aa166e8d672e
MD5 3c9a29d01c34c303eab01689eb3a0ab9
BLAKE2b-256 19c3f3a5b6ae3f74b3046bf98c990469d3027b9c2ce26a6b348cb493bd1f9577

See more details on using hashes here.

File details

Details for the file aegis_trust-0.6.5.2-py3-none-any.whl.

File metadata

  • Download URL: aegis_trust-0.6.5.2-py3-none-any.whl
  • Upload date:
  • Size: 92.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for aegis_trust-0.6.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d0f8f1bf10b9d5fc3f18d2f61edc158aca323ec8256355e6ee07a5cb7c8e4143
MD5 b4e22248b78c7489bde21200e7766062
BLAKE2b-256 d34010d59fca10afb2065c1a3ccdf2c1fed0334778a88c3d09777b66dae31fc9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page