EnforceCore

The runtime enforcement layer for agentic AI systems.

EnforceCore provides mandatory, policy-driven enforcement at every external call boundary for any Python-based agentic system. It ensures that AI agents operate within defined safety constraints โ€” tool access, PII redaction, cost budgets, rate limits, content rules, and network controls โ€” with cryptographically verifiable audit trails.

Quick Start

pip install enforcecore
from enforcecore import enforce

@enforce(policy="policies/strict.yaml")
async def search_web(query: str) -> str:
    return await api.search(query)

Key Features

Feature Description
๐Ÿ”’ Policy Enforcement YAML-defined policies with allow/deny lists, tool gating
๐Ÿ•ต๏ธ PII Redaction Regex-based detection of emails, phones, SSNs, credit cards, secrets
๐Ÿ“œ Merkle Audit Trail SHA-256 chained, tamper-proof audit logs
๐Ÿ’ฐ Cost & Resource Guard Budget tracking, time limits, memory limits, kill switch
๐ŸŒ Network Control Domain allow/deny lists with wildcard support
โšก Rate Limiting Sliding-window per-tool and global rate limits
๐Ÿ”Œ Framework Integrations LangChain callback handler, LangGraph, CrewAI, AutoGen adapters
๐Ÿ“Š OpenTelemetry Traces, metrics, and spans for observability
๐Ÿงช Evaluation Suite 26 adversarial scenarios across 11 threat categories + benchmarks
๐Ÿ”Œ Plugin Ecosystem Custom guards, redactors, and audit backends via PyPI entry-points
๐Ÿ“‹ Compliance Reporting EU AI Act, SOC2, GDPR compliance exports
๐Ÿ—๏ธ Multi-Tenant Hierarchical policies with tenant-level isolation