1 of 6 files were uploaded without provenance metadata. View details.
AgentProof
Runtime policy enforcement for AI agents. One line to protect your users.
AgentProof ensures your AI agents never take unauthorized actions. Write policies in the Aegis language, compile them, and enforce them at runtime with <10ms latency.
Install
pip install agentproof
Requires Python 3.9+. The package includes a pre-compiled Rust native extension — no Rust toolchain needed for installation.
Quick Start
OpenAI
from agentproof import enforce
import openai
client = openai.OpenAI()
safe_client = enforce(client, policy="guard.aegisc")
# Use exactly as before — AgentProof intercepts every tool call
response = safe_client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Check the weather"}],
tools=[...],
)
If the agent tries to call an unauthorized tool:
agentproof.EnforcementError: AgentProof: External HTTP calls are not permitted
LangChain
from agentproof import AgentProofCallbackHandler
handler = AgentProofCallbackHandler(policy="guard.aegisc")
agent = create_react_agent(llm, tools, callbacks=[handler])
Direct Engine
For custom frameworks or advanced use cases:
from agentproof import PolicyEngine
engine = PolicyEngine.from_file("guard.aegisc")
result = engine.evaluate("tool_call", {
"tool": "http_request",
"url": "https://api.external.com/data",
"method": "POST",
})
print(result.verdict) # "deny"
print(result.reason) # "External request to unapproved destination"
print(result.eval_time_us) # 42 (microseconds)
Decorator
Wrap individual tool functions:
from agentproof import intercept_tool_call
engine = PolicyEngine.from_file("guard.aegisc")
@intercept_tool_call(engine)
def send_email(to: str, subject: str, body: str):
...
Writing Policies
Policies are written in the Aegis language and compiled with the aegisc CLI:
policy DataGuard {
severity high
scope tool_call, data_access
on tool_call {
when event.tool contains "http"
deny with "External HTTP calls blocked"
}
proof NoDataLeaks {
invariant InternalOnly {
always(
none(context.tool_calls, c =>
c.url starts_with "http://external"
)
)
}
}
}
aegisc compile guard.aegis -o guard.aegisc
The compiler transforms temporal invariants (always, eventually, until, never) into deterministic state machines. At runtime, the verifier advances these automata on every event — no regex, no string matching, no validators. Mathematical guarantees.
How It Works
Agent → tool call → AgentProof intercepts → Policy engine evaluates → Verdict
↓
allow / deny / audit / redact
- Your agent decides to call a tool
- AgentProof intercepts the call and builds an event
- The compiled policy is evaluated against the event (<10ms)
- A verdict is returned: allow, deny (with reason), audit (log but allow), or redact (allow with sanitized fields)
- The decision is logged to an immutable audit trail
Enforcement Modes
The enforce() wrapper supports three modes:
# Raise an exception on deny (default)
safe_client = enforce(client, policy="guard.aegisc", on_deny="raise")
# Block silently (same behavior, different semantics)
safe_client = enforce(client, policy="guard.aegisc", on_deny="block")
# Monitor mode — log denials but allow all actions
safe_client = enforce(client, policy="guard.aegisc", on_deny="log")
Monitor mode is useful for deploying AgentProof alongside an existing agent to see what would be blocked before turning on enforcement.
Dependencies
The base package has zero Python dependencies beyond the compiled Rust extension. Framework integrations are optional:
pip install agentproof[openai] # adds openai>=1.0
pip install agentproof[langchain] # adds langchain-core>=0.1
Fail-Closed Design
If the Rust engine returns an error or the pyo3 bridge fails for any reason, the default behavior is to deny the action, not allow it. This is a security product — silent failures must not become silent permissions.
Building from Source
If you want to build the native extension yourself:
# Prerequisites: Rust stable toolchain + maturin
pip install maturin
# Build in development mode
cd agentproof-python
maturin develop
# Run tests
pytest
Part of AgentProof
This SDK is the Python interface to AgentProof's compiler and runtime verifier. The full project, including the Aegis language specification, is at github.com/ScottsSecondAct/agentproof.
License
Apache 2.0
Metadata
Release files for aegis-enforce 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Incomplete provenance
1 of 6 files were uploaded without provenance metadata.
We recommend further investigation before installing these files. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aegis_enforce-0.1.0.tar.gz | 93.7 kB | With provenance | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| aegis_enforce-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.34+ x86-64 | Details |
| aegis_enforce-0.1.0-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
| aegis_enforce-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.17+ x86-64 | Details |
| aegis_enforce-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.17+ ARM64 | Details |
| aegis_enforce-0.1.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl | CPython 3.11 | CPython 3.11 | macOS 11.0+ ARM64, macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64) | Details |
Total release size: 3.4 MB
Release files / aegis_enforce-0.1.0.tar.gz
Incomplete provenance
This file belongs to a release with incomplete provenance: while this file has provenance metadata, other files in this release do not.
We recommend further investigation before installing this file. View details.
| Download URL | aegis_enforce-0.1.0.tar.gz |
|---|---|
| Size | 93.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c5c62bf99d4c83f10fbe1681ae529fc655b1aa9bbf50608b7c1be9901319ecd
|
|
BLAKE2b-256 checksum How to use checksums |
44853ed9d40a7d35b6ea27713ba0209e38a15241e939c8ac8a175a2adec03d09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.
Transparency logRelease files / aegis_enforce-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Incomplete provenance
This file belongs to a release with incomplete provenance: while other files in this release have provenance metadata, this file does not.
We recommend further investigation before installing this file. View details.
| Download URL | aegis_enforce-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 596.6 kB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
8e5b3883d3883c8692a427ef58390964e626769b2e541b26944620fbdae08f7e
|
|
BLAKE2b-256 checksum How to use checksums |
35d66a6bda0348931148b8681050d883dbdaa3a9b0ba2b15d23da62a949f9113
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / aegis_enforce-0.1.0-cp311-cp311-win_amd64.whl
Incomplete provenance
This file belongs to a release with incomplete provenance: while this file has provenance metadata, other files in this release do not.
We recommend further investigation before installing this file. View details.
| Download URL | aegis_enforce-0.1.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 438.1 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
81c6e90a48ccb9c1289a2ec25f3b804709fe9e0199389e48e44b18e82baa218f
|
|
BLAKE2b-256 checksum How to use checksums |
0984d89b7ac36ce04ecd5f6c45b7e1e5043ff5c464e5a97be7565bbe7cf68b88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.
Transparency logRelease files / aegis_enforce-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Incomplete provenance
This file belongs to a release with incomplete provenance: while this file has provenance metadata, other files in this release do not.
We recommend further investigation before installing this file. View details.
| Download URL | aegis_enforce-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 608.6 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
ce0716fa15d3c2d5e5a3294f050068645c47d6aebcda5df2bcc3670bb79cde3e
|
|
BLAKE2b-256 checksum How to use checksums |
10c4051da11d15363b67cc7e213059a237567c9a67b142a26fcaf08d659d0235
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.
Transparency logRelease files / aegis_enforce-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Incomplete provenance
This file belongs to a release with incomplete provenance: while this file has provenance metadata, other files in this release do not.
We recommend further investigation before installing this file. View details.
| Download URL | aegis_enforce-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 583.5 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
4f551fd4a2a5902f307013d4ffd3cdd13b10a677661b430e90d4a466360b4c62
|
|
BLAKE2b-256 checksum How to use checksums |
3f2744921eeddc959f94fdea730ebb2d17eccc60a8f7e783f94b14ac1c883831
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.
Transparency logRelease files / aegis_enforce-0.1.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Incomplete provenance
This file belongs to a release with incomplete provenance: while this file has provenance metadata, other files in this release do not.
We recommend further investigation before installing this file. View details.
| Download URL | aegis_enforce-0.1.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.11 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
41bcf2469de4e3d20b0383415f9188d999891e5d243a5fc2a6c3ee15fd3b4241
|
|
BLAKE2b-256 checksum How to use checksums |
f2653565b12015f5641986bb8f5ef7505afc40e144107a7efb1e189a492add16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.
Transparency logSecurity for aegis-enforce 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Incomplete provenance
1 of 6 files were uploaded without provenance metadata.
Attestation for aegis_enforce-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.